Table of Contents |
---|
Excerpt |
---|
Request URI: /path/to/some/resource Methods: GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, MOVE, COPY |
...
Status |
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Note: JSON-LD profiles can be requested by using the following Accept
headers:
Accept: application/ld+json; profile=\"http://www.w3.org/ns/json-ld#expanded\"" - default
Accept: application/ld+json; profile=\"http://www.w3.org/ns/json-ld#compacted\""
Accept: application/ld+json; profile=\"http://www.w3.org/ns/json-ld#flattened\""
Status | ||||
---|---|---|---|---|
|
-1
(all children are listed)Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
return=representation
return=representation; include=" URIs "
return=representation; omit=" URIs "
where minimal indicates that only triples directly related to a resource should be returned, and representation indicates that links to other resources and their properties should also be included. URIs is a space-separate list of LDP defined preferences, and also:
URI | Description |
---|---|
http://fedora.info/definitions/ |
...
|
Example (1): Turtle
Code Block |
---|
curl -H "Accept: text/turtle" "http://localhost:8080/rest/path/to/resource" |
Response:
...
|
...
|
...
Example (1): Turtle
|
...
Response:
|
...
|
...
Example (2): RDF/XML
Response:
Example (3): Prefer headers
|
...
|
...
|
...
|
...
|
...
|
...
|
...
Response:
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
Response:
Status:
Status |
|
Code Block |
---|
curl "http://localhost:8080/rest/path/to/binary/resource" |
Response:
Code Block |
---|
Status: 200 OK
Headers:
ETag: "0ed38fe211c2663ace5322e970e7b7d606196e00"
Last-Modified: Mon, 19 May 2014 19:44:59 GMT
Vary: Prefer
Link: <http://localhost:8080/rest/path/to/binary/resource/fcr:metadata">;rel="describedby"
Content-Type: image/jpg
Body:
{binary content} |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
...
Headers:
|
...
(See ' Example (2): Create a new child binary resource with empty content ')
|
...
|
For other MIME types, the uploaded content will be used to create a binary resource.
...
Note |
---|
The slug you provide does not guarantee the location of the created resource. Clients must check the Location header for the path to the created resource. |
...
Status | ||||
---|---|---|---|---|
|
...
|
...
-free transfer. The header is interpreted according to RFC-3230 (See 'Example (4): Uploaded file with checksum' and 'Example (5): Uploaded file with checksum mismatch') If the provided checksum does not match the calculated value for the uploaded file a 409 Conflict will be returned. See PATCH example for documentation on how to change the default algorithm used during on-demand fixity checking. Valid `Digest` algorithms/values are: sha, sha-256, or md5. |
Example (1): Create a new child node
...
Example (1): Create a new child node
Response:
Response:
Response:
Example (4): Uploaded file with checksum
|
...
Response:
|
...
|
...
Response:
|
Example (5): Uploaded file with checksum mismatch
|
...
Response:
|
...
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Response:
|
...
Response:
Status:
Status |
|
Note | ||
---|---|---|
| ||
Some resource properties are repository managed and cannot be removed or modified. Any attempt to do so may result in a 4xx error. |
Request Headers:
|
...
|
...
|
...
|
...
|
...
( |
...
Status colour Yellow title PUT
Create a resource with a specified path, or replace the triples associated with a resource with the triples provided in the request body.
colour | Yellow |
---|---|
title | PUT |
Note |
---|
Some resource properties are repository managed and cannot be removed or modified. Any attempt to do so may result in a 4xx error. |
...
Optional) MIME type of the uploaded binary or RDF content
|
...
|
Request Headers:
Status | ||||
---|---|---|---|---|
|
...
|
...
|
...
replacing the properties of a container without having to provide all of the server-managed triples. Example (1): Updating properties with RDF content 1.1 Perform a GET to the current container's RDF content
1.2 Add your updates (e.g. <> dc:title "some-resource-title" .) under the full result of the GET response in 1.1
Response:
Note that to prevent conflicts, the value of the |
Example (2): Creating a new resource at a specified path
Response:
|
|
...
Response:
|
Note that once a resource is created as an RDF or non-RDF source, it must remain an RDF or non-RDF source. In order to change the type of resource, you must DELETE and then re-create the resource. Status:
|
|
...
Response:
|
Status |
|
Status | ||||
---|---|---|---|---|
|
Status subtle true title If-UNModified-Since
Status subtle true title Content-Type
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) Update default fixity algorithm of a binary's description: Anchor patch-2 patch-2
Code Block |
---|
curl -X PATCH -H "Content-Type: application/sparql-update" --data-binary "@body.rdf" "http://localhost:8080/rest/binary/resource/to/ |
...
Response:
|
...
Status:
|
...
Status |
|
Code Block |
---|
curl -X DELETE "http://localhost:8080/rest/resource/to/delete" |
Response:
Code Block |
---|
Status: 204 No Content |
...
Delete requests create "tombstone" resources which need to be removed before you can reuse a URI. |
Example:
Create a new node and reuse the deleted URL
Status:
|
Status |
|
Code Block |
---|
curl -i -X HEAD "http://localhost:8080/rest/resource/to/head" |
Response:
Code Block |
---|
Status: 200 OK
ETag: "bbdd92e395800153a686773f773bcad80a51f47b"
Last-Modified: Wed, 28 May 2014 18:31:36 GMT
Last-Modified: Thu, 20 Nov 2014 15:44:32 GMT
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#Container>;rel="type"
Link: <http://www.w3.org/ns/ldp#BasicContainer>;rel="type"
Accept-Patch: application/sparql-update
Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,multipart/form-data,application/sparql-update
Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS |
Status:
|
...
Status |
|
Code Block |
---|
curl -i -X OPTIONS "http://localhost:8080/rest/node/to/options" |
Response:
Code Block |
---|
Status: 200 OK
Accept-Patch: application/sparql-update
Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS
Accept-Post: text/turtle,text/rdf+n3,application/n3,text/n3,application/rdf+xml,application/n-triples,multipart/form-data,application/sparql-update |
Status:
|
Status |
|
NOTE: The MOVE action has been deprecated and will be removed in a future version of Fedora. |
---|
Note: A federated resource can be moved within the federation, but not from the federation to the internal repository (or vice versa)
Example (1):
Code Block |
---|
curl -X MOVE -H "Destination: http://localhost:8080/rest/new/path/to/resource" "http://localhost:8080/rest/path/to/resource" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/new/path/to/resource |
...
Example (2):
Response:
Status:
|
...
Status |
|
NOTE: The COPY action has been deprecated and will be removed in a future version of Fedora. |
---|
Example:
Code Block |
---|
curl -X COPY -H "Destination: http://localhost:8080/rest/new/path/to/resource" "http://localhost:8080/rest/path/to/resource" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/new/path/to/resource |
Status:
|
...
...