From 4dfbf6920b8239bf556cbdc361a30d5e93fdcef5 Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 7 Jun 2011 19:02:34 +0000 Subject: [PATCH] NIHVIVO-2299 Property will match even if it is not declared as a DataProperty in the ontology. --- .../mannlib/vitro/webapp/dao/jena/IndividualDaoJena.java | 5 ++++- .../mannlib/vitro/webapp/dao/jena/IndividualDaoSDB.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoJena.java index 978eeef54..29b3b8397 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoJena.java @@ -654,13 +654,16 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao { * In Jena it can be difficult to get an object with a given dataproperty if * you do not care about the datatype or lang of the literal. Use this * method if you would like to ignore the lang and datatype. + * + * Note: this method doesn't require that a property be declared in the + * ontology as a data property -- only that it behaves as one. */ public List getIndividualsByDataProperty(String dataPropertyUri, String value){ Property prop = null; if( RDFS.label.getURI().equals( dataPropertyUri )){ prop = RDFS.label; }else{ - prop = getOntModel().getDatatypeProperty(dataPropertyUri); + prop = getOntModel().getProperty(dataPropertyUri); } if( prop == null ) { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoSDB.java index 9604599bd..7e12cf122 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualDaoSDB.java @@ -222,6 +222,9 @@ public class IndividualDaoSDB extends IndividualDaoJena { * In Jena it can be difficult to get an object with a given dataproperty if * you do not care about the datatype or lang of the literal. Use this * method if you would like to ignore the lang and datatype. + * + * Note: this method doesn't require that a property be declared in the + * ontology as a data property -- only that it behaves as one. */ @Override public List getIndividualsByDataProperty(String dataPropertyUri, String value){ @@ -229,7 +232,7 @@ public class IndividualDaoSDB extends IndividualDaoJena { if( RDFS.label.getURI().equals( dataPropertyUri )){ prop = RDFS.label; }else{ - prop = getOntModel().getDatatypeProperty(dataPropertyUri); + prop = getOntModel().getProperty(dataPropertyUri); } if( prop == null ) {