Hello again,
to answer my own question, looks like 'NAN' is obviously not the same as
'NaN' and fails. So the bug is in DBpedia, sorry for the question.
Kind regards,
Lorenz
Hello,
I'm using JENA API 2.11.2 . When I load some data from DBpedia and
call the getFloat() method on a Literal object I get the following
exception:
com.hp.hpl.jena.datatypes.DatatypeFormatException: Lexical form 'NAN'
is not a legal instance of
Datatype[http://www.w3.org/2001/XMLSchema#float -> class
java.lang.Float] Lexical form 'NAN' is not a legal instance of
Datatype[http://www.w3.org/2001/XMLSchema#float -> class
java.lang.Float] during parse
-org.apache.xerces.impl.dv.InvalidDatatypeValueException:
cvc-datatype-valid.1.2.1: 'NAN' is not a valid value for 'float'.
at
com.hp.hpl.jena.graph.impl.LiteralLabelImpl.getValue(LiteralLabelImpl.java:326)
at
com.hp.hpl.jena.graph.Node_Literal.getLiteralValue(Node_Literal.java:39)
at
com.hp.hpl.jena.rdf.model.impl.LiteralImpl.getValue(LiteralImpl.java:98)
at
com.hp.hpl.jena.rdf.model.impl.LiteralImpl.getFloat(LiteralImpl.java:216)
This looks like a bug to me because NaN is allowed in XMLSchema specs
for float values and additionally, Java contains a Float.NaN constant.
Kind regards,
Lorenz
--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center