...
Status | ||||||
---|---|---|---|---|---|---|
|
...
Anchor | ||||
---|---|---|---|---|
|
Create a new node at the given path Status colour Blue title POST
Create a new automatically-named child node or datastream at the given path.
Query Parameters: Status
Status | ||||
---|---|---|---|---|
|
Request Headers: Status
Note |
---|
RDF will be interpreted using the current resource as the base URI (e.g. <> will be expanded to the current URI). Namespaces must be declared in full. |
...
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Example (1):
Code Block |
---|
curl -X POST "http://localhost:8080/rest/" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/some/path/to/a/new/resource |
Example (2):
Code Block |
---|
curl -X POST "http://localhost:8080/rest/?mixin=fedora:datastream" # Create a fedora:datastream |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new node as a child of the given node Status colour Blue title POST
If the given resource path exists, a POST to that path will create a new node as a child of the given resource using a generated identifier.
Request Headers:
Status | ||||
---|---|---|---|---|
|
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Note |
---|
The slug you provide does not guarantee the location of the created node. Clients must check the Location header for the path to the created resource. For full control over the generated path, see POST Create a new node at the given path. |
Query Parameters:
Status | ||||
---|---|---|---|---|
|
Example (1):
Code Block |
---|
curl -X POST -H "Slug: new-node-name" "http://localhost:8080/rest/" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/new-node-name" |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new node and populate some properties Status colour Blue title POST
In addition to creating a new node, add the given properties to the object
Note |
---|
An RDF payload can be combined with any of the above forms. |
Note |
---|
RDF will be interpreted using the current resource as the base URI (e.g. <> will be expanded to the current URI). Namespaces must be declared in full. |
Request Headers:
Status | ||||
---|---|---|---|---|
|
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Query Parameters:
Status subtle true title checksum
Example:
Code Block |
---|
curl -X POST -H "Content-Type: text/turtle" --data-binary "@body.rdf" "http://localhost:8080/rest/node/to/create"
Request Body:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
<> dc:title "some-resource-title"
|
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/node/to/create |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new node and execute a SPARQL-Update query Status colour Blue title POST
In addition to creating a new node, execute a SPARQL-Update query against the newly created node.
Request Headers:
Status | ||||
---|---|---|---|---|
|
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Query Parameters:
Status subtle true title checksum
Note |
---|
RDF will be interpreted using the current resource as the base URI (e.g. <> will be expanded to the current URI) |
Example:
Code Block |
---|
curl -X POST -H "Content-Type: application/sparql-update" --data-binary "@body.rdf" "http://localhost:8080/rest/node/to/create"
Request Body:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
INSERT {
<> dc:title "some-resource-title" .
}
WHERE { }
|
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/node/to/create |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new resource with binary content Status colour Blue title POST
Note |
---|
If the binary content is RDF or a SPARQL-Update query, see Binary Content for an alternative way to create content |
Query Parameters:
Checksum of the binary content (in the form urn:sha1:<sha-hash>). If the checksum doesn't match, an error will be returned. Status subtle true title checksum
Header Parameters:
The filename provided in the content disposition header will be stored in a premis:hasOriginalName property. Status subtle true title Content-DISPOSITION
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Example (1):
Code Block |
---|
curl -X POST --upload-file picture.jpg "http://localhost:8080/rest/binary/resource/to/create" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/binary/resource/to/create/fcr:content |
Example (2):
Code Block |
---|
curl -X POST --data-binary "@picture.jpg" "http://localhost:8080/rest/binary/resource/to/create?checksum=urn:sha1:cb1a576f22e8e3e110611b616e3e2f5ce9bdb941" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/binary/resource/to/create/fcr:content |
Example (3):
Code Block |
---|
curl -X POST --data-binary "@picture.jpg" "http://localhost:8080/rest/binary/resource/to/create?checksum=urn:sha1:checksumdoesntmatch" |
Response:
Code Block |
---|
Status: 409 Conflict
Error:
Checksum Mismatch of cb1a576f22e8e3e110611b616e3e2f5ce9bdb941 and urn:sha1:checksumdoesntmatch |
Note |
---|
By convention, binary content is accessed using the REST endpoint path/to/resource/fcr:content. |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Modify the triples associated with the resource Status colour Yellow title PUT
Replace the existing triples for a resource with the triples provided in the request body.
Note |
---|
Some resource properties are repository managed and cannot be removed or modified. Any attempt to do so may result in a 4xx error. |
Note |
---|
RDF will be interpreted using the current resource as the base URI (e.g. <> will be expanded to the current URI) |
Request Headers:
Status | ||||
---|---|---|---|---|
|
Status subtle true title IF-Match Status subtle true title If-UNModified-Since
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Query Parameters:
Checksum of the binary content (in the form urn:sha1:<sha-hash>). If the checksum doesn't match, an error will be returned. Status subtle true title checksum
Example:
Code Block |
---|
curl -X PUT -H "Content-Type: text/turtle" --data-binary "@new-triples.rdf" "http://localhost:8080/rest/node/to/update"
Request Body:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
<> dc:title "some-resource-title" .
|
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
with SPARQL-Update Status colour Green title PATCH
Request Headers:
Status subtle true title IF-Match Status subtle true title If-UNModified-Since
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operatio
Example (1):
Code Block |
---|
curl -X PATCH -H "Content-Type: application/sparql-update" --data-binary "@body.rdf" "http://localhost:8080/rest/node/to/update"
Request Body:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
INSERT {
<> dc:title "some-resource-title" .
}
WHERE { }
|
Response:
Code Block |
---|
Status: 204 No Content |
Example (2): Updating multiple objects with a single SPARQL Update
Code Block |
---|
curl -X PATCH -H "Content-Type: application/sparql-update" --data-binary "@body.rdf" "http://localhost:8080/rest/node/to/update"
Request Body:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
INSERT {
<> dc:title "some-resource-title" .
<http://localhost:8080/rest/another/node/to/update> dc:title "some-other-title" .
}
WHERE { } |
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Delete a resource Status colour Red title DELETE
Request Headers:
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Example:
Code Block |
---|
curl -X DELETE "http://localhost:8080/rest/node/to/delete" |
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
...
Move a resource (and its subtree) to a new location Status subtle true colour Red title MOVE
Request Headers:
Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation
Example (1):
Code Block |
---|
curl -X MOVE -H "Destination: http://localhost:8080/rest/new/path/to/node" "http://localhost:8080/rest/path/to/node" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/new/path/to/node |
Example (2):
Code Block |
---|
curl -X MOVE -H "Destination: http://duraspace.org/some/path" "http://localhost:8080/rest/path/to/node" |
Response:
Code Block |
---|
Status: 502 Bad Gateway |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
Copy a resource (and its subtree) to a new location Status subtle true colour Blue title COPY
Example:
Code Block |
---|
curl -X COPY -H "Destination: http://localhost:8080/rest/new/path/to/node" "http://localhost:8080/rest/path/to/node" |
...
Note |
---|
The slug you provide does not guarantee the location of the created node. Clients must check the Location header for the path to the created resource. For full control over the generated path, see XXX. |
Example (1): Create a new child node
Code Block |
---|
curl -X POST "http://localhost:8080/rest/" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/some/path/to/a/new/resource |
Example (2): Create a new child datastream
Code Block |
---|
curl -X POST "http://localhost:8080/rest/?mixin=fedora:datastream" # Create a fedora:datastream |
Example (3): Create a new node with RDF properties
Code Block |
---|
curl -X POST -H "Content-Type: text/turtle" --data-binary "@body.rdf" "http://localhost:8080/rest/"
Request Body:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
<> dc:title "some-resource-title" |
Response:
Code Block |
---|
Status: 201 Created Headers: Location: http://localhost:8080/rest/new/node/uripath/to/node |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|