W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2006

Re: Blank node identifiers in FILTER clauses (ooooops 3)

From: Enrico Franconi <franconi@inf.unibz.it>
Date: Mon, 17 Jul 2006 23:11:40 +0200
Message-Id: <4AC1F6C4-73B4-4798-AFDF-EB0EC5D1EB56@inf.unibz.it>
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>

On 17 Jul 2006, at 22:59, Enrico Franconi wrote:

>>> SELECT ?X
>>> WHERE { ?X rdf:type Worker .
>>>         ?X :hasFriend ?Y .
>>>         ?Y rdf:type Employee .
>>>         ?Y :hasFriend ?Z .
>>>         ?Z rdf:type Manager } # note ?vars
>
> My above answer makes sense only if all the variables in the query  
> are distinguished (SELECT *). However, in your example only ?X is a  
> disinguished variable (SELECT ?X), and therefore YES, the correct  
> answer should be, and is, {?X/Paul}, since the non-distinguished  
> variables ?Y and ?Z are interpreted existentially.

Given my later statement:

On 17 Jul 2006, at 23:07, Enrico Franconi wrote:
> Also note that in SPARQL the variables in a basic graph pattern are  
> all distinguished; the role of non-distinguished variables is  
> played by the bnodes.

the only way to write in SPARQL the above query when you intend ?X to  
be the only distinguished variable is:

SELECT ?X
WHERE { ?X rdf:type Worker .
         ?X :hasFriend _:Y .
         _:Y rdf:type Employee .
         _:Y :hasFriend _:Z .
         _:Z rdf:type Manager }

cheers
--e.
Received on Monday, 17 July 2006 21:11:52 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:26 GMT