Wednesday, April 11, 2007

SeRQL Query for all Resources w/o Some Relationship

After a few tries I managed to form a SeRQL query that would give me resources of a given type that did not have a given relationship:

select distinct
localName(A)
from
{A} rdf:type {foo:AClass}
where not exists (
select A
from
{A} foo:hasBar {B}
)
using namespace ...

Still, it seems this could be more simply expressed, what I was initially expecting was something more concise such as:


select distinct
localName(A)
from
{A} rdf:type {foo:AClass},
![{A} foo:hasBar {B}]
using namespace ...

No comments: