Differences between revisions 11 and 12
Revision 11 as of 2008-10-17 09:02:48
Size: 5427
Editor: abr
Comment:
Revision 12 as of 2008-10-17 09:05:44
Size: 5509
Editor: abr
Comment:
Deletions are marked like this. Additions are marked like this.
Line 83: Line 83:
== Interacting with the Resource index ==
Line 104: Line 105:
 }}} which is unfortunately outdated.  }}} which is unfortunately outdated, but still not untrue.
Line 106: Line 107:
 The method returns an {{{org.trippi.TupleIterator}}} which parses the sparql result. The javadoc for this can be found on
 http://trippi.sourceforge.net/api/org/trippi/TupleIterator.html
The method returns an {{{org.trippi.TupleIterator}}} which parses the sparql result. The javadoc for this can be found on
http://trippi.sourceforge.net/api/org/trippi/TupleIterator.html, which is for 1.1.?
Line 109: Line 110:
 Note that the page is not updated either, the releases can be found in the svn, and has reached version 1.4. Fedora uses 1.3.2, which is unknown, but 1.3.1 can be checked out. Look at http://sourceforge.net/svn/?group_id=123675 to do this. Note that the page is not updated either. The releaseses can be found in the svn, and has reached version 1.4. Fedora uses 1.3.2, which is unknown, but 1.3.1 can be checked out. Look at http://sourceforge.net/svn/?group_id=123675 to do this.
Line 111: Line 112:
 The result consist of a list of maps. The iterator iterates through this list, returning maps. The iterator has a method, names, giving the keys to each map. The values in the maps are of type Node, see
 http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/Node.html
The result consist of a list of maps. The iterator iterates through this list, returning maps. The iterator has a method, names(), giving the keys to each map. The values in the maps are of type Node, see
http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/Node.html
Line 114: Line 115:
 In practice each node will always be a Literal node or a URI reference Node or a Blank node, see the following
 
http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/Literal.html,

http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/URIReference.html,

http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/BlankNode.html
In practice each node will always be a Literal node or a URI reference Node or a Blank node, see the following
 * http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/Literal.html,
 * http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/URIReference.html,
 * http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/BlankNode.html

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 )

All Templates of content models in the base collection

select $defbject
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 $defbject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isTemplateFor> $subject
        and $defbject <http://doms.statsbiblioteket.dk/relations/default/0/1/#isPartOfCollection> <info:fedora/doms:DOMS_Base_Collection>

Interacting with the Resource index

For programs, there are two interfaces.

The method returns an org.trippi.TupleIterator which parses the sparql result. The javadoc for this can be found on http://trippi.sourceforge.net/api/org/trippi/TupleIterator.html, which is for 1.1.?

Note that the page is not updated either. The releaseses can be found in the svn, and has reached version 1.4. Fedora uses 1.3.2, which is unknown, but 1.3.1 can be checked out. Look at http://sourceforge.net/svn/?group_id=123675 to do this.

The result consist of a list of maps. The iterator iterates through this list, returning maps. The iterator has a method, names(), giving the keys to each map. The values in the maps are of type Node, see http://jrdf.sourceforge.net/0.3.4/doc/javadoc/org/jrdf/graph/Node.html

In practice each node will always be a Literal node or a URI reference Node or a Blank node, see the following

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