I'm using this ontology, generated on Protege. Below is the code.
location = new Location (database);
schema = FileManager.get().loadModel(ontology);
reasoner = PelletReasonerFactory.theInstance().create();
Dataset data = getNewDataset();
data.begin(ReadWrite.READ);
InfModel model = ModelFactory.createInfModel(reasoner, schema, data.getDefaultModel());
String queryString =
" PREFIX ns: <http://www.semanticweb.org/ontologies/2012/10/music.owl#> " +
" PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
" SELECT ?a ?b " +
" WHERE {" +
" ?a rdf:type ns:Artist . " +
" ?a ns:isSimilarTo ?b . " +
" }";
Query query = QueryFactory.create(queryString);
QueryExecution exec = QueryExecutionFactory.create(query, model);
ResultSet results = exec.execSelect();
ResultSetFormatter.out(results);
exec.close();
Triple store entry example below.
| http://www.semanticweb.org/ontologies/2012/10/music.owl#Bill Laswell (MN0000075979) | http://www.semanticweb.org/ontologies/2012/10/music.owl#isSimilarTo | http://www.semanticweb.org/ontologies/2012/10/music.owl#Material (MN0000386865) |
Any idea why the symmetric property is not inferred? For Artist #Material (MN0000386865) the query won't find anything.
asked
16 Jan, 20:52
dpereira1
23●4
accept rate:
0%
Duplicated at http://stackoverflow.com/questions/14371791/jena-and-pellet-reasoner-not-working-on-symmetric-property
Sounds like it's a problem with your ontology/data or a mismatch with your query. We don't have enough information to answer on those points.