Alternative REST APIIn this I will propose an alternative REST api to the one in the Fedora Documentation. 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 ones with very clear purpose. The interface should be usable without any documentation. General principles
Object-Centric methodsCreate 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 Present ObjectGET /objects/{pid} Return: XML that presents the object.... Undetailed Purge objectDELETE /objects/{pid} 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 Write a specific propertyPUT /objects/{pid}/properties/{property} Get content models for a objectGET /objects/{pid}/contentmodels Get a list of the content models of this object Add a content model to this objectPUT /objects/{pid}/contentmodels/{cmpid} Add cmpid to the list of content model for this object Get all the relations of an objectGET /objects/{pid}/relations Get a specific relation from an objectGET /objects/{pid}/relations/{rel-name} Add a relation to an objectPUT /objects/{pid}/relations/{rel-name}/to/{objpid} Purge a relation to an objectDELETE /objects/{pid}/relations/{rel-name}/to/{objpid} Add a literal relationPUT /objects/{pid}/relations/{rel-name}/toLiteral/{value}[/withType/{type}] Delete a literal relationPUT /objects/{pid}/relations/{rel-name}/toLiteral/{value} Datastream-Centric methodsCreate 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 either empty or with the initial content Delete a datastreamDELETE /objects/{pid}/datastreams/{dsID} Purge the object from the repository Get Contents of a datastreamGET /objects/{pid}/datastreams/{dsID} Update an Inline or Managed DatastreamPOST /objects/{pid}/datastreams/{dsID} Get the properties of a datastreamGET /objects/{pid}/datastreams/{dsID}/properties Get a specific propertyGET /objects/{pid}/datastreams/{dsID}/properties/{prop} Update a propertyPUT /objects/{pid}/datastreams/{dsID}/properties/{prop} examples: versionable, state and so on. Update an External or Redirect DatastreamContentlocation is just a property of these datastreams PUT /objects/{pid}/datastreams/{dsID}/properties/contentLocation Get the relations of the datastreamGET /objects/{pid}/datastreams/{dsID}/relations The RELS-INT block "about" this datastream Add a relation to the datastreamPUT /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/to/{objPid} Purge a relation from the datastreamDELETE /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}] Purge a literal relation from a datastreamDELETE /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/toLiteral/{value} 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} 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/ Method-Centric methodsList the methods on an objectGET /objects/{pid}/methods Invoke a method on an objectGET/POST /objects/{pid}/methods/{methodName}/from/{sdef}?params |