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,14 +848,19 @@ public class IndividualSDB extends IndividualImpl implements Individual {
String getTypes = String getTypes =
"CONSTRUCT{ <" + this.individualURI + "> <" + RDF.type + "CONSTRUCT{ <" + this.individualURI + "> <" + RDF.type +
"> ?types }\n" + "> ?types }\n" +
"WHERE{ GRAPH ?g" "WHERE{ { GRAPH ?g"
+ " { <" + this.individualURI +"> <" +RDF.type+ "> ?types } \n" + " { <" + this.individualURI +"> <" +RDF.type+ "> ?types } \n"
+ WebappDaoFactorySDB.getFilterBlock( + WebappDaoFactorySDB.getFilterBlock(
graphVars, (direct graphVars, (direct
? WebappDaoFactorySDB.SDBDatasetMode ? WebappDaoFactorySDB.SDBDatasetMode
.ASSERTIONS_ONLY .ASSERTIONS_ONLY
: datasetMode)) : datasetMode))
+ "} \n"; + "} \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(); RDFService service = webappDaoFactory.getRDFService();
try { try {
tempModel = RDFServiceUtils.parseModel( tempModel = RDFServiceUtils.parseModel(