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 '13, 20:52

dpereira1's gravatar image

dpereira1
234
accept rate: 0%

edited 16 Jan '13, 21:02

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.

(17 Jan '13, 13:34) Signified ♦ Signified's gravatar image
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×629
×52
×5

question asked: 16 Jan '13, 20:52

question was seen: 856 times

last updated: 17 Jan '13, 13:34