Alternative REST API
In this I will propose an alternative REST api to the one in the Fedora Documentation.
General principles
Content |
Location |
Objects |
/objects/ |
Object presentation |
/objects/{pid} |
Object properties |
/objects/{pid}/properties |
Object relations |
/objects/{pid}/relations |
Object content models |
/objects/{pid}/contentmodels |
Datastreams |
/objects/{pid}/datastreams |
Datastream content |
/objects/{pid}/datastreams/{dsID} |
Datastream properties |
/objects/{pid}/datastreams/{dsID}/properties |
Datasteram relations |
/objects/{pid}/datastreams/{dsID}/relations |
Datastream versions |
/objects/{pid}/datastreams/{dsID}/versions |
Object Methods |
/objects/{pid}/methods |
Method invocation |
/objects/{pid}/methods/{methodName}/from/{sdef}?params |
Object-Centric methods
Create new object with given pid
PUT /objects/{pid}
Return: Nothing or pid of the new object
Creates a new, empty object
Create new object with autogenerated pid
POST /objects/
Return: pid of the new object (/objects/demo:newObject2)
Creates a new, empty object
Present Object
GET /objects/{pid}
Return: XML that presents the object....
Undetailed
Purge object
DELETE /objects/{pid}
Get the object properties
GET /objects/{pid}/properties
Return: list of property names (/object/demo:myPid2/properties/label)
Provides a list of property names that can be queried
Get a specific object property
GET /objects/{pid}/properties/{property}
Return: The value
Give the value of the specific property, or 404 if property not found
Example: /objects/demo:myPid2/properties/label
Write a specific property
PUT /objects/{pid}/properties/{property}
Contents: The new value
Return nothing, or 404 if property not found. New properties cannot be created.
Get content models for a object
GET /objects/{pid}/contentmodels
Return: Get the content models of the object (/objects/demo:contentmodel)
Get a list of the content models of this object
Add a content model to this object
PUT /objects/{pid}/contentmodels/{cmpid}
Contents: Nothing
Add cmpid to the list of content model for this object
Get all the relations of an object
GET /objects/{pid}/relations
Return: Return a list of relation names
Get a specific relation from an object
GET /objects/{pid}/relations/{rel-name}
Return: List of pids of objects referred by this relation
Add a relation to an object
PUT /objects/{pid}/relations/{rel-name}/to/
Unknown macro: {objpid}
Purge a relation to an object
DELETE /objects/{pid}/relations/{rel-name}/to/
Add a literal relation
PUT /objects/{pid}/relations/{rel-name}/toLiteral/
Unknown macro: {value} [/withType/
Unknown macro: {type}
]
Delete a literal relation
PUT /objects/{pid}/relations/{rel-name}/toLiteral/
Datastream-Centric methods
Method-Centric methods