Hi all,
I'm trying to build an API for our 7.x site that returns a list of what we call "terminal collections", or collections that don't have any subcollections, as these are the only collections we want our submission system to deposit into. I'm trying to implement this via SPARQL query along the lines of "get me the PID and label for all objects that have the collection cmodel, and exclude any that have collection cmodel children" but trying to turn this into a SPARQL query is turning out to be harder than I thought.
Here's what I have so far:
SELECT ?pid ?label
FROM <#ri>
WHERE {
?pid <fedora-model:hasModel> <info:fedora/islandora:collectionCModel> ;
<fedora-model:label> ?label ;
FILTER (<info:fedora/fedora-system:def/relations-external#isMemberOfCollection> != ?pid)
}
I have a feeling that the answer lies in using the FILTER operator correctly, as what I'm trying to do is filter things out from the original query, but I can confirm that the current filter above is doing absolutely nothing because it returns the same amount of results if I take it out completely.
What is the proper incantation, SPARQL wizards?
- Bryan