Re: ISSUE-19: Should TURTLE allow triples like "[ :p 123 ]." as SPARQL does ?

On Fri, Apr 1, 2011 at 8:39 PM, Steve Harris <steve.harris@garlik.com>wrote:

> On 2011-04-01, at 16:45, Alex Hall wrote:
>
> On Fri, Apr 1, 2011 at 11:22 AM, Peter Frederick Patel-Schneider <
> pfps@research.bell-labs.com> wrote:
>
>> From: Andy Seaborne <andy.seaborne@epimorphics.com>
>> Subject: Re: ISSUE-19: Should TURTLE allow triples like "[ :p 123 ]." as
>> SPARQL does ?
>> Date: Fri, 1 Apr 2011 10:08:14 -0500
>>
>> > http://www.w3.org/TR/sparql11-query/#grammar
>> >
>> > [21] TriplesBlock ::=
>> >       TriplesSameSubject ( '.' TriplesBlock? )?
>> > [32] TriplesSameSubject ::=
>> >       VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList
>> > [34] PropertyList ::=
>> >       PropertyListNotEmpty?
>> > [38] TriplesNode ::=
>> >       Collection | BlankNodePropertyList
>> > [39] BlankNodePropertyList ::=
>> >       '[' PropertyListNotEmpty ']'
>> >
>> > A lot of this is to exclude "[] ."
>> >
>> > http://www.sparql.org/query-validator.html ==>
>> >
>> >
>> http://www.sparql.org/query-validator?query=PREFIX+%3A+%3Chttp%3A%2F%2Fexample%2F%3E%0D%0A%0D%0ASELECT+%3Fbook+%3Ftitle%0D%0AWHERE%0D%0A+++{+[+%3Ap+123+]+}%0D%0A&languageSyntax=SPARQL&outputFormat=sparql&linenumbers=true<http://www.sparql.org/query-validator?query=PREFIX+:+%3Chttp://example/%3ESELECT+?book+?titleWHERE+++%7B%2B%5B%2B%3Ap+123+%5D+%7D&languageSyntax=SPARQL&outputFormat=sparql&linenumbers=true>
>> >
>> >       Andy
>>
>>
>> Ah, now I see it.  Tricky.
>>
>> The extra complexity and lack of uniformity is a strong point against
>> this syntax.
>>
>> peter
>>
>
> I see your point here.  The name 'TriplesNode' implies a production that
> generates a [node, triples] tuple, so the triples always get added to the
> enclosing BGP and the node can be added to a surrounding triple context if
> present.  That is extra complexity, and doesn't allow you to write anything
> that you couldn't before.
>
> But it does allow you to write statements about a blank node without having
> to give that node a label, even if nothing else in the graph refers to that
> node.  A common example from OWL:
>
> [ a owl:AllDifferent; owl:distinctMembers (:a :b :c) ] .
>
>
> I do think that we should add this form, but not for this reason, what's
> wrong with
>
>    [] a owl:AllDifferent; owl:distinctMembers (:a :b :c) .
>
> In this case?
>

Fair enough, there's nothing wrong with this.  For some reason the first
example just looks more natural to me.  Possibly because surrounding the
statements in brackets gives a nice visual delimiter to the anonymous
resource being described; possibly because I'm accustomed to seeing square
brackets appearing in the object position of a triple and not the subject.
Even though I know your example is valid syntax, it just didn't occur to me
to write it that way.  But that's a personal preference and I wouldn't push
for its inclusion on those grounds alone.

-Alex

Received on Saturday, 2 April 2011 17:54:40 UTC