Child pages
  • Fedora Resource Index

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added date range example


No Format
select count(
  select  $object
  from    <#ri>
  where   $object
from <#ri>
where $a $b $c

Get objects with models and created dates that were created in a specified date range:

No Format
select $object $model $created from <#ri> 
where  $object <fedora-model:hasModel> $model 
and    $object <info:fedora/fedora-system:def/model#createdDate> $created
and    $created <mulgara:after> '2015-12-01T00:00:00.000Z'^^<xml-schema:dateTime> in <#xsd>
and    $created <mulgara:before> '2016-01-01T00:00:00.000Z'^^<xml-schema:dateTime> in <#xsd>

Get all collection objects:

No Format
select  $object
from    <#ri>
where   $object


Find all Service Deployments for a given content model (in this case, the cmodel:image content model):

No Format

select $object from <#ri>
where  $object <fedora-model:isContractorOf> <info:fedora/cmodel:image>

Find all deleted object:

No Format
select  $object
from    <#ri>
where   $object <fedora-model:state> <info:fedora/fedora-system:def/model#Deleted>

Find all collections that have an item exposed through OAI PMH: (NOTE: be sure to check "Force Distinct")

No Format
select $collectionPid
from   <#ri>
where  $item           <> $itemID
and    $item           <info:fedora/fedora-system:def/relations-external#isMemberOfCollection>

Find all image-derivative items in the slocum collection that aren't described by another object nor contain description themselves

No Format
select $image
from <#ri>
where $image <fedora-model:hasModel> <info:fedora/cmodel:image-derivatives>
and $image <info:fedora/fedora-system:def/relations-external#isMemberOfCollection>
minus $image
minus $image <fedora-model:hasModel> <info:fedora/cmodel:item-metadata>

Find all service definitions that aren't registered with a "hasService" relationship to another object.

No Format
select $object from <#ri>
where $object <fedora-model:hasModel> <info:fedora/fedora-system:ServiceDefinition-3.0>
minus $object2 <fedora-model:hasService> $object


Encoding queries as URLs

All RI queries must be URL-encoded (with a tool like this one) before being added to a behavior mechanism. To manually encode a query, make the following substitutions:


















%3E<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="cd5c87fa-c2d3-4aaa-a530-675cf1090795"><ac:plain-text-body><![CDATA[



Do not encode the parentheses around any parameters that you want Fedora to pass in. The encoded query should be placed after a suitable base URL like

No Format


No Format