W3C home > Mailing lists > Public > public-rdf-comments@w3.org > October 2012

Re: Turtle unlabelled blank nodes

From: Richard Cyganiak <richard@cyganiak.de>
Date: Mon, 22 Oct 2012 11:21:34 +0100
Cc: public-rdf-comments@w3.org
Message-Id: <FD143F54-8D56-4ABD-9937-2D6649DC194E@cyganiak.de>
To: Peter Ansell <ansell.peter@gmail.com>
Hi Peter,

I believe (but hope that someone more familiar with the Turtle grammar and test cases can confirm) that this used to be illegal in Dave Beckett's old Turtle grammar and in the W3C team submission, but was added as an allowed construct in the latest working drafts because it is rather useful. I believe this also aligns with the SPARQL grammar. Old implementations and their test suites may not have been updated to reflect this.

Best,
Richard


On 22 Oct 2012, at 04:15, Peter Ansell wrote:

> Hi,
> 
> The Turtle W3C Working Draft (10 July 2012) supports unlabelled blank nodes [1]
> 
> The grammar for the Turtle format in this working draft contains the
> following rule [1]:
> 
>    [6] 	triples 	::= 	subject predicateObjectList |
> blankNodePropertyList predicateObjectList?
> 
> This rule seems to imply that a blank node property list, which is one
> way that unlabelled blank nodes are referenced in the grammar, can
> exist on their own without a following predicateObjectList.
> 
> However, the examples in the working draft only show the cases where
> blankNodePropertyList is followed by a predicateObjectList.
> 
> Are the statements in the following turtle document valid according to
> the 10 July 2012 draft?
> 
>    # Test non empty [] operator with no predicate or object following
> the blank node
>    @prefix : <http://example.org/base#> .
>    [ :P "007"^^<http://www.w3.org/2001/XMLSchema#string> ].
>    [ :P 8.1 ].
>    [ :P "not a number" ].
>    [ :P :Q ].
>    [ :P <http://example.org/base#T> ].
>    [ <http://example.org/base#P> 7 ].
>    [ <http://example.org/base#P> "7" ].
>    [ <http://example.org/base#P> "language literal"@fr ].
> 
> The reason that I am investigating this is that the OWLAPI Turtle
> writer, which is used by Protege, among other applications, uses this
> feature heavily to represent some types of OWL axioms. I found the
> incompatibility when these documents failed to load using the Sesame
> Rio Turtle parser.
> 
> The Turtle test suite in Sesame currently states that it contains
> tests from [3], which seems to have been replaced by the Raptor test
> suite located currently at Github. The test suite in the Raptor Github
> repository had a test for these structures added recently as a failing
> test with the comment "Add (currently) bad turtle forms of bnode
> subjects" [4]. This is confusing, as it is not clear when they will be
> valid, and if so, why they are failing tests currently. Any
> clarification would be appreciated.
> 
> Thanks,
> 
> Peter Ansell
> 
> [1] http://www.w3.org/TR/2012/WD-turtle-20120710/#unlabeled-bnodes
> [2] http://www.w3.org/TR/2012/WD-turtle-20120710/#grammar-production-triples
> [3] http://cvs.ilrt.org/cvsweb/redland/raptor/tests/turtle/
> [4] https://github.com/dajobe/raptor/commit/60f9398b4380c4e93cd70dda87fa57602b87a8f0
> 
Received on Monday, 22 October 2012 10:22:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 22 October 2012 10:22:06 GMT