[Pellet-users] Problem with transitive subProperties
Horst Gutmann
zerok at zerokspot.com
Wed Apr 16 12:16:30 UTC 2008
Hi :-)
I'm currently trying to do some SPARQL queries on transitive object
properties using Pellet as reasoner with Jena, but for some reason I
don't get the resultSet I'd expect.
Let's say I have a property called "contains" with 2 sub-properties
"depicts" and "affects"; each of them being a owl:TransitiveProperty.
Then I have these triples:
A depicts B
B affects C
Since "depicts" and "affects" are both sub-properties of "contains",
in my opinion this query should return a _not-empty_ resultSet (with A
and C as the result-pair):
SELECT ?a ?c WHERE {
?a <...#contains> ?c
}
Is this correct or have I completely misunderstood transitivity on OWL?
Just to be on the safe side here is also the code I use to load the
ontology and the database model:
// [...]
this._dbConnection = dataSource.getConnection();
this._jenaConnection = new DBConnection(this._dbConnection, "PostgreSQL");
try {
this._model = ModelRDB.open(this._jenaConnection);
}
catch(com.hp.hpl.jena.shared.DoesNotExistException e){
this._model = ModelRDB.createModel(this._jenaConnection);
}
org.mindswap.pellet.PelletOptions.USE_CONTINUOUS_RULES = true;
org.mindswap.pellet.PelletOptions.USE_CACHING = false;
this._ontmodel =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
String tmp = "http://lala.com/base.owl"
if (tmp == null){
log.warn("No ontologies specified");
}
else {
for (String o : tmp.split(" ")){
this._ontmodel.read(o);
}
}
com.hp.hpl.jena.reasoner.Reasoner r =
org.mindswap.pellet.jena.PelletReasonerFactory.theInstance().create();
r.bindSchema(this._ontmodel);
this._infmodel = ModelFactory.createInfModel(r, _model);
// Now on to doing the actual query:
Query q = QueryFactory.create(queryString);
QueryExecution qexec = QueryExecutionFactory.create(q, this._infmodel);
ResultSet rs = qexec.execSelect();
I hope you can help me with this one :-)
Thanks,
Horst
More information about the Pellet-users
mailing list