[redland-dev] [Raptor RDF Syntax Library 0000508]: Raptor objects to possibly valid Turtle syntax

Mantis Bug Tracker mantis-bug-sender at librdf.org
Sun Jun 10 17:12:47 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=508 
====================================================================== 
Reported By:                normang
Assigned To:                
====================================================================== 
Project:                    Raptor RDF Syntax Library
Issue ID:                   508
Category:                   api
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Syntax Name:                Turtle 
====================================================================== 
Date Submitted:             2012-06-10 21:12
Last Modified:              2012-06-10 21:12
====================================================================== 
Summary:                    Raptor objects to possibly valid Turtle syntax
Description: 
I'm not sure whose bug this is.

Protégé can save files in Turtle format.  The way it saves the triples which
assert mutual disjointness between classes is in a syntax which Raptor objects
to.  See the reduction below.

Raptor is, I think, objecting to the '.' on line 9.

Looking at the Turtle grammar at <http://www.w3.org/TR/turtle/#sec-grammar>,
this file is indeed syntactically invalid: the [...] is not an instance of
'triples' in production [2].  Perhaps therefore the bug is Protégé's (and I'm
about to mail the relevant feedback list and point them to this bugreport).

However another possibility is that the error is in the grammar in the TR (and
so in Raptor?).  In section 2.1, we find the text: "A generated blank node may
also be made with [] which is useful to provide the subject of RDF triples for
each pair from the predicateObjectList or the root of the collection."  This is
a rather clumsily-written sentence, so that one reading of it suggests that
[...] is valid, and so seems to suggest that the syntax in the reduction below
(and thus the syntax emitted by Protégé) is acceptable.  If so, it would
appear that production [2] should be 'directive "." | triples "." |
blankNodePropertyList'.  In fact, I think this sentence is simply noting that
the sequence "[]" may denote a blank node, referring to production [94s].

I do have the impression that I've seen this construction (namely
blankNodePropertyList at the top level) somewhere, but can't now put my finger
on it.  It may be a bit of Turtle 'folk grammar'.  More likely, it's a bit of
Notation 3 (see <http://www.w3.org/TeamSubmission/n3/#bnodes>, under "Square
bracket blank node syntax") which has been carried over into Protégé.

So: I think on balance that this is Protégé's error, but I'm reporting it here
because (a) it looks as if, despite protestations, Raptor can actually parse it
(so the error might be accidental); (b) if this is a Turtle grammar problem,
librdf.org will have more standing to report it than I will; and (c) Protégé
doesn't have a public bugparade!

Steps to Reproduce: 
% cat /tmp/try.ttl
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foo: <urn:example#>.

[ rdf:type owl:AllDisjointClasses ;
  owl:members ( foo:Class1
                foo:Class2
              )
] .
% rapper -iturtle -ordfxml-abbrev /tmp/try.ttl
rapper: Parsing URI file:///tmp/try.ttl with parser turtle
rapper: Serializing with serializer rdfxml-abbrev
rapper: Error - URI file:///tmp/try.ttl:9 - syntax error
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
   xmlns:foo="urn:example#"
   xmlns:owl="http://www.w3.org/2002/07/owl#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <owl:AllDisjointClasses>
    <owl:members>
      <rdf:Description>
        <rdf:first rdf:resource="urn:example#Class1"/>
        <rdf:rest>
          <rdf:Description>
            <rdf:first rdf:resource="urn:example#Class2"/>
            <rdf:rest
rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
          </rdf:Description>
        </rdf:rest>
      </rdf:Description>
    </owl:members>
  </owl:AllDisjointClasses>
</rdf:RDF>
rapper: Parsing returned 6 triples
% rapper --version
2.0.7

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-10 21:12 normang        New Issue                                    
======================================================================



More information about the redland-dev mailing list