improvement to direct/indirect type retrieval in IndividualSDB

This commit is contained in:
bjl23 2010-12-20 20:53:18 +00:00
parent 900caff315
commit 2935dc1b23

View file

@ -142,8 +142,8 @@ public class IndividualSDB extends IndividualImpl implements Individual {
"UNION { <" +
individualURI+"> <" + VitroVocabulary.MONIKER +
"> ?moniker } \n" +
"} \n" +
"} UNION { GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-2> { <"
"} } \n" +
"UNION { GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-2> { <"
+ individualURI + "> a ?type } } \n" +
"}";
model = QueryExecutionFactory.create(
@ -1060,15 +1060,14 @@ public class IndividualSDB extends IndividualImpl implements Individual {
private List<VClass> getMyVClasses(boolean direct) {
List<VClass> vClassList = new ArrayList<VClass>();
Model tempModel = null;
if (ind.getModel().size() > 0) {
if (ind.getModel().contains((Resource) null, RDF.type, (RDFNode) null)){
tempModel = ind.getModel();
}
else {
String getTypes =
} else {
String getTypes =
"CONSTRUCT{ <" + this.individualURI + "> <" + RDF.type +
"> ?types }\n" +
"WHERE{ GRAPH " +
((true)
((direct)
? "<http://vitro.mannlib.cornell.edu/default/vitro-kb-2>"
: "?g")
+ " { <" + this.individualURI +"> <" +RDF.type+ "> ?types \n" +