W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > April to June 2011

service tests 4, 7

From: Gregory Williams <greg@evilfunhouse.com>
Date: Tue, 28 Jun 2011 11:07:49 -0400
Message-Id: <ED1BF442-E587-4A1A-8EC1-9EA978BE98D5@evilfunhouse.com>
To: SPARQL Working Group <public-rdf-dawg@w3.org>
As I mentioned on the call today, I think service tests 4 and 7 are wrong.

Test 4 is:

PREFIX : <http://example.org/> 
PREFIX foaf: <http://xmlns.com/foaf/0.1/> 
SELECT ?s ?o1 ?o2
 ?s ?p1 ?o1 
 OPTIONAL { SERVICE <http://example.org/sparql> {?s foaf:knows ?o2 }}
} BINDINGS ?o2 {

I think the issue is a misunderstanding of how BINDINGS is used. My understanding of the query is that the results *before* the BINDINGS data is joined contain some rows where ?o2 is unbound (failed to match in the OPTIONAL). When joining these results with the BINDINGS data, rows with ?o2 bound to :b will successfully join, rows bound to other values will disappear, and rows with ?o2 unbound will turn into rows with ?o2 bound to :b (being compatible because ?o2 is only bound in the BINDINGS side of the join). However, the srx file for the test seems to only include results for the first case (where ?o2 was already bound to :b). I think the actual results should be:

?s	?o1						?o2
:a	"Alan"					:b
:a	"alan@example.org"		:b
:c	"Alice"					:b
:c	"alice@example.org"		:b

Test 7 is:

PREFIX : <http://example.org/> 

SELECT ?s ?o1 ?o2
 ?s ?p ?o1 .
 SERVICE SILENT <http://invalid.endpoint.org/sparql> {
   ?s ?p2 ?o2 }

The service endpoint obviously doesn't have any data in it and the call will fail. But my understanding of the use of SILENT is that the entire SERVICE pattern will result in the join identity (one result with no bindings). The local default graph is set up with the data in data07.ttl which has two triples. The srx file suggests the expected results are empty, but since we have two local triples that will match the first pattern, and the service pattern is the join identity, I think the actual results should be:

?s	?o1		?o2
:a	"Alan"
:b	"Bob"

Can anybody confirm or deny my understanding of these tests?

Received on Tuesday, 28 June 2011 15:08:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:01:04 UTC