W3C home > Mailing lists > Public > public-rdf-wg@w3.org > July 2012

Re: in...of syntax Re: Turtle Last Call: Request for Review

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Mon, 30 Jul 2012 11:29:49 +0100
Message-ID: <5016621D.1010609@epimorphics.com>
To: public-rdf-wg@w3.org

I curious about this proposal and was hoping to see a full design.

How does this work with object lists "," (easy?) and propertyObject 
lists ";" (trickier?).


In SPARQL it's a path connecting two graph nodes with matching reversed. 
  For syntax, the positional slots are used by object lists and 
property-object lists.

Example:

:x ^:p :z1, :z2 ;
    :q :z3 ;
    ^:r :z4 .

is the same as:

:x ^:p :z1 .
:x ^:p :z2 .
:x  :q :z3 .
:x  ^:r :z4 .

and equivalent in matching to:

:z1 :p :x .
:z2 :p :x .
:x  :q :z3 .
:z4 :r :x .

this can be explained purely in parsing terms (but isn't in the SPARQL 
spec - it's done in matching).

# "," use the items in object position before doing ^
:z1 :p :x .
:z2 :p :x .
# Reuse the subject position, not the subject of the previous triple.
:x  :q :z3 .
# Reuse the subject position, flip triple afterwards.
:z4 :r :x .

and not

# This would be reusing the previous triple(s) subjects with ";".
:z1 :p :x .
:z2 :p :x .
:z1 :q :z3 .
:z2 :q :z3 .
:z1 :r :z4 .
:z2 :r :z4 .
# because ":z1, :z2" is the previous triples "subject".


SPARQL does have an extra step in the translation of syntax to algebra 
that maximises the size of basic graph patterns to maximise the scope of 
entailment: a simple "^:prop" is reversed before gathering triple 
patterns into BGP.  But it only applies to simple forms and isn't done 
in parsing.

So while ^:p can be the same as SPARQL it isn't quite for the same 
reason.  This may make explaining it all tricky.

SPARQL also has

   :subj :a/:b :obj

which introduces variables (not blank nodes - entailment differences).

   :subj :a ?V .
   ?V    :b :obj .

	Andy

On 30/07/12 10:05, Ivan Herman wrote:
> (Sorry for the late reaction, I was on vacations...)
>
>
> The ^P formalism and syntax is already part of the SPARQL 1.1 query language, part of the property path features. Ie, if adopted in Turtle, it would not create any compatibility problems with SPARQL 1.1 (which would not be the case with the 'is ... of' syntax).
>
> RDFa has the @rev attribute that is used for the same purpose. In my own practice @rev is not used very often; however, when it is, it is damn useful, that is for sure...
>
> _Personally_, I would be in favour adding ^P to Turtle.
>
> Caveat: if we do that, Turtle would have to go through a second last call. Sigh...
>
> Ivan
>
>
> On Jul 18, 2012, at 15:02 , Souripriya Das wrote:
>
>> I too would prefer the use of ^P (to indicate opposite direction of edge) than use of "is P of" for the same reasons that Dan cited.
>>
>> Thanks,
>> - Souri.
>>
>> ----- Original Message -----
>> From: steve.harris@garlik.com
>> To: danbri@danbri.org
>> Cc: public-rdf-comments@w3.org
>> Sent: Wednesday, July 18, 2012 7:44:34 AM GMT -05:00 US/Canada Eastern
>> Subject: Re: in...of syntax Re: Turtle Last Call: Request for Review
>>
>> On 2012-07-18, at 12:27, Dan Brickley wrote:
>> …snip…
>>>> A massive +1. Having been burned by that in the past, it is indeed a very good argument for it.
>>>>
>>>> The argument about generating Turtle data from pre-existing hashes is also a very good one. I've written a few of these 'RDFizers' in the past, just recursively going through a hash and outputting a string that happens to be valid Turtle (see https://github.com/moustaki/bbc-serialiser for example, which is currently in use on a few BBC websites) - and having a way to write triples in both directions make that a *lot* easier...
>>>
>>> If (a) it could be done identically in SPARQL 1.1 and Turtle (b) it
>>> was done with punctuation (e.g. ^) rather than pseudo-English, i'd be
>>> supportive.
>>>
>>> (Is 'is isPrimaryTopicOf of' the same as 'primaryTopic'? The existence
>>> of isPrimaryTopicOf is a good reason for exploring such a design...)
>>>
>>> Every difference we create between SPARQL and Turtle diminishes the
>>> value and teachability of both…
>>
>> +1
>>
>> - Steve
>>
>> --
>> Steve Harris, CTO
>> Garlik, a part of Experian
>> +44 7854 417 874  http://www.garlik.com/
>> Registered in England and Wales 653331 VAT # 887 1335 93
>> Registered office: Landmark House, Experian Way, Nottingham, Notts, NG80 1ZZ
>>
>>
>>
>
>
> ----
> Ivan Herman, W3C Semantic Web Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> FOAF: http://www.ivan-herman.net/foaf.rdf
>
>
>
>
>
>
Received on Monday, 30 July 2012 10:30:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:49 GMT