NIHVIVO-2299 Property will match even if it is not declared as a DataProperty in the ontology.
This commit is contained in:
parent
734067f1b4
commit
4dfbf6920b
2 changed files with 8 additions and 2 deletions
|
@ -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
|
* 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
|
* 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.
|
* 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){
|
public List<Individual> getIndividualsByDataProperty(String dataPropertyUri, String value){
|
||||||
Property prop = null;
|
Property prop = null;
|
||||||
if( RDFS.label.getURI().equals( dataPropertyUri )){
|
if( RDFS.label.getURI().equals( dataPropertyUri )){
|
||||||
prop = RDFS.label;
|
prop = RDFS.label;
|
||||||
}else{
|
}else{
|
||||||
prop = getOntModel().getDatatypeProperty(dataPropertyUri);
|
prop = getOntModel().getProperty(dataPropertyUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( prop == null ) {
|
if( prop == null ) {
|
||||||
|
|
|
@ -222,6 +222,9 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
* In Jena it can be difficult to get an object with a given dataproperty if
|
* 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
|
* 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.
|
* 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
|
@Override
|
||||||
public List<Individual> getIndividualsByDataProperty(String dataPropertyUri, String value){
|
public List<Individual> getIndividualsByDataProperty(String dataPropertyUri, String value){
|
||||||
|
@ -229,7 +232,7 @@ public class IndividualDaoSDB extends IndividualDaoJena {
|
||||||
if( RDFS.label.getURI().equals( dataPropertyUri )){
|
if( RDFS.label.getURI().equals( dataPropertyUri )){
|
||||||
prop = RDFS.label;
|
prop = RDFS.label;
|
||||||
}else{
|
}else{
|
||||||
prop = getOntModel().getDatatypeProperty(dataPropertyUri);
|
prop = getOntModel().getProperty(dataPropertyUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( prop == null ) {
|
if( prop == null ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue