You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/02 13:02:57 UTC

[jira] [Resolved] (JENA-216) Official Turtle Test-18 does not parse

     [ https://issues.apache.org/jira/browse/JENA-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne resolved JENA-216.
--------------------------------

    Resolution: Fixed

(there aren't any "offical test yet :: RDF-WG has copied over old tests and is adding a few but nothing official yet.)

test-18.ttl does parse in the new parsers.  You're using the old ones because you haven't touched anything that causes them to wire themselves in.  We're in transition.

Add SysRIOT.wireIntoJena() or, easier, ARQ.init(), just use the command line tools;

Note: there is a unicode code point beyond the basic plane in that data.  It will not perfectly round trip in Java (or scala on the JVM) because java does not support such codepoints except as combining chars.

java -cp ... arq.riot test-18.ttl =>
<http://example.org/foo#a> <http://example.org/foo#b> "\nthis \ris a \uD815\uDE78long\t\nliteral\uABCD\n" .
<http://example.org/foo#d> <http://example.org/foo#e> "\tThis \uABCDis\r \uD815\uDE78another\n\none\n" .

Note: the \U is now two \u's.

                
> Official Turtle Test-18 does not parse
> --------------------------------------
>
>                 Key: JENA-216
>                 URL: https://issues.apache.org/jira/browse/JENA-216
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: ARQ 2.9.0
>         Environment: Java 6, OSX
>            Reporter: Henry Story
>
> I am having trouble Trying to parse http://www.w3.org/TR/turtle/tests/test-18.ttl which contains the following two lines
> <http://example.org/foo#a> <http://example.org/foo#b> "\nthis \ris a \U00015678long\t\nliteral\uABCD\n" .
> <http://example.org/foo#d> <http://example.org/foo#e> "\tThis \uABCDis\r \U00015678another\n\none\n" .
> scala> import java.io._
> import java.io._
> scala> import com.hp.hpl.jena.rdf.model._
> import com.hp.hpl.jena.rdf.model._
> scala> val f = "/Volumes/Dev/Programming/w3.org/git/pimp-my-rdf/n3-test-suite/target/scala-2.9.1/classes/www.w3.org/TR/turtle/tests/test-18.out"
> f: java.lang.String = /Volumes/Dev/Programming/w3.org/git/pimp-my-rdf/n3-test-suite/target/scala-2.9.1/classes/www.w3.org/TR/turtle/tests/test-18.out
> scala> val in = new InputStreamReader(new BufferedInputStream(new FileInputStream(f)),"UTF-8")
> in: java.io.InputStreamReader = java.io.InputStreamReader@1e392427
> scala> val model = ModelFactory.createDefaultModel()
> model: com.hp.hpl.jena.rdf.model.Model = <ModelCom   {} | >
> scala> model.read(in,"file:/"+f,"TTL")
> com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line 1, column 71.  Encountered: "U" (85), after : "\"\\nthis \\ris 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:49)
> 	at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:261)
> or more directly
>  scala> model.read("http://www.w3.org/TR/turtle/tests/test-18.ttl","TTL")
> com.hp.hpl.jena.n3.turtle.TurtleParseException: Lexical error at line 3, column 25.  Encountered: "U" (85), after : "\"\\nthis \\ris 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:49)
> 	at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:60)
> 	at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:241)
> This is with the 2.9 release of Jena for December which I imported into my project with 
>     "org.apache.jena" % "jena-arq" % "2.9.0-incubating"

--
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