W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2007

Re: Comments on SPARQL WD

From: Lee Feigenbaum <feigenbl@us.ibm.com>
Date: Thu, 29 Mar 2007 12:56:25 -0400
To: public-rdf-dawg@w3.org
Message-ID: <OF7DB0BC91.034EF89B-ON852572AD.00542C15-852572AD.005D0E49@us.ibm.com>

These are responses to the substantive parts of Olivier's comments. Andy 
or Eric, when you respond to the editorial matters, please include these 

(Andy, you might in particular want to take a look at the response to the 
RDFTerm-equal function. While I know the group has discussed this in the 
past, I can't find a specific URL to a discussion or decision that I could 
refer to.) 


Olivier Corby wrote on 03/28/2007 10:51:19 AM:

> Hi,
> Here are some comments on current SPARQL WD.


> 4.2.3 RDF Collections
> [[Suggestion : the (1 ?x 3 4) notation for rdf list could not generate 
> _:b rdf:rest rdf:nil triple; in such a way we could match lists that may
> have more elements.]]

The syntax of SPARQL triple patterns, and in particular of the syntactic 
sugar forms given in section 4.2 ( 
http://www.w3.org/TR/rdf-sparql-query/#QSynTriples ), is designed to be 
consistent with the syntax of Turtle ( 
http://www.dajobe.org/2004/01/turtle/ ). In Turtle, the (1 2 3) syntax 
specifies a closed collection (i.e. one terminated by an rdf:nil triple), 
and SPARQL adopts this meaning for this bit of syntax.

Of course, you can match a subset of a collection by explicitly including 
the component pieces of the collection explicitly:

    _:b0  rdf:first  1 ;
          rdf:rest   _:b1 .
    _:b1  rdf:first  ?x ;
          rdf:rest   _:b2 .
    _:b2  rdf:first  3 ;
          rdf:rest   _:b3 .
    _:b3  rdf:first  4 .

> 5.2.2 Scope of Filters
> A constraint, expressed by the keyword FILTER, is a restriction on
> solutions over the whole group in which the filter appears.
> [[What happens if a variable in the filter is not bound in the current
> group, but is bound in another group  after current group? Does the 
> fail? ]]

As per the text you've cited and the algebra given in Section 12, Filters 
are evaluated in terms of the solution mappings of the group in which the 
filter appears. If a variable in the filter is unbound in a solution 
mapping, then as per Section 11.2 any function or operator (except 
bound()) on the variable produces a type error. If this propagates to the 
top of the filter, then the solution is removed from the multiset of 
solution mappings.

> What is the solution of :
> select distinct ?y where {
>    ?x c:friend ?y
> }
> on this graph :
> ex:Jules c:friend ex:Jimmy
> ex:Jules c:friend ex:James
> ex:Jimmy owl:sameAs ex:James

SPARQL is defined for simple entailment, with no notion of the semantics 
of owl:sameAs. The result of this query is:


> [[
> I think there should be an = operator for plain literals because
> otherwise, RDFterm-equal applies, in which case :
> 11.4.10 RDFterm-equal
> RDFterm-equal produces a type error if the arguments are both literal 
> are not the same RDF term.
> So, following the current draft :
> 'Jules'@en = 'Jim'@en
> produces a type error because they are not the same RDF term.
> It is the same with != < <= > >=
> ]]

By design, SPARQL does not define semantics for comparing plain literals 
with language tags, as you've noted. Note that query writers can compare 
literals themselves:

  !langMatches(lang(?a), lang(?b)) || !(str(?a) = str(?b))

The Working Group has not been motivated in the past to define the 
comparison operators on plain literals with language tags. Section 11.3.1 
Operator Extensibility licenses SPARQL language extensions that add rows 
to the operator table, such that implementations may support comparing 
plain literals with language tags.

I hope that this addresses this concern; please let us know if not, and 
the Working Group will weigh changes to the operator table versus the 
schedule risks of publishing a new Last Call draft.
Received on Thursday, 29 March 2007 16:56:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:00:53 UTC