W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > November 2004

Re: Comments on SPARQL (based on an SPARQL Engine implementation in Python)

From: Ivan Herman <ivan@w3.org>
Date: Mon, 08 Nov 2004 09:59:39 +0100
Message-ID: <418F357B.3030403@w3.org>
To: "Seaborne, Andy" <andy.seaborne@hp.com>
Cc: public-rdf-dawg-comments@w3.org


Seaborne, Andy wrote:
> 
> 
> Ivan Herman wrote:
> 
>> Andy,
>>
>> thanks for the reply. Some (small) answer/remarks below
>>
>> Seaborne, Andy wrote:
>>
> 
> 
> <snip/> 
>>
>>>
>>>> ---------------
>>>>
>>>> Nested Patterns. It is not clear in the draft how 'deep' nesting can
>>>> go. I did only the simple one, ie, only a one level depth is managed:
>>>>
>>>> (?a,?b,c), {(?q,?w?,?r),(?s,t,?u)}
>>>>
>>>> It is not clear whether a nesting of the kind:
>>>>
>>>> (?a,?b,c), {(?q,?w?,?r),{(?s,t,?u),(?q,k,?o)}}
>>>>
>>>> is also allowed or not. Actually, if it is, it has to be defined what
>>>> it really *means*.
>>>
>>>
>>>
>>>
>>> In that example, it is all conjunction and the same as:
>>>
>>> (?a,?b,c) (?q,?w?,?r) (?s,t,?u) (?q,k,?o)
>>>
>>>
>>
>>
>> Then I am lost.:-( My understanding was that (just referring to Ti-s 
>> for triples):
>>
>> [T1 {T2 T3}] means [T1 T2] OR [T1 T2]
>>
> 
> Clarification first - [] is optional matching.
> 

My apologies. I wrote these comments on the plane, and I did not have the right document 
with me so I did not use the right syntax. What I wanted to have there is

WHERE T1
       ( T2 T3 )

and I used '{' because I remembered you had a remark in the document that '{' might be 
likeley to be used in future. Sorry about the confusion.


>> so why would
>>
>> [T1 {T2 {T3 T4}}] mean [T1 T2 T3 T4] as you write? What is then the 
>> difference between
>>
>> [T1 {T2 {T3 T4}}] and [T1 {T2 T3 T4}] or indeed [T1 T2 T3 T4]?
> 
> 
> Nothing because the {} is just a set of triple patterns and juxaposition 
> is conjunction so T1 {T2 {T3 T4}} is  "T1 AND (T2 AND (T3 AND T4))" 
> which is the same as the other forms.
> 

O.k., I understand now that this is how you define the nested pattern in the document, but 
then I am not sure I understand its real usefuleness. My *preference* would be to define 
nested patterns as:

WHERE T1
       ( T2 T3 )

would mean

WHERE T1 and (T2 or T3)

etc... Of course, if this is the interpretation of nested patterns then my original 
question (what is the exact rule for a second order nested pattern) applies, but it is 
irrelevant indeed if we consider the working group's interpretation. I let the WG decide 
on this...

>>>
> 
> 
> Not quite : [] is the optional block itself not merely statement grouping.
> 
> OPTIONAL { T1 T2 } is the same as [ T1 T2 ]
> 
>>
>> but is the difference between that and
>>
>> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
>> SELECT ?name ?mbox ?hpage
>> WHERE  ( ?x c  ?name )
>> OPTIONAL  { ( ?x foaf:mbox ?mbox ) ( ?x foaf:homepage ?hpage ) }
> 
> 
> Consider the dataset:
> 
> _:a   foaf:name   "Sally" .
> _:a    foaf:mbox   <mailto:ceo@example.org> .
> 
> then
> 
> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> SELECT ?name ?mbox ?hpage
> WHERE  ( ?x foaf:name  ?name )
>        [ ( ?x foaf:mbox ?mbox ) ]
>        [ ( ?x foaf:homepage ?hpage ) ]
> 
> has a solution:
> 
> ?name = "Sally"  ?mbox=<mailto:ceo@example.org>  ?hpage unset
> 
> whereas:
> 
> OPTIONAL  { ( ?x foaf:mbox ?mbox ) ( ?x foaf:homepage ?hpage ) }
> 
> requires both triples to match in order to match so the solution is:
> 
> ?name = "Sally"  ?mbox unset   ?hpage unset
> 
> It would not have a solution with just ?mbox bound because to match
> { T1 T2 } both T1 and T2 must match.
> 
> I hope that is a bit clearer.
> 

Yes, it is. I was influenced by *my* interpretation of the nested patterns that is not the 
same as the Working Group's. In the case of the current definition of nested patterns 
there is indeed a difference.



> <snip/>
> 
>     Andy
> 

Sorry to be so stubborn...

Ivan



-- 

Ivan Herman
W3C Communications Team, Head of Offices
C/o W3C Benelux Office at CWI, Kruislaan 413
1098SJ Amsterdam, The Netherlands
tel: +31-20-5924163; mobile: +31-641044153;
URL: http://www.w3.org/People/all?pictures=yes#ivan

Received on Monday, 8 November 2004 09:01:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:47 GMT