NIHVIVO-2299 Property will match even if it is not declared as a DataProperty in the ontology.

This commit is contained in:
j2blake 2011-06-07 19:02:34 +00:00
parent 734067f1b4
commit 4dfbf6920b
2 changed files with 8 additions and 2 deletions

View file

@ -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<Individual> 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 ) {

View file

@ -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<Individual> 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 ) {