[ 
https://issues.apache.org/jira/browse/JENA-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418398#comment-13418398
 ] 

Rob Vesse commented on JENA-281:
--------------------------------

You didn't include a reference to the Turtle spec but looking at the grammar 
productions you appear to be referring to the following spec - 
http://www.w3.org/TeamSubmission/turtle/

This spec is in the process of being superseded by an official W3C standardized 
version of Turtle - http://www.w3.org/TR/turtle/ - which is what Jena now 
supports

The original Turtle specification allowed spaces in URIs because it was 
developed before/around the time when the RDF and SPARQL working groups were 
settling on the use of IRIs.  IRIs allow for internationalized identifiers but 
they also do not permit spaces (unlike URIs)

Therefore Jena is correct in it's behavior of rejecting URIs containing spaces 
regardless of where said URIs originate
                
> 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


Reply via email to