Alternative REST APIAaron Birkland pointed out a severe, and unrecoverably problem with this proposal. For a versionable datastream, a new version is created for each property or content change. As such, to not make 10 versions with a datastream update, a proper transaction system, or methods that allow you to change all the properties in one invocation is nessesary. For that reason, a modifyDatastream method like in the current API is still required. In this I will propose an alternative REST api to the one in the Fedora Documentation. It is made to support CRUD (Create, Retrieve, Update, Delete) workflows more natively than the current Fedora APIs. It is based around the idea that every conceivable url should be gettable, and probably puttable. There should not be big methods with lots of parameters, but rather a bunch of small resources with very clear purpose. For CRUD purposes, foxml is not the format of Fedora. Foxml is a very useful and welldesigned storage format, but it is intricate. There will be no ingest or exportToXML methods in this api, as the user should not have to understand foxml. Rather, the Fedora objects is decomposed into resources, available through through URLs. General principles
Create methodsObject resourcesCreate new object with given pidPUT /objects/{pid} Return: Nothing or pid of the new object Creates a new, empty object Create new object with autogenerated pidPOST /objects/ Return: pid of the new object (/objects/demo:newObject2) Creates a new, empty object Datastream resourcesCreate a new datastreamPUT /objects/{pid}/datastreams/{dsID}[/withControlGroup/{cg}] Creates a new datastream in the object with controlgroup X or {cg} if specified. Datastream is empty. Retrieve methodsObject resourcesPresent ObjectGET /objects/{pid} Return: XML that presents the object.... Undetailed Get the object propertiesGET /objects/{pid}/properties Provides a list of property names that can be queried Get a specific object propertyGET /objects/{pid}/properties/{property} Give the value of the specific property, or 404 if property not found Example: /objects/demo:myPid2/properties/label Get content models for a objectGET /objects/{pid}/contentmodels Get a list of the content models of this object Get all the relations of an objectGET /objects/{pid}/relations Get a specific relation from an objectGET /objects/{pid}/relations/{rel-name} List the methods on an objectGET /objects/{pid}/methods Invoke a method on an objectGET/POST /objects/{pid}/methods/{sdef}/{methodName}?params Datastream resourcesGet Contents of a datastreamGET /objects/{pid}/datastreams/{dsID} Get the properties of a datastreamGET /objects/{pid}/datastreams/{dsID}/properties Get a specific property of a datastreamGET /objects/{pid}/datastreams/{dsID}/properties/{prop} Get the relations of the datastreamGET /objects/{pid}/datastreams/{dsID}/relations The RELS-INT block "about" this datastream Get version timestamps of a datastreamThe idea is that the old version of the datastream should support the same getter methods as the current version GET /objects/{pid}/datastreams/{dsID}/versions Get the contents of a specific version of a datastreamGET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/contents Get the versioned properties of a specific versionGET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/properties Get a specific versioned property of a specific versionGET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/properties/{propertyname} Get the relations of a specific versionGET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/relations/ Update methodsObject resourcesWrite a specific propertyPUT /objects/{pid}/properties/{property} Add a relation to an objectPUT /objects/{pid}/relations/{rel-name}/to/{objpid} Add a content model to this objectPUT /objects/{pid}/contentmodels/{cmpid} Add cmpid to the list of content model for this object Add a literal relationPUT /objects/{pid}/relations/{rel-name}/toLiteral/{value}[/withType/{type}] Datastream resourcesUpdate the contents of an Inline DatastreamPOST /objects/{pid}/datastreams/{dsID}/contents Update a datastream propertyPUT /objects/{pid}/datastreams/{dsID}/properties/{prop} examples: versionable, state and so on. Update an External, managed or Redirect DatastreamContentlocation is just a property of these datastreams PUT /objects/{pid}/datastreams/{dsID}/properties/contentLocation Add a relation to the datastreamPUT /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/to/{objPid} Add a literal relation to the datastreamPUT /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/toLiteral/{value}[/withType/{type}] Delete methodsObject resourcesPurge objectDELETE /objects/{pid} Remove a content model from this objectDELETE /objects/{pid}/contentmodels/{cmpid} Remove cmpid from the list of content models for this object Purge a relation to an objectDELETE /objects/{pid}/relations/{rel-name}/to/{objpid} Delete a literal relationDELETE /objects/{pid}/relations/{rel-name}/toLiteral/{value} Datastream resourcesDelete a datastreamDELETE /objects/{pid}/datastreams/{dsID} Purge the datastream from the object from the repository Purge a relation from the datastreamDELETE /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/to/{objPid} Purge a literal relation from a datastreamDELETE /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/toLiteral/{value} |