I am enabling Forward chaining like this:
static final String inputData = "http://cgi.di.uoa.gr/~pms509/past_projects/2014-2015/hw1/kallikratis.n3";
MemoryStore store = new MemoryStore();
Repository repo = new SailRepository(new ForwardChainingRDFSInferencer(store));
System.out.println("Forward chaining enabled");
repo.initialize();
//Store file
File file = new File(inputData);
String fileBaseURI = "http://www.semanticweb.org/owl/owlapi/turtle";
RDFFormat fileRDFFormat = RDFFormat.N3;
RepositoryConnection con = repo.getConnection();
con.add(file, fileBaseURI, fileRDFFormat);
...
and then I query like this:
"SELECT ?class " +
"WHERE {" +
"?rsrc geo:has_name \"foo\" . " +
"?rsrc geo:belongs_to ?a ." +
"}";
However this will not give me same results as with geo:belongs_to*
. I will get only the direct belongs_to
linkage, not the inferred ones, as I would expect!
I want to get same results however, why I am not?