Hi,
Why the class NodeFactoryExtra (In api jena 3.8.0,
org.apache.jena.sparql.util.NodeFactoryExtra) converts a int/long into a
XSDinteger, but XSDint into int. The problem that I have is with the first one.
In anothers API Jena and Fuseki versions, a int was converted into XSDint, and
now is a XSDinteger, so some sparql doesn't work.
public static Node intToNode(int integer) {
return NodeFactory.createLiteral(Integer.toString(integer),
XSDDatatype.XSDinteger) ;
}
public static int nodeToInt(Node node) {
LiteralLabel lit = node.getLiteral() ;
if ( !XSDDatatype.XSDint.isValidLiteral(lit) )
return Integer.MIN_VALUE ;
int i = ((Number)lit.getValue()).intValue() ;
return i ;
}
Thanks for all
David Molina Estrada
Software Architect
Evite imprimir este mensaje si no es estrictamente necesario | Eviti imprimir
aquest missatge si no és estrictament necessari | Avoid printing this message
if it is not absolutely necessary