fix: workaround for jena bug. Treat integer and int equally while creating hash (#314)
This commit is contained in:
parent
ceebd3e422
commit
acd2bf6a59
1 changed files with 11 additions and 1 deletions
|
@ -55,6 +55,10 @@ public class RdfLiteralHash {
|
||||||
}else{
|
}else{
|
||||||
if( stmt.getDatatypeURI() != null && stmt.getDatatypeURI().trim().length() > 0){
|
if( stmt.getDatatypeURI() != null && stmt.getDatatypeURI().trim().length() > 0){
|
||||||
langOrDatatype = stmt.getDatatypeURI();
|
langOrDatatype = stmt.getDatatypeURI();
|
||||||
|
//Treat integer data type the same as int
|
||||||
|
//With Jena 3.16.0 all integer literals are stored as int
|
||||||
|
//TODO: remove workaround when bug is resolved
|
||||||
|
langOrDatatype = replaceIntegerWithInt(langOrDatatype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +68,12 @@ public class RdfLiteralHash {
|
||||||
return hashMe.hashCode();
|
return hashMe.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String replaceIntegerWithInt(String predicate) {
|
||||||
|
if( predicate.equals("http://www.w3.org/2001/XMLSchema#integer")) {
|
||||||
|
predicate = "http://www.w3.org/2001/XMLSchema#int";
|
||||||
|
}
|
||||||
|
return predicate;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param stmt Data statement
|
* @param stmt Data statement
|
||||||
|
|
Loading…
Add table
Reference in a new issue