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

Re: finding gems by all of the same authors?

From: Olivier Corby <olivier.corby@inria.fr>
Date: Mon, 16 Jan 2012 14:39:14 +0100
Message-ID: <4F142882.5090903@inria.fr>
To: Rich Morin <rdm@cfcl.com>, public-sparql-dev@w3.org
Hi,

> What Gems were written by all of the same authors?
>
> That is, if this Gem was written by Alice and Bob, I want
> to find others that were also written only by these two.

You need to check that every author of foo is author of Gem and 
conversely that every author of Gem is author of foo.

Regards,

Olivier



SELECT DISTINCT ?gem
WHERE {
item:foo-1.2.3-x86  spec:author  ?author
?gem                spec:author  ?author

filter(?gem != item:foo-1.2.3-x86)

filter not exists {
   item:foo-1.2.3-x86  spec:author  ?author2
   filter not exists {?gem    spec:author  ?author2}
}

filter not exists {
   ?gem  spec:author  ?author2
   filter not exists {item:foo-1.2.3-x86  spec:author  ?author2}
}
}
Received on Monday, 16 January 2012 13:40:22 UTC

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