Comments on SPARQL WD


Here are some comments on current SPARQL WD.

Best regards,


2.3.2 Matching Numeric Types

SELECT ?v WHERE { ?v ?p 42 }

should be:


2.3.3 Matching Arbitrary Datatypes

The following query has a solution with variable v bound to :y.

should be: bound to :z.

SELECT ?v WHERE { ?v ?p
"abc"^^<> }

should be :


2.5 Building RDF Graphs

The SELECT query form returns tabular information.

Could be:

The SELECT query form returns variable bindings.

[[Because we may exploit the results through an API and hence there may be
no tabular form]].

3.3 Other Term Constraints

xsd:strings, xsd:booleans and xsd:dateTimes

[[It look strange to add an 's' to the xsd datatype names]]

4.1.1 Syntax for IRIs

behavoir -> behavior

prefixedname -> prefixed name

4.2.3 RDF Collections

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

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 filter
fail? ]]

7 Matching Alternatives

The UNION pattern combines graph patterns; each alternative possibility
can contain more one triple pattern:

-> more than one triple pattern:


Using ORDER BY on a solution sequence for a CONSTRUCT or DESCRIBE query
has no direct effect because only SELECT returns a sequence of results.

This is in contradiction with :

10.2.3 Solution Modifiers and CONSTRUCT
The solution modifiers of a query affect the results of a CONSTRUCT query.
In this example, the output graph from the CONSTRUCT template is formed
from just two of the solutions from graph pattern matching. The query
outputs a graph with the names of the people with the top two sites, rated
by hits.


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

11.3 Operator Mapping

xs:integer, xs:decimal, xs:float, xs:double

should be :

xsd:integer, xsd:decimal, xsd:float, xsd:double

operator =

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 but
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 != < <= > >=

SPARQL Tests, defined in section 11.4

[[regex could operate on xsd:string as well as simple literal.]]

11.4.7 datatype

if the the parameter -> if the parameter

11.4.10 RDFterm-equal

    * term1 and term2 are equivalent IRIs as defined in 6.4 RDF URI
    * term1 and term2 are equivalent literals as defined in 6.5.1 Literal
    * term1 and term2 are the same blank node as described in 6.6 Blank

[[There are no such 6.4, 6.5.1 and 6.6 sections in the current document,
so the wording looks strange (in particular when you print the document)]]

[[I think that the 2nd example of RDFterm-equal on dateTime is not
appropriate here because in this case, the = operator on dateTime applies
and hence not RDFterm-equal()]]

12.1.5 Basic Graph Patterns

A Basic Graph Pattern is a set of Triple Patterns.

[[SPARQL parsers are required to remove duplicate triples?]]

12.2.1 Converting Graph Patterns

If the element consists of multiple GroupGraphPatterns then connected with
'UNION' terminals, then replace with a sequence of nested union operators:


 GroupGraphPatterns connected with 'UNION' terminals [[remove then]]

12.2.2 Examples of Mapped Graph Patterns

Example: group consisting of a basic graph pattern, a filter and an
optional graph pattern:

{ ?s :p1 ?v1} FILTER (?v1 < 3 ) OPTIONAL {?s :p3 ?v3} }
Filter( ?v1 < 3 ,
  LeftJoin( BGP(?s :p1 ?v1), BGP(?s :p2 ?v2), true) ,

should be [[replacing 2 by 3]]:

{ ?s :p1 ?v1} FILTER (?v1 < 3 ) OPTIONAL {?s :p3 ?v3} }
Filter( ?v1 < 3 ,
  LeftJoin( BGP(?s :p1 ?v1), BGP(?s :p3 ?v3), true) ,

12.2.3 Converting Solution Modifiers

M := OrderBy(M, list of of order comparators)


list of  order

12.3.2 Treatment of Blank Nodes

Since SPARQL treats blank node IDs in the answer document as scoped to the
document ...

[[There may be no answer document when the result is accessed through an
API, so this reference to answer document looks strange.]]

12.4 SPARQL Algebra

Definition: Filter

has a effective boolean -> has an effective boolean

Definition: Diff

{ &#956; | &#956; in &#937;1 such that for all &#956;&#8242; in &#937;2,
&#956; and &#956;&#8242; are not compatible }
{ &#956; | &#956; in &#937;1 such that for all &#956;&#8242; in &#937;2,
&#956; and &#956;' are compatible and expr(merge(&#956;, &#956;')) is
false }

I think the second member of union should be :

{ &#956; | &#956; in &#937;1 such that for all &#956;&#8242; in &#937;2,
&#956; and &#956;' are compatible => expr(merge(&#956;, &#956;')) is

in addition it could be said that: expr(..) is false or returns an error

Definition: LeftJoin

    { merge(&#956;1, &#956;2) | &#956;1 in &#937;1 and &#956;2 in &#937;2,
and &#956;1 and &#956;2 are compatible and expr(merge(&#956;1,
&#956;2)) is true }
    { &#956;1 | &#956;1 in &#937;1 and &#956;2 in &#937;2, and &#956;1 and
&#956;2 are not compatible }
    { &#956;1 | &#956;1 in &#937;1 and &#956;2 in &#937;2, and &#956;1 and
&#956;2 are compatible and expr(merge(&#956;1, &#956;2)) is false }

I think member 2 and 3 of union should be :

    { ... }
    { &#956;1 | &#956;1 in &#937;1 such that for all &#956;2 in &#937;2, 
&#956;1 and &#956;2 are not compatible }
    { &#956;1 | &#956;1 in &#937;1 such that for all &#956;2 in &#937;2, 
&#956;1 and &#956;2 are compatible => expr(merge(&#956;1, &#956;2)) is
false or returns an error}


12.5 Evaluation Semantics

Definition: Evaluation of Join(P1, P2, F)

eval(D(G), Join(P1, P2)) = Join(eval(D(G), P1), eval(D(G), P2))
eval(D(G), Join(P1, P2), F) = Filter(F, Join( eval(D(G), P1), eval(D(G),
P2) ) )

I think there should be one rule for Join(P1, P2) without F, and one rule
for Filter(F, P)

Definition: Evaluation of LeftJoin(P1, P2)

should be:

Definition: Evaluation of LeftJoin(P1, P2, F)

Definition: Evaluation of a Graph Patten

eval(D(G), Graph(IRI,P)) = eval(D(D[i]), P)

should be [[replacing i by IRI]]:

eval(D(G), Graph(IRI,P)) = eval(D(D[IRI]), P)

12.6 Extending SPARQL Basic Graph Matching

mappijng  ->  mapping

Received on Wednesday, 28 March 2007 14:51:55 UTC