Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

 

Request URI: /path/to/some/resource

Methods: GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, MOVE, COPY 

 

...

Status
titleGET

...

 Retrieve all triples for the resource

Query Parameters:

Status
subtletrue
titleoffset
 Pagination control for member resources

...

Status
subtletrue
colourRed
title404
 Not Found 

 

...

Status
colourBlue
titlePOST

...

Create a new automatically-named child node or datastream at the given path

 

Query Parameters:

Status
subtletrue
titlechecksum
 (Optional) Provide a SHA-1 checksum which will be checked against the uploaded content to ensure error-free transfer.

...

Status
subtletrue
colourRed
title409
Conflict (resource is locked or checksum mismatch) 

 

...

Status
colourYellow
titlePUT
 
Create a resource with a specified path, or replace the triples associated with 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.

...

Example (1): Updating properties with RDF content

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

 

Example (2): Creating a new resource at a specified path

Code Block
curl -X PUT "http://localhost:8080/rest/node/to/create"

Response:

Code Block
Status: 201 Created

Response Headers:
ETag: "ef214795c3b9109389ffa542a6c081976e1e9587"
Last-Modified: Mon, 19 May 2014 20:52:57 GMT
Location: http://localhost:8080/rest/node/to/create

 

Example (3): Creating new datastream content at a specified path

Code Block
curl -X PUT --upload-file image.jpg "http://localhost:8080/rest/new/datastream/fcr:content"

Response:

Code Block
Status: 201 Created

Response Headers:
ETag: "urn:sha1:ea3d29b28522724a82de042a7b7a4e79a1653435"
Last-Modified: Mon, 19 May 2014 20:55:31 GMT
Location: http://localhost:8080/rest/new/datastream/fcr:content

 

Status:

Status
subtletrue
colourGreen
title204
 No Content

Status
subtletrue
colourRed
title409
Conflict (resource is locked)

Status
subtletrue
colourRed
title412
 Precondition Failed

...

 

...

Anchor
patch
patch

Status
colourGreen
titlePATCH
 
Modify the triples associated with a resource with SPARQL-Update

Request Headers:

Status
subtletrue
titleIF-Match
Status
subtletrue
titleIf-UNModified-Since

...

Status
subtletrue
colourRed
title412
 Precondition Failed

 

 

...

Status
colourRed
titleDELETE
Delete a resource

Request Headers:

Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation

...

Status
subtletrue
colourRed
title404
Not Found

 

...

Status
subtletrue
colourGreen
titleHEAD
 
Retrieve the node headers

Example:

Code Block
curl -i -X HEAD "http://localhost:8080/rest/node/to/head"

...

Example:

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
subtletrue
colourGreen
title200
 OK

 


Status
subtletrue
colourRed
titleMOVE
 Move a resource (and its subtree) to a new location

Note: A federated resource can be moved within the federation, but not from the federation to the internal repository (or vice versa)

...

Status
subtletrue
colourRed
title502
 Destination URI isn't a valid resource path

 

 

...

Status
subtletrue
colourBlue
titleCOPY

...

Copy a resource (and its subtree) to a new location

Example:

Code Block
curl -X COPY -H "Destination: http://localhost:8080/rest/new/path/to/node" "http://localhost:8080/rest/path/to/node"

...