h2. Alternative REST API
In this I will propose an alternative REST api to the one in the Fedora Documentation.
h3. General principles
|| Content\\ || Location\\ ||
| Objects are found in\\ | /objects/ |
| Object presentation\\ | /objects/
\{pid}\\ |
| Object properties are found in\\ | /objects/\{pid}/properties |
Relations| areObject foundrelations\\ in| /objects/\{pid}/relations |
Content| modelsObject arecontent foundmodels\\ in| /objects/\{pid}/contentmodels |
datastreams are found in| Datastreams\\ | /objects/\{pid}/datastreams |
| Datastream content\\ is in| /objects/\{pid}/datastreams/\{dsID} |
| Datastream properties\\ is in| /objects/\{pid}/datastreams/\{dsID}/properties
Datastream |
| Datasteram relations\\ is in| /objects/\{pid}/datastreams/\{dsID}/relations |
| Datastream versions\\ is in| /objects/\{pid}/datastreams/\{dsID}/versions
\\ |
| Object methods is inMethods\\ | /objects/\{pid}/methods |
| Method invocation\\ is| /objects/\{pid}/methods/\{methodName}/from/\{sdef}?params |
h3. Object-Centric methods
h4. Create new object with given pid
PUT /objects/\{pid}
Return: Nothing or pid of the new object
Creates a new, empty object
h4. Create new object with autogenerated pid
POST /objects/
Return: pid of the new object (/objects/demo:newObject2)
Creates a new, empty object
h4. Present Object
GET /objects/\{pid}
Return: XML that presents the object....
Undetailed
h4. Purge object
DELETE /objects/\{pid}
h4. 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
h4. 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
h4. 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.
h4. 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
h4. 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
h4. Get all the relations of an object
GET /objects/\{pid}/relations
Return: Return a list of relation names
h4. Get a specific relation from an object
GET /objects/\{pid}/relations/\{rel-name}
Return: List of pids of objects referred by this relation
h4. Add a relation to an object
PUT /objects/\{pid}/relations/\{rel-name}/to/{objpid}
h4. Purge a relation to an object
DELETE /objects/\{pid}/relations/\{rel-name}/to/{objpid}
h4. Add a literal relation
PUT /objects/\{pid}/relations/\{rel-name}/toLiteral/{value}[/withType/{type}]
h4. Delete a literal relation
PUT /objects/\{pid}/relations/\{rel-name}/toLiteral/{value}
Datastream-Centric methods
Method-Centric methods |