Andy Seaborne created JENA-335:
----------------------------------
Summary: TDB handlign of hexBinary causes a Xerces-orinated
exception.
Key: JENA-335
URL: https://issues.apache.org/jira/browse/JENA-335
Project: Apache Jena
Issue Type: Bug
Components: Jena, TDB
Affects Versions: Jena 2.7.3, TDB 0.9.3
Reporter: Andy Seaborne
Assignee: Andy Seaborne
To reproduce in Jena core:
Node n = Node.createLiteral("AB CD", XSDDatatype.XSDhexBinary) ;
n.hashCode() ;
A bad lexical form for hexBinary causes problems for TDB:
{
Example data:
---- D.ttl
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix : <http://example/> .
:s :p "AB CD"^^xsd:hexBinary .
## :s :p "AB CD"^^xsd:float .
---- D.ttl
}
tdbloader --loc DB D.ttl ==>
WARN [line: 4, col: 7 ] Lexical form 'AB CD' not valid for datatype
http://www.w3.org/2001/XMLSchema#hexBinary
http://example/s http://example/p "AB
CD"^^http://www.w3.org/2001/XMLSchema#hexBinary
com.hp.hpl.jena.datatypes.DatatypeFormatException: Lexical form 'AB CD' is not
a legal instance of Datatype[http://www.w3.org/2001/XMLSchema#hexBinary]
Lexical form 'AB CD' is not a legal instance of
Datatype[http://www.w3.org/2001/XMLSchema#hexBinary] during parse
-org.apache.xerces.impl.dv.InvalidDatatypeValueException:
cvc-datatype-valid.1.2.1: 'AB CD' is not a valid value for 'hexBinary'.
at
com.hp.hpl.jena.graph.impl.LiteralLabelImpl.getValue(LiteralLabelImpl.java:326)
at
com.hp.hpl.jena.datatypes.xsd.XSDhexBinary.getHashCode(XSDhexBinary.java:81)
at
com.hp.hpl.jena.graph.impl.LiteralLabelImpl.hashCode(LiteralLabelImpl.java:448)
at com.hp.hpl.jena.graph.Node.hashCode(Node.java:331)
at java.util.HashMap.hash(HashMap.java:351)
The WARN is right - the exception shoudl not happen. Looks like Xerces is
behaving differently because
a bad float only causes a wanring (which is correct) and TDB continues.
The warning is right - the
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira