RE: RDF querying question

I tried this (sparql):

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select ?s
from <http://www.w3.org/1999/02/22-rdf-syntax-ns>
where {
    ?s ?p ?o. 
    OPTIONAL {?s rdfs:range ?x} 
    FILTER !bound(?x)
}

and got the same 9 results that I got with this (rdfql):

import "/std/ns.rql";
var ds = new datasource("inet?parsetype=rdf&url=" +
    server.urlencode("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));

select ?s using #ds 
where {?p ?s ?o} 
	and not {[rdfs:range] ?s ?x}


So, I'm reasonably confident that the sparql query and results are correct
(+/- any very recent syntax changes). 

-Geoff

> -----Original Message-----
> From: semantic-web-request@w3.org [mailto:semantic-web-request@w3.org] On
> Behalf Of Jan Algermissen
> Sent: Tuesday, June 21, 2005 6:39 PM
> To: semantic-web@w3.org
> Subject: Re: RDF querying question
> 
> 
> Thanks very much to both of you. Unfortunately, the queries don't do
> the expected.
> This might be due to redlands SPARQL implementation? Not sure.
> 
> Jan
> 
> 
> On Jun 21, 2005, at 11:15 PM, Richard Newman wrote:
> 
> > SELECT ?x WHERE {
> >   ?x ?p ?y .
> >   FILTER ( ?p != rdf:type ) .
> > }
> >
> > Should work, I think (with prefix if necessary).
> >
> > (I'm knee-deep in spec, so I haven't tested this.)
> >
> > -R
> >
> > On 21 Jun 2005, at 21:54, Jan Algermissen wrote:
> >
> >
> >>
> >> Hi,
> >>
> >> is it possible (in RDQL or  SPARQL) to query for all nodes that do
> >> not have
> >> a certain property at all?
> >>
> >> For example: "Retrieve all nodes that do not have an rdf:type"
> >>
> >> Thanks in advance.
> >>
> >> Jan
> >
> 
> ________________________________________________________________________
> ____________________
> Jan Algermissen, Consultant & Programmer
> http://jalgermissen.com
> Tugboat Consulting, 'Applying Web technology to enterprise IT'
> http://www.tugboat.de
> 
> 

Received on Tuesday, 21 June 2005 23:55:45 UTC