Re: 2 RDFa SPARQL Test Harness Issues

On Sat, May 17, 2008 at 7:53 PM, Manu Sporny <msporny@digitalbazaar.com> wrote:

<snip>

> ... but SPARQL.org, surprisingly says that there is a solution to the query.
>
> ----------------------------------------------------------------------
> ASK WHERE {
> _:a
>   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>      <http://xmlns.com/foaf/0.1/Person> .
> }
> ----------------------------------------------------------------------
>
> This leads me to believe that the SPARQL above doesn't do what we think
> it does, but I haven't been able to find any documentation detailing how
> bnode identification happens in SPARQL queries.

_:a is equivalent to an existential variable - "there exists a node
_a, such that ..."

> The question that we're attempting to ask above is "is there a bnode
> that has an rdf:type of foaf:Person?", not "is there any node that has
> an rdf:type of foaf:Person?".

For that you want.
 ASK WHERE {
 ?a
   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
      <http://xmlns.com/foaf/0.1/Person> .
FILTER ISBLANK(?a)
}

I noticed this because I converted the sparql ASK WHERE to N-Triples
(via Turtle) and then did an rdf graph compare for runnign the rdfa
tests in raptor; there is no sparql interpretation involved.  I prefer
to have "less moving parts" in the testing, just an rdf parser and
graph compare.

Of course using Turtle for the results would not have this problem :)
(it supports UTF-8 like sparql, unlike N-Triples)

Dave

Received on Saturday, 17 May 2008 20:23:11 UTC