namedgraph opened a new issue, #1450:
URL: https://github.com/apache/jena/issues/1450

   ### Version
   
   4.5.0
   
   ### What happened?
   
   Writing Model as RDF/XML started giving this exception. I cannot pinpoint 
any changes that could have caused it, the code in this area has been stable 
for a long time. I can serialize the same model as Turtle (and then 
re-serialize as RDF/XML using riot CLI) just fine. The data can be provided if 
it helps.
   
   Some investigation I did:
   * `this.getPrefixFor( value )` returns `null`, where value is 
`http://www.w3.org/2001/XMLSchema#`: 
https://github.com/apache/jena/blob/main/jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/BaseXMLWriter.java#L229
   * `Relation::backwards` returns `null` because 
`http://www.w3.org/2001/XMLSchema#` is not in the `cols` map: 
https://github.com/apache/jena/blob/main/jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/Relation.java#L204
   
   ### Relevant output and stacktrace
   
   ```shell
   java.lang.NullPointerException: Cannot invoke "String.equals(Object)" 
because "prefix" is null
   
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.checkLegalPrefix(BaseXMLWriter.java:845)
   
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setNsPrefix(BaseXMLWriter.java:324)
   
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.primeNamespace(BaseXMLWriter.java:232)
   
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setupNamespaces(BaseXMLWriter.java:482)
   
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:466)
   
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:456)
   
com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider.write(ValidatingModelProvider.java:129)
   ```
   
   
   ### Are you interested in making a pull request?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to