Differences between revisions 9 and 10
Revision 9 as of 2008-10-17 08:29:58
Size: 2499
Editor: jrg
Comment:
Revision 10 as of 2008-10-17 08:51:47
Size: 4861
Editor: abr
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:

== iTQL ==
Line 7: Line 9:
This has a graphical user interface, which it very helpful to users, but not programmatically useful. The interface is described here: This has a graphical user interface, which it very helpful to users, but not programmatically useful. The interface is described here: http://www.fedora-commons.org/confluence/display/FCR30/Resource+Index+Search
Line 9: Line 11:
http://www.fedora-commons.org/confluence/display/FCR30/Resource+Index+Search We have prepared a number of useful iTQL queries, that can serve as examples

Find all direct subclasses of doms:ContentModel_File in the Base collection
{{{
select $object
from <#ri>
where $object <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_File>
      and $object <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:DOMS_Base_Collection>
}}}

Find the ancestors of doms:ContentModel_AudioPreservationFile
{{{
select $object
from <#ri>
where walk(
 <info:fedora/doms:ContentModel_AudioPreservationFile> <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
 and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object )
}}}

Find all the any-level children of doms:ContentModel_DOMS
{{{
select $subject
from <#ri>
where walk(
 $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_DOMS>
 and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
 );
}}}

Same again, with different output
{{{
select $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
from <#ri>
where walk(
 $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_DOMS>
 and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
 );
}}}

Anylevel children of ContentModel DOMS in the base collection
{{{
select $subject
from <#ri>
where walk(
 $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_DOMS>
 and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
 )
 and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:DOMS_Base_Collection>
}}}

Any objects in the Root collection or subcollections
{{{
select $subject '<isPartOfCollection>' $object
from <#ri>
where walk(
 $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:Root_Collection>
 and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> $object )
}}}

Fedora Resource Index

The Fedora Resource Index service is described in http://www.fedora-commons.org/confluence/display/FCR30/Resource+Index

iTQL

The resource index is queried by iTQL. A guide to iTQL can be found on http://docs.mulgara.org/itqlcommands/select.html

This has a graphical user interface, which it very helpful to users, but not programmatically useful. The interface is described here: http://www.fedora-commons.org/confluence/display/FCR30/Resource+Index+Search

We have prepared a number of useful iTQL queries, that can serve as examples

Find all direct subclasses of doms:ContentModel_File in the Base collection

select $object
from <#ri>
where      $object <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_File>
      and  $object <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:DOMS_Base_Collection>

Find the ancestors of doms:ContentModel_AudioPreservationFile

select  $object
from <#ri>
where walk(
        <info:fedora/doms:ContentModel_AudioPreservationFile> <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object 
        and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object )

Find all the any-level children of doms:ContentModel_DOMS

select $subject
from <#ri>
where walk(
        $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_DOMS>
        and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
        );

Same again, with different output

select $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
from <#ri>
where walk(
        $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_DOMS>
        and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
        );

Anylevel children of ContentModel DOMS in the base collection

select $subject
from <#ri>
where walk(
        $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> <info:fedora/doms:ContentModel_DOMS>
        and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#extendsModel> $object
        )
        and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:DOMS_Base_Collection>

Any objects in the Root collection or subcollections

select   $subject '<isPartOfCollection>' $object 
from <#ri>
where walk(
        $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:Root_Collection>
        and $subject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> $object )

For programs, there are two interfaces.

Fedora 3.0 triple store API (last edited 2010-03-17 13:12:54 by localhost)