[
https://issues.apache.org/jira/browse/JENA-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16526317#comment-16526317
]
Claude Warren commented on JENA-1567:
-------------------------------------
I get:
14:46:39.861 [main] ERROR org.apache.jena.riot - [line: 6, col: 7 ] Unexpected
attribute : :datatype at typedLiteral
Exception in thread "main" org.apache.jena.riot.RiotException: [line: 6, col: 7
] Unexpected attribute : :datatype at typedLiteral
at
org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStrict.error(ErrorHandlerFactory.java:194)
at org.apache.jena.riot.lang.ReaderTriX.staxError(ReaderTriX.java:429)
at org.apache.jena.riot.lang.ReaderTriX.staxError(ReaderTriX.java:425)
at org.apache.jena.riot.lang.ReaderTriX.attribute(ReaderTriX.java:414)
at org.apache.jena.riot.lang.ReaderTriX.term(ReaderTriX.java:298)
at org.apache.jena.riot.lang.ReaderTriX.read(ReaderTriX.java:225)
at org.apache.jena.riot.lang.ReaderTriX.read(ReaderTriX.java:101)
at org.apache.jena.riot.RDFParser.read(RDFParser.java:334)
at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:324)
at org.apache.jena.riot.RDFParser.parse(RDFParser.java:273)
at org.apache.jena.riot.RDFParser.parse(RDFParser.java:235)
at org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:510)
at Y.main(Y.java:40)
> Trix deserialization does not respect default namepace
> ------------------------------------------------------
>
> Key: JENA-1567
> URL: https://issues.apache.org/jira/browse/JENA-1567
> Project: Apache Jena
> Issue Type: Bug
> Components: RIOT
> Affects Versions: Jena 3.6.0, Jena 3.7.0, Jena 3.8.0
> Reporter: Claude Warren
> Priority: Major
> Attachments: Y.java
>
>
> TriX output serialized by jena will produce xml that uses the default
> namespace.
> <trix xmlns="http://www.w3.org/2004/03/trix/trix-1/">
> <graph>
> <triple>
>
> <uri>urn:publicid:example.com:Device;67a2a324-cb08-30b2-b02d-096eceee933b;172.21.23.16</uri>
> <uri>[http://purl.org/dc/elements/1.1/title]</uri>
> <typedLiteral
> datatype="http://www.w3.org/2001/XMLSchema#string">172.21.23.16</typedLiteral>
> </triple>
> </graph>
> </trix>
>
> When the ReaderTrix class attempts to deserialize the xml the "datatype"
> attribute namespace is not properly detected.
>
> This appears to be in the
> {{private String attribute(XMLStreamReader parser, String nsURI, String
> localname)}}
>
> The problem appears to be that parser.getAttributePrefix() returns an empty
> string and parser.getAttributeNamespace() returns an emptry string (Not NULL)
> so we don't call parser.getName().getNamespaceURI() to set the attrNS value
> so the equality check fails and we throw an exception.
> I think that checking for "" should be added to the null check though " "
> should also probably call the parser.getName().getNamespaceURI() method.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)