...
Create a new node at the given path, and recursively create any missing parent elements.
Query Parameters:
Status | ||||||
---|---|---|---|---|---|---|
|
Example (1):
Code Block |
---|
curl -X POST "http://localhost:8080/rest/some/path/to/a/new/resource" |
...
Code Block |
---|
Status: 201 Created |
Status:
Headers:
Location: http://localhost:8080/rest/path/to/a/new/resource |
Example (2):
Code Block |
---|
curl -X POST "http://localhost:8080/rest/some/path/to/a/new/resource?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 an automatically-a generated identifier.
ExampleRequest Headers:
Status |
---|
Code Block |
---|
curl -X POST "http://localhost:8080/rest/this/node/already/exists" |
Response:
|
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 (link me!) |
Query Parameters:
Status | ||||||
---|---|---|---|---|---|---|
|
Example (1):
Code Block |
---|
curl -X POST "http://localhost:8080/rest/this/node/already/exists" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/this/node/already/exists/some/generated/identifier |
Example (2):
Code Block |
---|
curl -X POST -H "Slug: new-node-name" "http://localhost:8080/rest/this/node/already/exists" |
Response:
Code Block |
---|
Status |
Code Block |
Status: 201 Created Headers: Location: http://localhost:8080/rest/this/node/already/exists/somenew/generatednode/identifiername |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new (named) node as a child of the given node Status colour Blue title POST
If the given resource path exists, a POST to that path with a Slug header set will create a new node as a child of the given resource using the provided slug to generate an identifier
node and populate some properties
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) |
Query ParametersRequest Headers:
Slug Status subtle true title checksum
Use the slug header when creating the new resource (see AtomPub ref?)
Example:
Code Block |
---|
curl -X POST -H "SlugContent-Type: new-node-nametext/turtle" "http://localhost:8080/rest/this/node/already/exists"to/create" -d "@body.rdf" Request Body: <> dc:title "some-resource-title" |
Response:
Code Block |
---|
Status: 201 Created Headers: Location: http://localhost:8080/rest/this/node/already/exists/new/node/name |
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 (link me!) |
to/create |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new node and populate some propertiesexecute a SPARQL-Update query Status colour Blue title POST
In addition to creating a new node, add the given properties to the object
...
execute a SPARQL-Update query against the newly created node.
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) |
Query Parameters:
...
Example:
Code Block |
---|
curl -X POST -H "Content-Type: textapplication/turtlesparql-update" "http://localhost:8080/rest/node/to/create" -d "@body.rdf" Request Body: INSERT { <> dc:title "some-resource-title" . } WHERE { } |
Response:
Code Block |
---|
Status: 201 Created Headers: Location: http://localhost:8080/rest/node/to/create |
...
Status | ||||||
---|---|---|---|---|---|---|
|
...
Create a new node and execute a SPARQL-Update queryIn addition to creating a new node, execute 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:
Status subtle true title checksum
...
Checksum of the binary content (in the form urn:sha1:<sha-hash>). If the checksum doesn't match, an error will be returned.
Example (1):
Code Block |
---|
curl -X POST -H "Content-Type: application/sparql-update"-X POST "http://localhost:8080/rest/binary/noderesource/to/create" -d "@body@picture.rdf"jpg" |
Response:
Code Block |
---|
Status: 201 Created Request BodyHeaders: Location: http://localhost:8080/rest/binary/resource/to/create/fcr:content |
Example (2):
Code Block |
---|
curl -X POST "http://localhost:8080/rest/binary/resource/to/create?checksum=urn:sha1:cb1a576f22e8e3e110611b616e3e2f5ce9bdb941" -d "@picture.jpg" INSERT { <> dc:title "some-resource-title" . } WHERE { } |
Response:
Code Block |
---|
Status: 201 Created
Headers:
Location: http://localhost:8080/rest/node/to/create |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
...
/binary/resource/to/create/fcr:content |
Example (3)
Note |
---|
If the binary content is RDF or a SPARQL-Update query, see Binary Content for an alternative way to create content |
Query Parameters:
...
Example:
Code Block |
---|
curl -X POST "http://localhost:8080/rest/binary/resource/to/create?checksum=urn:sha1:checksumdoesntmatch" -d "@picture.jpg" |
Response:
Code Block |
---|
Status: 201409 CreatedConflict HeadersError: Location: http://localhost:8080/rest/binary/resource/to/create/fcr:contentChecksum 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 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Modify the triples associated with the resource Status colour Yellow title PUT
...