History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: RIO-49
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Arjohn Kampman
Reporter: Henry Story
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Rio

Turtle parser breaks on extra semicolon

Created: 31/Jul/06 06:08 PM   Updated: 02/Aug/06 06:04 PM
Component/s: Turtle parser
Affects Version/s: None
Fix Version/s: None

Environment: OSX


 Description   
I could not parse the following file:
https://sommer.dev.java.net/atom/2006-06-06/examples/example-1.atom.turtle

@prefix : <http://bblfish.net/work/atom-owl/2006-06-06/#> .
@prefix iana: <http://www.iana.org/assignments/relation/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

[ a :Feed;
 :title [ :text "Example Feed" ];
 :link [ a :Link;
           :rel iana:alternate ;
           :to [ :src <http://example.org/&gt;;]
           ];
 :updated "2003-12-13T18:30:02Z"^^xsd:dateTime;
 :author [ a :Person;
           owl:sameAs _:author1;
            :name [ :text "John Doe" ];
          ];
 :id "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6"^^xsd:anyUri;
 :entry [ a :Entry;
           :author _:author1;
           :title [ :text "Atom-Powered Robots Run Amok" ];
           :link [ a :Link;
                   :rel iana:alternate ;
                   :to [ :src <http://example.org/2003/12/13/atom03&gt;;]
                   ];
           :id "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"^^xsd:anyUri;
           :updated "2003-12-13T18:30:02Z"^^xsd:dateTime;
           :summary [ :text "Some text." ];
           ];
 ] .

If I remove the semicolon just before the last line, it works.

 All   Comments   Change History      Sort Order:
Comment by Arjohn Kampman [01/Aug/06 01:43 PM]
I can't parse this file either, but I also cannot reproduce the behaviour that you describe. Removing either or both of the last two semicolons does not "fix" the data. Can you please verify that this does work for you?

The problem that I do have with this data is that the parser expects a 'predicateObjectList' after the last square bracket. This conforms to the 'triples' production in the current Turtle grammar [1]. Apparently, according to the grammar, this document is not valid Turtle. To me, this looks like a flaw in the grammar. You may want to contact Dave Beckett about this.

As a work around, you could consider to move the last square bracket to the start of the file, e.g.:

[] a :Feed;
   :title [ :text "Example Feed" ];
   ...

[1] http://www.dajobe.org/2004/01/turtle/#sec-grammar

Comment by Henry Story [02/Aug/06 05:30 PM]
I have simplified the test case.
The following does not work with the turtle parser.

@prefix : <http://eg.com/> .
[ :xxx [ :yyy "ddd" ];
] .

Neither does this

[ :xxx [ :yyy "ddd" ]
] .

But this does:

[] :xxx [ :yyy "ddd" ] .

All work with cwm.py.

I have mailed Dave Becket.

Comment by Arjohn Kampman [02/Aug/06 06:04 PM]
OK, thanks. Please let us know what he has to say about this.