W3C home > Mailing lists > Public > public-sparql-dev@w3.org > January to March 2008

Re: Is there a SPARQL way to...

From: Richard Newman <rnewman@franz.com>
Date: Fri, 1 Feb 2008 10:33:01 -0800
Message-Id: <87C813A9-203D-4637-89F2-722F66F52715@franz.com>
Cc: public-sparql-dev@w3.org
To: Max Voelkel <voelkel@fzi.de>

>   is it possible to write  a SPARQL query that given this data


>   returns only all subjects which belong only to class A?
>   So in my example, only "ex:1" should  be returned.
>   Ah,  and  resources can have more than two classes.

I haven't run this, but this might do the trick...

   ?x a ex:A .
     ?x a ?bar .
   FILTER (!bound(?x) || sameTerm(?bar, ex:A))

> 2)  Is  there  any  kind  of collection on the web of common SPARQL  
> problems and
> queries that solve it? Maybe some wiki page?

Lee runs the SPARQL FAQ:

Received on Friday, 1 February 2008 18:33:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:15:49 UTC