added GRAPH-less pattern to type query in IndividualSDB to support triple stores that supply inferences in the unnamed graph

This commit is contained in:
brianjlowe 2012-11-27 12:57:13 -05:00
parent b0a5961f4d
commit 6f2bda9178

View file

@ -848,13 +848,18 @@ public class IndividualSDB extends IndividualImpl implements Individual {
String getTypes =
"CONSTRUCT{ <" + this.individualURI + "> <" + RDF.type +
"> ?types }\n" +
"WHERE{ GRAPH ?g"
"WHERE{ { GRAPH ?g"
+ " { <" + this.individualURI +"> <" +RDF.type+ "> ?types } \n"
+ WebappDaoFactorySDB.getFilterBlock(
graphVars, (direct
? WebappDaoFactorySDB.SDBDatasetMode
.ASSERTIONS_ONLY
: datasetMode))
+ "} \n"
// GRAPH-less pattern to support retrieving inferred types
// from the unnamed base graph, as in Sesame and OWLIM
+ ((datasetMode.equals(WebappDaoFactorySDB.SDBDatasetMode.ASSERTIONS_ONLY))
? "" : "UNION { <" + this.individualURI +"> <" +RDF.type+ "> ?types }" )
+ "} \n";
RDFService service = webappDaoFactory.getRDFService();
try {