Piotr Hołubowicz created JENA-281:
-------------------------------------
Summary: Turtle parser does not support spaces in URI references
Key: JENA-281
URL: https://issues.apache.org/jira/browse/JENA-281
Project: Apache Jena
Issue Type: Bug
Components: Jena
Affects Versions: Jena 2.7.2
Reporter: Piotr Hołubowicz
According to the Turtle spec [1], spaces are allowed in URI references:
{quote}
[34] relativeURI ::= ucharacter*
[41] ucharacter ::= ( character - #x3E ) | '\>'
[38] character ::= '\u' hex hex hex hex |
'\U' hex hex hex hex hex hex hex hex |
'\\' |
[#x20-#x5B] | [#x5D-#x10FFFF] // #x20 = " "
{quote}
However, when reading a turtle file with spaces in URI references, exception is
thrown:
{code}
com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line 1, column
6. Encountered: " " (32), after : "<a"
at com.hp.hpl.jena.n3.turtle.ParserTurtle.parse(ParserTurtle.java:56)
at
com.hp.hpl.jena.n3.turtle.TurtleReader.readWorker(TurtleReader.java:33)
at com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:119)
at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:84)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:268)
at
com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2241)
(...)
{code}
The Turtle writer also doesn't support unescaped spaces, so for example an RDF
graph can be uploaded to Jena in RDF/XML but downloading it in Turtle causes an
exception similar to the above.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira