Using SPARQL to get the first entity of superclasses of a certain class

349 Views Asked by At

I use Jena from Java code and Blazegraph as a server, I have tried to query the first superclass in a path of a certain class, and of course, I didn't use either * or + with the predicate rdfs:subClassOf.

The query works well from the Blazegraph interface, but when I try to apply the query from Jena and Java, it returns all superclasses!

The followings are the query and the code:

PREFIX snomed-ct: <http://ihtsdo.org/snomedct/clinicalFinding#> 
SELECT DISTINCT * 
WHERE { 

  snomed-ct:47686007 rdfs:subClassOf  ?Identifier. 
}

Query query = QueryFactory.create(queryString); 
QueryExecution qExe = QueryExecutionFactory.sparqlService("http://localhost:9999/blazegraph/namespace/snomed/sparql", query);
ResultSet results = qExe.execSelect();

I noted this, when I use the web interface of Blazegraph with URL "localhost" the query work well, but if I put the IP address instead of localhost the query returns all superclasses, but from Java code neither change using localhost or IP.

Edit: what follows is the properties file:

com.bigdata.rwstore.RWStore.readBlobsAsync=false
com.bigdata.journal.AbstractJournal.file=blazegraph.jnl

com.bigdata.journal.AbstractJournal.bufferMode=DiskRW

com.bigdata.service.AbstractTransactionService.minReleaseAge=1

com.bigdata.journal.Journal.groupCommit=false

com.bigdata.btree.writeRetentionQueue.capacity=4000
com.bigdata.btree.BTree.branchingFactor=128

com.bigdata.journal.AbstractJournal.initialExtent=209715200
com.bigdata.journal.AbstractJournal.maximumExtent=209715200

##
## Setup for QUADS mode without the full text index.
##
com.bigdata.rdf.sail.truthMaintenance=false
com.bigdata.rdf.store.AbstractTripleStore.quads=false
com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=false
com.bigdata.rdf.store.AbstractTripleStore.textIndex=false
com.bigdata.rdf.store.AbstractTripleStore.axiomsClass=com.bigdata.rdf.axioms.NoAxioms


com.bigdata.namespace.kb.lex.com.bigdata.btree.BTree.branchingFactor=400

com.bigdata.namespace.kb.spo.com.bigdata.btree.BTree.branchingFactor=1024
0

There are 0 best solutions below