Differences between revisions 7 and 8
Revision 7 as of 2008-09-30 11:12:41
Size: 6613
Editor: jrg
Comment:
Revision 8 as of 2008-09-30 11:20:44
Size: 8469
Editor: jrg
Comment:
Deletions are marked like this. Additions are marked like this.
Line 47: Line 47:
Creates a new Datastream in the object.
Line 68: Line 69:
Creates a new relationship in the object. Adds the specified relationship to the object's RELS-EXT Datastream. If the Resource Index is enabled, the relationship will be added to the Resource Index.
Line 81: Line 83:
Verifies that the Datastream content has not changed since the checksum was initially computed.
Line 92: Line 95:
Gets the specified datastream.
Line 103: Line 107:
Gets all versions of a datastream, sorted from most to least recent.
Line 110: Line 115:
 * {{{Datastream[]}}} All versions of a datastream, sorted from most to least recent.  * {{{Datastream[]}}} All versions of a datastream, sorted from most to least recent. (See definition of {{{Datastream}}} under Datastructures below)
Line 114: Line 119:

Input parameters:
 * {{{}}}

Returns:
 * {{{}}}
Get the relationships asserted in the object's RELS-EXT Datastream that match the given criteria.

Input parameters:
 * {{{String pid}}} The PID of the object.
 * {{{String relationship}}} The predicate to match. A null value matches all predicates.

Returns:
 * {{{RelationshipTuple[]}}} An array of RelationshipTuples, each containing the subject, predicate and object matching the search criteria.
Line 123: Line 130:

Input parameters:
 * {{{}}}

Returns:
 * {{{}}}
Creates a new digital object in the repository. The object's initial state will be A (active). If the XML document does not specify the OBJID attribute of the root element, the repository will generate and return a new pid for the object resulting from this request. That pid will have the namespace of the repository. If the XML document specifies a pid, it will be assigned to the digital object provided that 1. it conforms to the Fedora pid Syntax, 2. it uses a namespace that matches the "retainPIDs" value configured for the repository, and 3. it does not collide with an existing pid of an object in the repository.

Input parameters:
 * {{{byte[] objectXML}}} The digital object in an XML submission format.
 * {{{String format}}} The XML format of objectXML, e.g. "info:fedora/fedora-system:FOXML-1.1", "info:fedora/fedora-system:FOXML-1.0", "info:fedora/fedora-system:METSFedoraExt-1.1", or "info:fedora/fedora-system:ATOM-1.0".
 * {{{String logMessage}}} A log message.

Returns:
 * {{{String}}} The pid of the newly created object.

Fedora 3.0 API

DOMS metadata objects will be stored in Fedora-commons 3.0. Fedora 3.0 is currently in beta 2, but is expected to be final by the time we release DOMS.

The API is documented here: http://www.fedora-commons.org/documentation/3.0/userdocs/index.html#webservices

The following restrictions apply:

  • The possibilities "PurgeDatastream" and "PurgeObject" are not allowed. Instead change the state to deleted

  • setDatastreamVersionable is disallowed. The internal datastreams are always versioned.
  • Do not use getNextPID, instead use the method provided from DOMS

All ingested objects, and all updates, must lead to valid objects, as defined by the data model. The exception is that objects marked as "draft" or "intermediate" in the datamodel are always considered valid.

Making a call to any API method that changes the object to a state not valid as defined by the datamodel will fail. Any call to a state-changing API-call where the object is not first set to intermediate state will fail.

Examples

Saving seven new interrelated objects to DOMS

Since the datamodel may require that all seven objects are correctly ingested and interrelated before they are valid, ingest all seven objects in intermediate state, and then publish them

  • Call the method for generating DOMS PIDs seven times
  • Generate 7 FoxML objects, each with the administrative state set to "intermediate"
  • Call API-M ingest seven times

  • Call API-M modifyDatastreamByValue 7 times to update the state to "published"

Updating fields and references for 8 interrelated objects

To make sure that the changes don't interfere with validity, first set the state to intermediate, then update state to published after modifications.

  • Call API-M modifyDatastreamByValue 8 times to update the administrative state to "intermediate"

  • Update datastreams and relations as needed to make the changes using addRelationsship/addDatastream/purgeRelationship/modifyDatastreamByValue/setDatastreamState

  • Call API-M modifyDatastreamByValue 8 times to update the administrative state to "published"

Usage of Fedora API-M and API-A

The following describes those methods of the Fedora API-M and API-A that may be called by the GUI.

Descriptions in the following were copied from the Fedora documentation at http://www.fedora-commons.org/confluence/display/FCR30/API-M.

API-M

addDatastream

Creates a new Datastream in the object.

