From e175cca388547e9e43a1fe59d5d641f54ab4de2d Mon Sep 17 00:00:00 2001 From: ryounes Date: Fri, 15 Jul 2011 15:16:53 +0000 Subject: [PATCH] NIHVIVO-2924 Filter out mostSpecificTypes that don't belong to a classgroup --- .../jena/ObjectPropertyStatementDaoJena.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java index e4bcdedcd..924598bf4 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java @@ -385,14 +385,16 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec } - protected static final String MOST_SPECIFIC_TYPE_QUERY = - "PREFIX rdfs: <" + VitroVocabulary.RDFS + "> \n" + - "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?label ?type WHERE { \n" + - " ?subject vitro:mostSpecificType ?type . \n" + - " ?type rdfs:label ?label \n" + - "} ORDER BY ?label "; - + protected static final String MOST_SPECIFIC_TYPE_QUERY = "" + + "PREFIX rdfs: <" + VitroVocabulary.RDFS + "> \n" + + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + + "SELECT ?label ?type WHERE { \n" + + " ?subject vitro:mostSpecificType ?type . \n" + + " ?type rdfs:label ?label . \n" + + " ?type vitro:inClassGroup ?classGroup . \n" + + " ?classGroup a ?ClassGroup \n" + + "} ORDER BY ?label "; + @Override /** * Finds all mostSpecificTypes of an individual.