Re: Questions regarding test case: agg-groupconcat-01 (GROUP_CONCAT 1)

Hi Peter,

Blank nodes in SPARQL query patterns act as unnamed variables, and can 
match any RDF term in the target RDF dataset. (This behavior is 
unchanged from SPARQL 1.0.)

The relevant parts of the specification are:

http://www.w3.org/TR/sparql11-query/#QSynBlankNodes

"""
Blank nodes <http://www.w3.org/TR/rdf-concepts/#section-blank-nodes> in 
graph patterns act as variables, not as references to specific blank 
nodes in the data being queried.
"""

http://www.w3.org/TR/sparql11-query/#BGPsparql

"""
A basic graph pattern is matched against the active graph for that part 
of the query. Basic graph patterns can be instantiated by replacing both 
variables and blank nodes by terms, giving two notions of instance. 
Blank nodes are replaced using an RDF instance mapping 
<http://www.w3.org/TR/rdf-mt#definst>,  ?, from blank nodes to RDF 
terms; variables are replaced by a solution mapping from query variables 
to RDF terms.
"""

We'd appreciate it if you could let us know if this addresses your question.

many thanks,
Lee
On behalf of the SPARQL Working Group

On 6/19/2012 11:55 AM, Peter Waher wrote:
>
> Hello
>
> I have some questions regarding the use of [] is queries in the test 
> cases. To me, the following test case (aggregates/agg-groupconcat-01, 
> GROUP_CONCAT 1) is not correctly defined. Have I misunderstood 
> something, or is this a known error, or does the short form [] match 
> anything, and not only blank nodes?
>
> *Manifest:*(Notice it has been approved)
>
> :agg-groupconcat-01 rdf:type mf:QueryEvaluationTest ;
>
>     mf:name "GROUP_CONCAT 1" ;
>
> mf:feature sparql:group_concat ;
>
> dawgt:approval dawgt:Approved;
>
> dawgt:approvedBy 
> <http://www.w3.org/2009/sparql/meeting/2010-09-07#resolution_2> ;
>
>     mf:action
>
>          [ qt:query  <agg-groupconcat-1.rq> ;
>
> qt:data   <agg-groupconcat-1.ttl> ] ;
>
>     mf:result <agg-groupconcat-1.srx>
>
> *Data:*
>
> @prefix : <http://www.example.org/> .
>
> :s :p1 "1", "22" .
>
> :s :p2 "aaa", "bb", "c" .
>
> *Query:*
>
> PREFIX : <http://www.example.org/>
>
> ASK {
>
> {SELECT (GROUP_CONCAT(?o) AS ?g) WHERE {
>
> [] :p1 ?o
>
>             }}
>
> FILTER(?g = "1 22" || ?g = "22 1")
>
> }
>
> To my eyes (and in our implementation) this returns *false*. But the 
> test case states it should evaluate to *true*:
>
> <?xmlversion="1.0"?>
>
> <sparqlxmlns="http://www.w3.org/2005/sparql-results#">
>
> <head/>
>
> <boolean>true</boolean>
>
> </sparql>
>
> To me, this pattern in the query shouldn't match any pattern at all in 
> the data (:s is not a blank node, but an iri):
>
> [] :p1 ?o
>
> However, if I change this pattern in the query to
>
> ?x :p1 ?o
>
> then the query evaluates to true in my implementation.
>
> According to the specification, [] should match a blank node (not just 
> anything):
>
> http://www.w3.org/TR/sparql11-query/#QSynBlankNodes
>
> So, which is correct?
>
> ˇShould [] in  a query be able to match any type of term?
>
> oIs this described in the specification, or does the specification 
> need to be updated?
>
> oHow does this relate to compatibility with SPARQL 1.0 queries?
>
> ˇShould the query in the test case be updated?
>
> ˇHave I misunderstood something else?
>
> Thanks in advance,
>
> Peter Waher
>

Received on Tuesday, 19 June 2012 17:09:56 UTC