Input parameters:

  • String pid The PID of the object.

  • String dsID The datastream ID (64 characters max). If null, Fedora will generate the value.

  • String[] altIDs Alternate identifiers for the datastream.

  • String dsLabel The label for the datastream.

  • boolean versionable Enable versioning of the datastream.

  • String MIMEType The mime-type of the datastream.

  • String formatURI The format URI of the datastream.

  • String dsLocation Location of managed or external datastream content.

  • String controlGroup One of "X", "M", "R", or "E" (Inline XML, Managed Content, Redirect, or External Referenced).

  • String dsState One of "A", "D", or "I" (Active, Deleted, or Inactive).

  • String checksumType The algorithm used to compute the checksum. One of "DEFAULT", "DISABLED", "MD5", "SHA-1", "SHA-256", "SHA-385", "SHA-512", "HAVAL", "TIGER", "WHIRLPOOL".

  • String checksum The value of the checksum represented as a hexadecimal string.

  • String logMessage A log message.

Returns:

  • String The datastreamID of the newly added datastream.

addRelationship

Creates a new relationship in the object. Adds the specified relationship to the object's RELS-EXT Datastream. If the Resource Index is enabled, the relationship will be added to the Resource Index.

Input parameters:

  • String pid The PID of the object.

  • String relationship The predicate.

  • String object The object.

  • boolean isLiteral A boolean value indicating whether the object is a literal.

  • String datatype The datatype of the literal. Optional.

Returns:

  • boolean True if and only if the relationship was added.

compareDatastreamChecksum

Verifies that the Datastream content has not changed since the checksum was initially computed.

Input parameters:

  • String pid The PID of the object.

  • String dsID The datastream ID.

  • String versionDate A dateTime indicating the version of the datastream to verify. If null, Fedora will use the most recent version.

Returns:

  • String The checksum if there is no difference, a message indicating checksum failure otherwise.

getDatastream

Gets the specified datastream.

Input parameters:

  • String pid The pid of the object.

  • String dsID The datastream ID.

  • String asOfDateTime The date/time stamp specifying the desired view of the object. If null, the current view of the object (the most recent time) is assumed.

Returns:

  • Datastream The specified datastream. (See definition of Datastream under Datastructures below)

getDatastreams

Gets all versions of a datastream, sorted from most to least recent.

Input parameters:

  • String pid The pid of the object.

  • String asOfDateTime The date/time stamp specifying the desired view of the object. If null, the current view of the object (the most recent time) is assumed.

  • String dsState One of "A", "D", or "I" (Active, Deleted, or Inactive).

Returns:

  • Datastream[] All versions of a datastream, sorted from most to least recent. (See definition of Datastream under Datastructures below)

getRelationships

Get the relationships asserted in the object's RELS-EXT Datastream that match the given criteria.

Input parameters:

  • String pid The PID of the object.

  • String relationship The predicate to match. A null value matches all predicates.

Returns:

  • RelationshipTuple[] An array of RelationshipTuples, each containing the subject, predicate and object matching the search criteria.

ingest

Creates a new digital object in the repository. The object's initial state will be A (active). If the XML document does not specify the OBJID attribute of the root element, the repository will generate and return a new pid for the object resulting from this request. That pid will have the namespace of the repository. If the XML document specifies a pid, it will be assigned to the digital object provided that 1. it conforms to the Fedora pid Syntax, 2. it uses a namespace that matches the "retainPIDs" value configured for the repository, and 3. it does not collide with an existing pid of an object in the repository.

Input parameters:

  • byte[] objectXML The digital object in an XML submission format.

  • String format The XML format of objectXML, e.g. "info:fedora/fedora-system:FOXML-1.1", "info:fedora/fedora-system:FOXML-1.0", "info:fedora/fedora-system:METSFedoraExt-1.1", or "info:fedora/fedora-system:ATOM-1.0".

  • String logMessage A log message.

Returns:

  • String The pid of the newly created object.

modifyDatastreamByReference

Input parameters:

Returns:

modifyDatastreamByValue

Input parameters:

Returns:

modifyObject

Input parameters:

Returns:

purgeRelationship

Input parameters:

Returns:

setDatastreamState

Input parameters:

Returns:

(export)

(getDatastreamHistory)?

(getObjectXML)?

API-A

Datastructures

Datastream

Contains the following private fields. Each has corresponding getter and setter methods.

  • DatastreamControlGroup controlGroup

  • String ID

  • String versionID

  • String[] altIDs

  • String label

  • boolean versionable

  • String MIMEType

  • String formatURI

  • String createDate

  • long size

  • String state

  • String location

  • String checksumType

  • String checksum

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