From 6f2bda9178d15ce03a48b799aaa77d2564985a80 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 27 Nov 2012 12:57:13 -0500 Subject: [PATCH] added GRAPH-less pattern to type query in IndividualSDB to support triple stores that supply inferences in the unnamed graph --- .../mannlib/vitro/webapp/dao/jena/IndividualSDB.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java index c2467f412..a12bd2fbe 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java @@ -848,14 +848,19 @@ 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"; + + "} \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 { tempModel = RDFServiceUtils.parseModel(