...
Excerpt |
---|
Request URI: /path/to/some/resource Methods: GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, MOVE, COPY |
Excerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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/fcrepo#PreferInboundReferences | Include assertions from other Fedora resources to this node (excluded from representation by default) |
http://fedora.info/definitions/v4/repository#ServerManagedfcrepo#ServerManaged | Embed server managed properties in the representation (enabled by default) |
http://www.w3.org/ns/oa#PreferContainedDescriptions | Embed "child" resources in the returned representation |
http://www.w3.org/ns/ldp#PreferContainment | Include/Exclude "ldp:contains" assertions to contained resources (enabled by default) |
http://www.w3.org/ns/ldp#PreferMembership | Include/Exclude assertions to member resources established by the Direct and Indirect containers (enabled by default) |
http://www.w3.org/ns/ldp#PreferMinimalContainer | Include/Exclude triples that would be present when the container is empty (enabled by default) |
Example (1): Turtle
Code Block |
---|
curl -H "Accept: text/turtle" "http://localhost:8080/rest/path/to/resource" |
Response:
Code Block |
---|
Status: 200 OK Headers: ETag: W/"0ed38fe211c2663ace5322e970e7b7d606196e0051FA3512608877FD9197C8701F986014" X-State-Token: 0366B7A7332BADF807F473D5579CD1E5 Last-Modified: MonThu, 1904 MayMar 20142021 1914:4423:5946 GMT Preference-AppliedLink: return=representation; include="http<http://www.w3.org/ns/ldp#PreferMembership http://www.w3.org/ns/ldp#PreferContainment" Vary: Prefer 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-updatelocalhost:8080/rest/path/to/resource>; rel="timegate" Link: <http://localhost:8080/rest/path/to/resource>; rel="original" Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap" Link: <http://www.w3.org/ns/ldp#Resource>ldp#BasicContainer>; rel="type" Link: <http://www.w3.org/ns/ldp#DirectContainer>ldp#Resource>; rel="type" Content-TypeLink: text/turtle Body: <http://localhost:8080/rest/path/to/resource> <http://<http://fedora.info/definitions/v4/rest-api#hasAccessRoles>repository#Resource>; rel="type" Link: <http://localhost:8080/rest/path/to/resource/fcr:accessroles> ; mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://fedorawww.w3.infoorg/definitions/v4/rest-api#exportsAs>ns/ldp#RDFSource>; rel="type" Link: <http://localhost:8080/rest/path/to/resource/fcr:export?format=jcr/xml> ; www.w3.org/ns/ldp#Container>; rel="type" Link: <http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/path/to> ; a <http://www.w3.org/ns/ldp#Container> , <http://www.w3.org/ns/ldp#DirectContainer> ; <http://www.w3.org/ns/ldp#membershipResource>repository#Container>; rel="type" Accept-External-Content-Handling: copy,redirect,proxy Accept-Patch: application/sparql-update Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,application/ld+json Allow: DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS Link: <http://localhost:8080/rest/path/to/resource> ; <http://www.w3.org/ns/ldp#hasMemberRelation> <http://fedora.info/definitions/v4/repository#hasChild> ; aresource/fcr:acl>; rel="acl" Preference-Applied: return=representation Vary: Prefer Vary: Accept Vary: Range Vary: Accept-Encoding Vary: Accept-Language Vary: Accept-Datetime Content-Type: text/turtle;charset=utf-8 Content-Length: 822 Body: @prefix rdf: <http://www.jcpw3.org/jcr1999/nt/1.0folder> ,02/22-rdf-syntax-ns#> . @prefix fedora: <http://wwwfedora.jcp.orginfo/jcrdefinitions/ntv4/1.0hierarchyNode> ,repository#> . @prefix ldp: <http://www.jcpw3.org/jcr/nt/1.0base> , ns/ldp#> . <http://www.jcp.org/jcr/mix/1.0created> , <http://fedora.info/definitions/v4/rest-api#resource> , <http://fedora.info/definitions/v4/rest-api#object> , <http://fedora.info/definitions/v4/rest-api#relations> , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified> , <http://www.jcp.org/jcr/mix/1.0referenceable> , <http://purl.org/dc/elements/1.1/describable> , <http://fedora.info/definitions/v4/rest-api#resource> ; <http://fedora.info/definitions/v4/repository#primaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ; <http://fedora.info/definitions/v4/repository#created> "2014-05-19T19:44:59.647Z"^^<http://www.w3.org/2001/XMLSchema#string> ; <http://fedora.info/definitions/v4/repository#lastModified> "2014-05-19T19:44:59.645Z"^^<http://www.w3.org/2001/XMLSchema#string> ; <http://fedora.info/definitions/v4/repository#mixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<http://www.w3.org/2001/XMLSchema#string> ; <http://fedora.info/definitions/v4/repository#lastModifiedBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ; <http://fedora.info/definitions/v4/repository#uuid> "2b655d37-e88a-44c5-86c1-3b3935cdea49"^^<http://www.w3.org/2001/XMLSchema#string> ; <http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ; a <http://www.jcp.org/jcr/nt/1.0folder> , <http://www.jcp.org/jcr/nt/1.0hierarchyNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0created> , <http://fedora.info/definitions/v4/rest-api#resource> , <http://fedora.info/definitions/v4/rest-api#object> , <http://fedora.info/definitions/v4/rest-api#relations> , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified>, <http://www.jcp.org/jcr/mix/1.0referenceable> , <http://purl.org/dc/elements/1.1/describable> , <http://fedora.info/definitions/v4/rest-api#resource>localhost:8080/rest/path/to/resource> fedora:created "2021-03-04T14:23:46.625848Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; fedora:lastModified "2021-03-04T14:23:46.625848Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; fedora:createdBy "fedoraAdmin" ; fedora:lastModifiedBy "fedoraAdmin" ; rdf:type ldp:BasicContainer ; rdf:type ldp:Resource ; rdf:type fedora:Resource ; rdf:type ldp:RDFSource ; rdf:type ldp:Container ; rdf:type fedora:Container . |
Example (2): RDF/XML
Code Block |
---|
curl -H "Accept: application/rdf+xml" "http://localhost:8080/rest/path/to/resource" |
Response:
Code Block |
---|
Status: 200 OK Headers: ETag: W/"0ed38fe211c2663ace5322e970e7b7d606196e00"2295E7A75138993E8EB9A961F053FAC7" X-State-Token: 0366B7A7332BADF807F473D5579CD1E5 Last-Modified: MonThu, 1904 MayMar 20142021 1914:4423:5946 GMT Preference-AppliedLink: return=representation; include="http://www.<http://localhost:8080/rest/path/to/resource>; rel="timegate" Link: <http://localhost:8080/rest/path/to/resource>; rel="original" Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap" Link: <http://www.w3.org/ns/ldp#PreferMembership httpldp#BasicContainer>; rel="type" Link: <http://www.w3.org/ns/ldp#PreferContainmentldp#Resource>; rel="type" VaryLink: Prefer 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<http://fedora.info/definitions/v4/repository#Resource>; rel="type" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://www.w3.org/ns/ldp#Resource>ldp#RDFSource>; rel="type" Link: <http://www.w3.org/ns/ldp#DirectContainer>ldp#Container>; rel="type" Content-TypeLink: application/rdf+xml Body: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="http://localhost:8080/rest/path/to/resource"> <hasAccessRoles xmlns="http://fedora.info/definitions/v4/rest-api#" rdf:resource="http:<http://fedora.info/definitions/v4/repository#Container>; rel="type" Accept-External-Content-Handling: copy,redirect,proxy Accept-Patch: application/sparql-update Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,application/ld+json Allow: DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS Link: <http://localhost:8080/rest/path/to/resource/fcr:accessroles"/> <exportsAs xmlns="http://fedora.info/definitions/v4/rest-api#" rdf:resource="http://localhost:8080/rest/path/to/resource/fcr:export?format=jcr/xml"/>acl>; rel="acl" Preference-Applied: return=representation Vary: Prefer Vary: Accept Vary: Range Vary: Accept-Encoding Vary: Accept-Language Vary: Accept-Datetime Content-Type: application/rdf+xml Content-Length: 1096 Body: <rdf:RDF <hasParent xmlns:rdf="http://fedorawww.w3.infoorg/definitions1999/v4/repository#" rdf:resource02/22-rdf-syntax-ns#" xmlns:fedora="http://localhost:8080/rest/path/to"/>fedora.info/definitions/v4/repository#" <rdf:type rdf:resourcexmlns:ldp="http://www.w3.org/ns/ldp#Containerldp#"/ > <rdf:typeDescription rdf:resourceabout="http://localhost:8080/rest/www.w3.org/ns/ldp#DirectContainer"/path/to/resource"> <membershipResource xmlns="http://www.w3.org/ns/ldp#"<rdf:type rdf:resource="http://localhost:8080/rest/path/to/resource"/>fedora.info/definitions/v4/repository#Container"/> <fedora:createdBy>fedoraAdmin</fedora:createdBy> <hasMemberRelation xmlns<fedora:created rdf:datatype="http://www.w3.org/ns2001/ldp#" rdf:resource="http://fedora.info/definitions/v4/repository#hasChild"/>XMLSchema#dateTime">2021-03-04T14:23:46.625848Z</fedora:created> <fedora:lastModifiedBy>fedoraAdmin</fedora:lastModifiedBy> <rdf:type rdf:resource="http://www.jcpw3.org/jcr/nt/1.0folderns/ldp#BasicContainer"/> <rdf:type rdf:resource="http://www.jcpw3.org/jcr/nt/1.0hierarchyNodens/ldp#Resource"/> <rdf:type rdf:resource="http://wwwfedora.jcp.orginfo/jcrdefinitions/ntv4/1.0baserepository#Resource"/> <rdf<fedora:typelastModified rdf:resourcedatatype="http://www.jcpw3.org/jcr/mix/1.0created"/>2001/XMLSchema#dateTime">2021-03-04T14:23:46.625848Z</fedora:lastModified> <rdf:type rdf:resource="http://fedorawww.w3.infoorg/definitions/v4/rest-api#resourcens/ldp#Container"/> <rdf:type rdf:resource="http://fedorawww.w3.infoorg/definitions/v4/rest-api#objectns/ldp#RDFSource"/> <rdf:type rdf:resource="http://fedora.info/definitions/v4/rest-api#relations"/> <rdf:type rdf:resource</rdf:Description> </rdf:RDF> |
Example (3): Prefer headers
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/collection -H 'Prefer: return=representation; include="http://wwwfedora.jcp.orginfo/jcr/mix/1.0created"/> <rdf:type rdf:resourcedefinitions/fcrepo#PreferInboundReferences"; omit="http://www.jcpw3.org/jcr/mix/1.0lastModified"/> <rdf:type rdf:resource="ns/ldp#PreferMembership http://www.jcpw3.org/ns/ldp#PreferContainment"' |
Response:
Code Block |
---|
Status: 200 OK Headers: ETag: W/"16E9753D375AB3E9306140DA1AD24193" X-State-Token: EE5D77CFC717FF045DB3F9821AB25472 Last-Modified: Thu, 04 Mar 2021 14:28:00 GMT Link: <http://localhost:8080/rest/collection>; rel="timegate" Link: <http://localhost:8080/rest/collection>; rel="original" Link: <http://localhost:8080/rest/collection/fcr:versions>; rel="timemap" Link: <httpjcr/mix/1.0referenceable"/> <rdf:type rdf:resource="http://purl.org/dc/elements/1.1/describable"/> <rdf:type rdf:resource="http://fedora.info/definitions/v4/rest-api#resource"/> <primaryType xmlns="http://fedora.info/definitions/v4/repository#" rdf:datatype="http://www.w3.org/2001/XMLSchema#string">nt:folder</primaryType> <created xmlns="httpns/ldp#BasicContainer>; rel="type" Link: <http://www.w3.org/ns/ldp#Resource>; rel="type" Link: <http://fedora.info/definitions/v4/repository#" rdf:datatype="httprepository#Resource>; rel="type" Link: <http://wwwmementoweb.w3.org/2001/XMLSchema#string">2014-05-19T19:44:59.647Z</created> <lastModified xmlns="http://fedora.info/definitions/v4/repository#" rdf:datatype="httpns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type" Link: <http://www.w3.org/2001/XMLSchema#string">2014-05-19T19:44:59.645Z</lastModified> <mixinTypes xmlns="httpns/ldp#Container>; rel="type" Link: <http://fedora.info/definitions/v4/repository#" rdf:datatype="http://www.w3.org/2001/XMLSchema#string">fedora:resource</mixinTypes> <mixinTypes xmlns="http://fedora.info/definitions/v4/repository#" rdf:datatype="http://www.w3.org/2001/XMLSchema#string">fedora:object</mixinTypes> <lastModifiedBy xmlnsrepository#Container>; rel="type" Accept-External-Content-Handling: copy,redirect,proxy Accept-Patch: application/sparql-update Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,application/ld+json Allow: DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS Link: <http://localhost:8080/rest/collection/fcr:acl>; rel="acl" Preference-Applied: return=representation; include="http://fedora.info/definitions/v4/repository#fcrepo#PreferInboundReferences"; rdf:datatypeomit="http://www.w3.org/2001/XMLSchema#string">bypassAdmin</lastModifiedBy> <uuid xmlns="http://fedora.info/definitions/v4/repository#" rdf:datatype="http://ns/ldp#PreferMembership http://www.w3.org/2001ns/XMLSchema#string">2b655d37-e88a-44c5-86c1-3b3935cdea49</uuid> <createdBy xmlns="http://fedora.info/definitions/v4/repository#" rdf:datatype="httpldp#PreferContainment" Vary: Prefer Vary: Accept Vary: Range Vary: Accept-Encoding Vary: Accept-Language Vary: Accept-Datetime Content-Type: text/turtle;charset=utf-8 Content-Length: 927 Body: @prefix rdf: <http://www.w3.org/20011999/XMLSchema#string">bypassAdmin</createdBy> <rdf:type rdf:resource="http://www.jcp.org/jcr/nt/1.0folder"/> <rdf:type rdf:resource="http://www.jcp.org/jcr/nt/1.0hierarchyNode"/> <rdf:type rdf:resource="http://www.jcp.org/jcr/nt/1.0base"/> <rdf:type rdf:resource="http://www.jcp.org/jcr/mix/1.0created"/> <rdf:type rdf:resource="http://fedora.info/definitions/v4/rest-api#resource"/> <rdf:type rdf:resource="http://fedora.info/definitions/v4/rest-api#object"/> <rdf:type rdf:resource="http://fedora.info/definitions/v4/rest-api#relations"/> <rdf:type rdf:resource="http://www.jcp.org/jcr/mix/1.0created"/> <rdf:type rdf:resource="http://www.jcp.org/jcr/mix/1.0lastModified"/> <rdf:type rdf:resource="http://www.jcp.org/jcr/mix/1.0referenceable"/> <rdf:type rdf:resource="http://purl.org/dc/elements/1.1/describable"/> <rdf:type rdf:resource="http://fedora.info/definitions/v4/rest-api#resource"/> </rdf:Description> </rdf:RDF> |
Example (3): Prefer headers
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin http://localhost:8080/rest/collection -H 'Prefer: return=representation;
include="http://fedora.info/definitions/fcrepo#PreferInboundReferences"; omit="http://www.w3.org/ns/ldp#PreferMembership
http://www.w3.org/ns/ldp#PreferContainment"' |
Response:
02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
<http://localhost:8080/rest/collection>
fedora:created "2021-03-04T14:28:00.682730Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2021-03-04T14:28:00.682730Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:createdBy "fedoraAdmin" ;
fedora:lastModifiedBy "fedoraAdmin" ;
rdf:type ldp:BasicContainer ;
rdf:type ldp:Resource ;
rdf:type fedora:Resource ;
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
rdf:type fedora:Container .
<http://localhost:8080/rest/item>
ldp:isMemberOfCollection <http://localhost:8080/rest/collection> . |
Example (4): Non-RDF Source Anchor get-binary get-binary
Code Block |
---|
curl "http://localhost:8080/rest/path/to/binary/resource" |
Response:
Code Block |
---|
Status: 200 OK
Headers:
ETag: "0DFF05D21B40AF6576241DB58A91A7E3"
X-State-Token: 0DFF05D21B40AF6576241DB58A91A7E3
Last-Modified: Thu, 04 Mar 2021 14:32:03 GMT
Content-Type: text/plain
Accept-Ranges: bytes
Content-Disposition: attachment; filename=""; creation-date="Thu, 04 Mar 2021 14:32:03 GMT"; modification-date="Thu, 04 Mar 2021 14:32:03 GMT"; size=20 |
Code Block |
Status: 200 OK Headers: Date: Sat, 13 Oct 2018 00:03:25 GMT Set-Cookie: JSESSIONID=1pgwewtt9ucywx13hwo9mtjow;Path=/ Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Fri, 12-Oct-2018 00:03:25 GMT ETag: W/"fee2096961dcdf1c475d394319fc34a53bec39ac" Last-Modified: Fri, 12 Oct 2018 23:24:34 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#RDFSource>; rel="type" Link: <http://www.w3.org/ns/ldp#BasicContainer>;rel="type" Link: <http://localhost:8080/rest/collection>; rel="timegate" Link: <http://localhost:8080/rest/collection>; rel="original" Link: <http://localhost:8080/rest/collection/fcr:versions>; rel="timemap" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Accept-External-Content-Handling: copy,redirect,proxy Accept-Patch: application/sparql-update Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,application/ld+json Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS Link: <http://localhost:8080/rest/collection/path/to/binary/resource/fcr:acl>metadata>; rel="acldescribedby" Preference-Applied: return=representation; include="http://fedora.info/definitions/fcrepo#PreferInboundReferences"; omit="httpLink: <http://localhost:8080/rest/path/to/binary/resource>; rel="timegate" Link: <http://localhost:8080/rest/path/to/binary/resource>; rel="original" Link: <http://localhost:8080/rest/path/to/binary/resource/fcr:versions>; rel="timemap" Link: <http://www.w3.org/ns/ldp#PreferMembership httpldp#NonRDFSource>; rel="type" Link: <http://www.w3.org/ns/ldp#PreferContainmentldp#Resource>; rel="type" VaryLink: Prefer Vary: Accept Vary: Range Vary: Accept-Encoding Vary: Accept-Language Vary: Accept-Datetime Content-Type: text/turtle;charset=utf-8 Content-Length: 1082 Server: Jetty(9.3.25.v20180904) Body: @prefix memento: <http://fedora.info/definitions/v4/repository#Resource>; rel="type" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#> . @prefix rdf: ns#TimeGate>; rel="type" Link: <http://wwwfedora.w3.orginfo/1999definitions/02/22-rdf-syntax-ns#> . @prefix fedora: <http://fedora.info/definitions/v4/repository#> . @prefix ldp: <http://www.w3.org/ns/ldp#> . <http://localhost:8080/rest/collection> rdf:type fedora:Container ; rdf:type fedora:Resource ; rdf:type ldp:BasicContainer ; fedora:lastModifiedBy "fedoraAdmin" ; fedora:createdBy "fedoraAdmin" ; fedora:created "2018-10-12T23:24:34.286Z"^^<http:v4/repository#Binary>; rel="type" Accept-External-Content-Handling: copy,redirect,proxy Allow: DELETE,HEAD,GET,PUT,OPTIONS Link: <http://localhost:8080/rest/path/to/binary/resource/fcr:acl>; rel="acl" Cache-Control: no-transform, must-revalidate, max-age=0 Content-Length: 20 Body: {binary content} |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Excerpt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Status |
|
Status | ||||
---|---|---|---|---|
|
(Optional) MIME type of the uploaded binary or RDF content (See ' Example (2): Create a new child binary resource with empty content ') Status subtle true title Content-Type
Note |
---|
If the MIME type corresponds to a supported RDF format, the uploaded content will be parsed as RDF and used to populate the child node properties. 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. If the MIME type corresponds to a supported RDF format, and you also provide a |
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} |
For other MIME types, the uploaded content will be used to create a binary resource. Supported RDF formats: text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/n-triples, application/ld+json |
(Optional) A suggested name for the new child resource, which the repository may ignore. Status subtle true title SLUG
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. |
(Optional) A way of providing one or more checksums (SHA-1, SHA-256, MD5) which will be checked against the uploaded content to ensure error-free transfer. The header is interpreted according to RFC-3230 (see 'Example (4): Uploaded file with checksum', 'Example (4b): Uploaded file with multiple 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, sha-512, sha-512/256 or md5. Status subtle true title Digest
With a value containing subfield Status subtle true title LINK rel= http://fedora.info/definitions/fcrepo#ExternalContent
the client may provide binary content from an external path. See the external content documentation for details about syntax and handling options (note, this is disabled by default), and Example 7 for usage. With a rel="type" and a URI of http://fedora.info/definitions/v4/repository#ArchivalGroup
the client may create an Archival Group container. See the Fedora OCFL Object Structure for more information about how this affects the OCFL structure and see Example 2b
Example (1a): Create a new child node
Code Block |
---|
curl -X POST "http://localhost:8080/rest/" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: W/"0AA840C9923E2DCAE850E70E56575771"
X-State-Token: 56AEFC5E47294A2D336BDC23727BEC2A
Last-Modified: Thu, 04 Mar 2021 14:34:00 GMT
Link: <http://localhost:8080/rest/64b9d374-5e20-4b06-964a-d4724528d1e2>; rel="timegate"
Link: <http://localhost:8080/rest/64b9d374-5e20-4b06-964a-d4724528d1e2>; rel="original"
Link: <http://localhost:8080/rest/64b9d374-5e20-4b06-964a-d4724528d1e2/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Container>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Container>; rel="type"
Link: <http://localhost:8080/rest/64b9d374-5e20-4b06-964a-d4724528d1e2/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/64b9d374-5e20-4b06-964a-d4724528d1e2
Body:
http://localhost:8080/rest/64b9d374-5e20-4b06-964a-d4724528d1e2 |
Example (1b): Create a new Archival Group node Anchor post-ag post-ag
See definition of archival group.
Code Block |
---|
curl -X POST -u fedoraAdmin:fedoraAdmin -H "Slug: my-archival-group" -H "Link: <http://fedora.info/definitions/v4/repository#ArchivalGroup>;rel=\"type\"" http://localhost:8080/rest |
Code Block |
---|
Status: 201 Created
Headers:
ETag: W/"2012C77920D7115A29671223FB5C78CC"
X-State-Token: B39C9CC391FE7CEEA41F88F62189ED92
Last-Modified: Thu, 04 Mar 2021 14:36:39 GMT
Link: <http://localhost:8080/rest/my-archival-group>; rel="timegate"
Link: <http://localhost:8080/rest/my-archival-group>; rel="original"
Link: <http://localhost:8080/rest/my-archival-group/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#ArchivalGroup>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Container>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Container>; rel="type"
Link: <http://localhost:8080/rest/my-archival-group/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/my-archival-group
Content-Type: text/plain
Content-Length: 44
Body:
http://localhost:8080/rest/my-archival-group |
Note any subsequent posts to the above created ArchivalGroup endpoint will cause those new resources to be nested within that Archival Group. For details on the structure and workings of Archival Groups see Fedora OCFL Object Structure.
Example (2): Create a new child binary resource with empty content Anchor post-example2 post-example2
Code Block |
---|
curl -i -X POST -H "Content-Type:text/plain" "http://localhost:8080/rest" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "842E0D598779799191CE1D8D79F8E812"
X-State-Token: 842E0D598779799191CE1D8D79F8E812
Last-Modified: Thu, 04 Mar 2021 14:38:38 GMT
Link: <http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903"
Link: <http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903>; rel="timegate"
Link: <http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903>; rel="original"
Link: <http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type"
Link: <http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903
Content-Type: text/plain
Content-Length: 63
Body:
http://localhost:8080/rest/40a0d656-1f70-4135-b6a8-ee956dfb1903 |
Example (3): Create a new container with RDF properties Anchor post-example3 post-example3
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X POST -H "Content-Type: text/turtle" --data-binary "PREFIX dc: <http://purl.org/dc/elements/1.1/> <> dc:title \"some-resource-title\"" http://localhost:8080/rest/ |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: W/"541702CF94C0D6BD8B2423DED7687BC1"
X-State-Token: B9F8FBFA0B1D724160181298C299242C
Last-Modified: Thu, 04 Mar 2021 14:42:02 GMT
Link: <http://localhost:8080/rest/febddb7c-4526-4c0d-90dc-c83c11921586>; rel="timegate"
Link: <http://localhost:8080/rest/febddb7c-4526-4c0d-90dc-c83c11921586>; rel="original"
Link: <http://localhost:8080/rest/febddb7c-4526-4c0d-90dc-c83c11921586/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Container>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Container>; rel="type"
Link: <http://localhost:8080/rest/febddb7c-4526-4c0d-90dc-c83c11921586/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/febddb7c-4526-4c0d-90dc-c83c11921586
Content-Type: text/plain
Content-Length: 63
Body:
http://localhost:8080/rest/febddb7c-4526-4c0d-90dc-c83c11921586 |
Anchor | ||||
---|---|---|---|---|
|
Example (4): Uploaded file with checksum
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X POST --data-binary "@picture.jpg" -H"digest: sha=cb1a576f22e8e3e110611b616e3e2f5ce9bdb941" "http://localhost:8080/rest/parent" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "1F819784173CD233B8EA9691778E1BB0"
X-State-Token: 1F819784173CD233B8EA9691778E1BB0
Last-Modified: Thu, 04 Mar 2021 14:45:55 GMT
Link: <http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b"
Link: <http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b>; rel="timegate"
Link: <http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b>; rel="original"
Link: <http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type"
Link: <http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b
Content-Type: text/plain
Content-Length: 70
Body:
http://localhost:8080/rest/parent/e4b7add5-7860-4130-a6a6-42391e86248b |
Example (4b): Uploaded file with multiple checksum Anchor post-example4b post-example4b
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X POST --data-binary "@picture.jpg" -H"digest: sha=cb1a576f22e8e3e110611b616e3e2f5ce9bdb941, sha-256=95331b60710d0400ee4913b5613c78f54" "http://localhost:8080/rest/parent" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "C19921567DCDD99C9E17A9151005824A"
X-State-Token: C19921567DCDD99C9E17A9151005824A
Last-Modified: Thu, 04 Mar 2021 14:48:10 GMT
Link: <http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7"
Link: <http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7>; rel="timegate"
Link: <http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7>; rel="original"
Link: <http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type"
Link: <http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7
Content-Type: text/plain
Content-Length: 70
Body:
http://localhost:8080/rest/parent/b9216b25-bc78-4417-9587-43dbefa8dbd7 |
Anchor | ||||
---|---|---|---|---|
|
Example (5): Uploaded file with checksum mismatch
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X POST --data-binary "@picture.jpg" -H"digest: sha=checksumdoesntmatch" "http://localhost:8080/rest/parent/object" |
Response:
Code Block |
---|
Status: 409 Conflict
Body:
Checksum mismatch, computed SHA digest 726956f62748a7976ddb58e0ff72ae3856a0af7a did not match expected value checksumdoesntmatch |
Example (6): Uploaded file with filename Anchor post-example6 post-example6
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X POST --data-binary "@picture.jpg" -H "Content-Disposition: attachment; filename=\"picture.jpg\"" "http://localhost:8080/rest/parent" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "8695FEA5692396C39D84333EADEBC2C2"
X-State-Token: 8695FEA5692396C39D84333EADEBC2C2
Last-Modified: Thu, 04 Mar 2021 14:50:55 GMT
Link: <http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea"
Link: <http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea>; rel="timegate"
Link: <http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea>; rel="original"
Link: <http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type"
Link: <http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea
Content-Type: text/plain
Content-Length: 70
Body:
http://localhost:8080/rest/parent/ae434c08-f505-433b-b353-35e9021bd0ea |
Example (7): Creating a new binary resource using proxied external content Anchor post_proxy_file post_proxy_file
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X POST -H"Link: <http://example.org/path/to/picture.jpg>; rel=\"http://fedora.info/definitions/fcrepo#ExternalContent\"; handling=\"proxy\"; type=\"image/jpg\"" "http://localhost:8080/rest/parent" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "E77D53C833121E2930A7F057B91A8C26"
X-State-Token: E77D53C833121E2930A7F057B91A8C26
Last-Modified: Thu, 04 Mar 2021 14:59:29 GMT
Link: <http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21"
Link: <http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21>; rel="timegate"
Link: <http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21>; rel="original"
Link: <http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type"
Content-Location: http://example.org/path/to/picture.jpg
Link: <http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21
Content-Type: text/plain
Content-Length: 70
Body:
http://localhost:8080/rest/parent/42bebbb3-c0b7-425c-90c4-8584c399db21 |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Excerpt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Blue Status |
POST
Create new resources within a LDP container
Create a resource with a specified path, or replace the binary content or triples associated with a resource with the binary content or triples provided in the request body.
Request Headers:
| SLUG | (Optional) A suggested name for the new child resource, which the repository may ignore.||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Note |
|
Status subtle true title If-UNModified-Since
Allows the client to specify a state token as defined in section 3.10 of the Fedora API Status subtle true title X-If-state-token
(Optional) A way of providing one or more checksums (SHA-1, SHA-256, MD5) which will be checked against the uploaded content to ensure error-free transfer. The header is interpreted according to RFC-3230 (See see 'Example (43): Uploaded file with checksum' and 'Example (5): Uploaded file with checksum mismatch') Creating new binary resource at a specified path'). 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 Fixity Service for documentation on how to change the default algorithm used during on-demand fixity checking. Valid `Digest` algorithms/values are: sha, sha-256, sha-512, sha-512/256, or md5. Status subtle true title Digest
With the value Status subtle true title Prefer handling=lenient
allows replacing the properties of a container without having to provide all of the server-managed triples.
With a value containing subfield Status subtle true title LINK rel=http://fedora.info/definitions/fcrepo#ExternalContent
the client may provide binary content from an external path . See the external content documentation for details about syntax
and handling options (note, this is disabled by default), and Example 4 for usage. With a rel="type" and a URI of http://fedora.info/definitions/v4/repository#ArchivalGroup
the client may create an Archival Group container. See the Fedora OCFL Object Structure for more information about how this affects the OCFL structure.
With Status subtle true title OVERWRITE-TOMBSTONE overwrite-tombstone=true
, this allows the client to overwrite tombstones
Example (1):
Updating properties with RDF content
1.1 Perform a GET to the current container's RDF content
Code Block |
---|
curl -u fedoraAdmin:fedoraAdmin -X |
GET -H "Accept: text/turtle" "http://localhost:8080/rest/ |
Response:
path/to/resource" Response Body: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix fedora: <http://fedora.info/definitions/v4/repository#> . @prefix ldp: <http://www.w3.org/ns/ldp#> . <http://localhost:8080/rest |
/path/to/ |
Code Block |
---|
curl -i -X POST -H "Content-Type:text/plain" "http://localhost:8080/rest" |
Response:
Code Block |
---|
Status: 201 Created
ETag: "487f188240d2be3ae32d49958c0eeea18224be0a"
Last-Modified: Thu, 29 May 2014 15:46:13 GMT
Link: <http://localhost:8080/rest/b8/fc/32/be/b8fc32be-34be-428e-bf7c-81be97e5f2e3/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/b8/fc/32/be/b8fc32be-34be-428e-bf7c-81be97e5f2e3"
Location: http://localhost:8080/rest/b8/fc/32/be/b8fc32be-34be-428e-bf7c-81be97e5f2e3
Content-Type: text/plain
Transfer-Encoding: chunked
Body:
http://localhost:8080/rest/b8/fc/32/be/b8fc32be-34be-428e-bf7c-81be97e5f2e3 |
resource>
fedora:created "2021-03-04T14:23:46.625848Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2021-03-04T14:23:46.625848Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:createdBy "fedoraAdmin" ;
fedora:lastModifiedBy "fedoraAdmin" ;
rdf:type ldp:BasicContainer ;
rdf:type ldp:Resource ;
rdf:type fedora:Resource ;
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
rdf:type fedora:Container . |
1.2 Add your updates (e.g. <> dc:title "some-resource-title" .) under the full result of the GET response in 1.1 and PUT back
Code Block |
---|
curl -u fedoraAdmin:fedoraAdmin -i -X PUT -H "Content-Type: text/turtle" -H"Prefer: handling=lenient" --data-binary "@new-triples.rdf" " |
Code Block |
---|
curl -i -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:
ETag: "a66937ca13bc29c63f7b1a55d447a76cd8f1d573"
Location: http://localhost:8080/rest/new/node/uri
Body:
http://localhost:8080/rest/new/node/uri |
Example (4): Uploaded file with checksum
Code Block |
---|
curl -i -X POST --data-binary "@picture.jpg" -H"digest: sha=cb1a576f22e8e3e110611b616e3e2f5ce9bdb941" "http://localhost:8080/rest/parent/container" |
Response:
http://localhost:8080/rest/ |
path/ |
to/resource" Request Body: |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix fedora: <http://fedora.info/definitions/v4/repository#> . @prefix ldp: <http://www.w3.org/ns/ldp#> . <http://localhost:8080/rest/path/ |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "fe4e2bf389fe05dab6390564e40012d8d36eca19"
Location: http://localhost:8080/rest/parent/object/auto/generated/ds/id
Body:
http://localhost:8080/rest/parent/object/auto/generated/ds/id |
Example (5): Uploaded file with checksum mismatch
Code Block |
---|
curl -X POST --data-binary "@picture.jpg" -H"digest: sha=checksumdoesntmatch" "http://localhost:8080/rest/parent/object" |
Response:
Code Block |
---|
Status: 409 Conflict
Body:
Checksum Mismatch of cb1a576f22e8e3e110611b616e3e2f5ce9bdb941 and urn:sha1:checksumdoesntmatch |
Code Block |
---|
curl -i -X POST --data-binary "@picture.jpg" -H "Content-Disposition: attachment; filename=\"picture.jpg\"" "http://localhost:8080/rest/parent/container" |
Response:
Code Block |
---|
Status: 201 Created
Headers:
ETag: "fe4e2bf389fe05dab6390564e40012d8d36eca19"
Location: http://localhost:8080/rest/parent/object/auto/generated/ds/id
Body:
http://localhost:8080/rest/parent/object/auto/generated/ds/id |
to/resource>
<http://purl.org/dc/elements/1.1/title> "some-resource-title" ;
fedora:created "2021-03-04T14:23:46.625848Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2021-03-04T14:23:46.625848Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:createdBy "fedoraAdmin" ;
fedora:lastModifiedBy "fedoraAdmin" ;
rdf:type ldp:BasicContainer ;
rdf:type ldp:Resource ;
rdf:type fedora:Resource ;
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
rdf:type fedora:Container . |
Response:
Code Block |
---|
Status: 204 |
No |
Content |
Headers: ETag: W/" |
8CE776D040FAAA4641C0E44706DA6747" |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status colour Yellow title PUT
Create a resource with a specified path, or replace the binary content or triples associated with a resource with the binary content or 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. |
Request Headers:
(Optional) The filename provided in the content disposition header will be stored in a ebucore:filename property. (See 'Example (6): Uploaded file with filename' in POST above) Status subtle true title Content-Disposition
Status | ||||
---|---|---|---|---|
|
If the MIME type corresponds to a supported RDF format or SPARQL-Update, the uploaded content will be parsed as RDF and used to populate the child node properties.
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.
If the MIME type corresponds to a supported RDF format or SPARQL-Update, and you also provide a Link: <httpX-State-Token: 62D5EAC8EE143FAB049E2485BC1A4122 Last-Modified: Thu, 04 Mar 2021 15:09:20 GMT Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate" Link: <http://localhost:8080/rest/path/to/resource>; rel="original" Link: <http://localhost:8080/rest/path/to/resource/fcr:versions>; rel="timemap" Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type" Link: <http://www.w3.org/ns/ldp#Resource>; rel="type" Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type" Link: <http://www.w3.org/ns/ |
ldp#Container>; rel="type" |
Link: <http://fedora.info/definitions/v4/repository#Container>; rel="type"
Link: <http://localhost:8080/rest/path/to/resource/fcr:acl>; rel="acl" |
Note the handling=lenient
prefer header instructs the server to ignore any server managed triples in the request.
Without this prefer header the same request body would result in the following
Code Block |
---|
curl -u fedoraAdmin:fedoraAdmin -i -X PUT -H "Content-Type: text/turtle" --data-binary "@new-triples.rdf" "http://localhost:8080/rest/path/to/resource"
Status: 409 Conflict
Headers:
Content-Type: text/plain;charset=utf-8
Link: <http://localhost:8080/static/constraints/ServerManagedTypeException.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/static/constraints/ServerManagedPropertyException.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Content-Length: 1099
Body:
The server managed type ( |
For other MIME types, the uploaded content will be used to create a binary resource.
Supported RDF formats: text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/n-triples, text/html, text/plain, application/ld+json
Status subtle true title IF-Match
Status subtle true title If-UNModified-Since
(Optional) A way of providing one or more checksums (SHA-1, SHA-256, MD5) which will be checked against the uploaded content to ensure error-free transfer. The header is interpreted according to RFC-3230 (See 'Example (3): Creating new binary resource at a specified path') If the provided checksum does not match the calculated value for the uploaded file a 409 Conflict will be returned. See Fixity Service 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. Status subtle true title Digest
With the value Status subtle true title Prefer handling=lenient; received="minimal"
allows replacing the properties of a container without having to provide all of the server-managed triples.
Status | ||||
---|---|---|---|---|
|
http://fedora.info/definitions/ |
Example (1): Updating properties with RDF content
1.1 Perform a GET to the current container's RDF content
Code Block |
---|
curl -X GET -H "Accept: text/turtle" "http://localhost:8080/rest/node/to/update" Body: PREFIX dc: <http://purl.org/dc/elements/1.1/> ... PREFIX ldp: <httpv4/repository#Container) cannot be modified by the client. The server managed predicate (http://fedora.info/definitions/v4/repository#createdBy) cannot be modified by the client. The server managed predicate (http://fedora.info/definitions/v4/repository#created) cannot be modified by the client. The server managed predicate (http://fedora.info/definitions/v4/repository#lastModifiedBy) cannot be modified by the client. The server managed type (http://www.w3.org/ns/ldp#> <http://localhost:8080/rest/node/to/update> a ldp:RDFSource , ldp:Container , <http://www.jcp.org/jcr/nt/1.0folder> , <http://www.jcp.org/jcr/nt/1.0hierarchyNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0created> , fedora:Container , fedora:Resource , fedora:Resource , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified> , <http://www.jcp.org/jcr/mix/1.0referenceable> ; fedora:primaryType "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ; fedora:created "2014-11-20T16:23:31.684Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; fedora:lastModified "2014-11-20T16:23:31.684Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; fedora:mixinTypes "fedora:Containerldp#BasicContainer) cannot be modified by the client. The server managed type (http://www.w3.org/ns/ldp#Resource) cannot be modified by the client. The server managed type (http://fedora.info/definitions/v4/repository#Resource) cannot be modified by the client. The server managed predicate (http://fedora.info/definitions/v4/repository#lastModified) cannot be modified by the client. The server managed type (http://www.w3.org/ns/ldp#Container) cannot be modified by the client. The server managed type (http://www.w3.org/ns/ldp#RDFSource) cannot be modified by the client. |
Note that to prevent conflicts, the value of the fedora:lastModified
triple in the request must match its current counterpart in the repository. The way to ensure this is to base the changes in a PUT request on the RDF content obtained in an immediately prior GET request, and never try to PUT consecutively, as this will result in a 400 error.
Example (2): Creating a new resource at a specified path
Code Block |
---|
curl -i -X PUT "http://localhost:8080/rest/node/to/create" |
Response:
Code Block |
---|
Status: 201 Created Response Headers: ETag: W/"D386215480648929F3BFCA2854D9EF7E" X-State-Token: D0F20662F78E1C4D063E9512F9068785 Last-Modified: Thu, 04 Mar 2021 15:15:35 GMT Link: <http://localhost:8080/rest/node/to/create>; rel="timegate" Link: <http://localhost:8080/rest/node/to/create>; rel="original" Link: <http://localhost:8080/rest/node/to/create/fcr:versions>; rel="timemap" Link: <http"^^<http://www.w3.org/2001ns/XMLSchema#string> , "fedora:Resource"^^<httpldp#BasicContainer>; rel="type" Link: <http://www.w3.org/2001ns/XMLSchema#string> ; ... ldp#Resource>; rel="type" Link: <http://fedora.info/definitions/v4/repository#jcr/xml> rdfs:label "jcr/xml"^^<httprepository#Resource>; rel="type" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type" Link: <http://www.w3.org/2001ns/XMLSchema#string> . <http://54.173.23.104:8080/fcrepo4/rest/test1/fcr:export?format=jcr/xml> dc:format ldp#Container>; rel="type" Link: <http://fedora.info/definitions/v4/repository#jcr/xml> . |
1.2 Add your updates (e.g. <> dc:title "some-resource-title" .) under the full result of the GET response in 1.1
Code Block |
---|
curl -X PUT -H "Content-Type: text/turtle" --data-binary "@new-triples.rdf" "httprepository#Container>; rel="type" Link: <http://localhost:8080/rest/node/to/update" Request Body: PREFIX dc: <http://purl.org/dc/elements/1.1/> ... PREFIX ldp: <http://www.w3.org/ns/ldp#> <http/create/fcr:acl>; rel="acl" Location: http://localhost:8080/rest/node/to/create Content-Type: text/plain Content-Length: 41 Body: http://localhost:8080/rest/node/to/update> a ldp:RDFSource , ldp:Container , <http://www.jcp.org/jcr/nt/1.0folder> , <http://www.jcp.org/jcr/nt/1.0hierarchyNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0created> , fcrepo:Container , fcrepo:Resource , fcrepo:Resource , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified> , <http://www.jcp.org/jcr/mix/1.0referenceable> ; fcrepo:primaryType "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ; fcrepo:created "2014-11-20T16:23:31.684Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; fcrepo:lastModified "2014-11-20T16:23:31.684Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; fcrepo:mixinTypes "fedora:Container"^^<http:create |
Example (3): Creating new binary resource at a specified path Anchor put-example3 put-example3
Code Block |
---|
curl -X PUT --upload-file image.jpg -H"Content-Type: image/jpeg" -H"digest: sha=cb1a576f22e8e3e110611b616e3e2f5ce9bdb941" "http://localhost:8080/rest/new/image" |
Response:
Code Block |
---|
Status: 201 Created Headers: ETag: "DA0CCC5486A2C7E2551AAA1E528799D0" X-State-Token: DA0CCC5486A2C7E2551AAA1E528799D0 Last-Modified: Thu, 04 Mar 2021 15:16:56 GMT Link: <http://localhost:8080/rest/new/image/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/new/image" Link: <http://localhost:8080/rest/new/image>; rel="timegate" Link: <http://localhost:8080/rest/new/image>; rel="original" Link: <http://localhost:8080/rest/new/image/fcr:versions>; rel="timemap" Link: <http://www.w3.org/2001ns/XMLSchema#string> , "fedora:Resource"^^<httpldp#NonRDFSource>; rel="type" Link: <http://www.w3.org/2001ns/XMLSchema#string> ; ... ldp#Resource>; rel="type" Link: <http://fedora.info/definitions/v4/repository#jcr/xml> rdfs:label "jcr/xml"^^<http://www.w3.org/2001/XMLSchema#string> . <http://54.173.23.104:8080/fcrepo4/rest/test1/fcr:export?format=jcr/xml> dc:format <http://fedora.info/definitions/v4/repository#jcr/xml> . <> dc:title "some-resource-title" . |
Response:
Code Block |
---|
Status: 204 No Content |
Note that to prevent conflicts, the value of the fedora:lastModified
triple in the request must match its current counterpart in the repository. The way to ensure this is to base the changes in a PUT request on the RDF content obtained in an immediately prior GET request, and never try to PUT consecutively, as this will result in a 400 error.
Example (2): Creating a new resource at a specified path
Code Block |
---|
curl -i -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
Body:
http://localhost:8080/rest/node/to/create |
/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type"
Link: <http://localhost:8080/rest/new/image/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/new/image
Content-Type: text/plain
Content-Length: 36
Body:
http://localhost:8080/rest/new/image |
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:
Created (PUT to a new resource or PUT on a tombstone with the Overwrite-Tombstone header) Status subtle true colour Green title 201
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Example (4): Creating a new binary resource at a specified path redirecting to external content Anchor external-content external-content
Code Block |
---|
curl -i -u fedoraAdmin:fedoraAdmin -X PUT -H"Link: <http://www.example.com/file>; rel=\"http://fedora.info/definitions/fcrepo#ExternalContent\"; handling=\"redirect\"; type=\"text/plain\" |
Code Block |
---|
curl -X PUT --upload-file image.jpg -H"Content-Type: image/jpeg" -H"digest: sha=cb1a576f22e8e3e110611b616e3e2f5ce9bdb941" "http://localhost:8080/rest/newnode/to/imageredirect" |
Response:
Code Block |
---|
Status: 201 Created Headers: ETag: "urn:sha1:ea3d29b28522724a82de042a7b7a4e79a1653435" Last-Modified: Mon, 19 May 2014 20:55:31 GMT Location: http"D3400C2CA6018C1DC996BFBB68A65BAF" X-State-Token: D3400C2CA6018C1DC996BFBB68A65BAF Last-Modified: Thu, 04 Mar 2021 15:19:28 GMT Link: <http://localhost:8080/rest/node/to/redirect/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/node/to/redirect" Link: <http://localhost:8080/rest/node/new/image Body: httpto/redirect>; rel="timegate" Link: <http://localhost:8080/rest/new/image |
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:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Code Block |
---|
curl -X PUT -H"node/to/redirect>; rel="original" Link: <http://localhost:8080/rest/node/to/redirect/fcr:versions>; rel="timemap" Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type" Link: <http://www.examplew3.comorg/ns/file>ldp#Resource>; rel=\"http"type" Link: <http://fedora.info/definitions/v4/fcrepo#ExternalContent\"repository#Resource>; handlingrel=\"redirect\"; type=\"text/plain\"" "http://localhost:8080/rest/node/to/create" |
Response:
Code Block |
---|
Status: 201 Created Headers: ETag: "ef214795c3b9109389ffa542a6c081976e1e9587" Last-Modified: Mon, 19 May 2014 20:52:57 GMTtype" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://fedora.info/definitions/v4/repository#Binary>; rel="type" Content-Location: http://www.example.com/file Link: <http://localhost:8080/rest/node/to/createredirect/fcr:metadata>acl>; rel="describedbyacl" Location: http://localhost:8080/rest/node/to/create /redirect Content-Type: text/plain Content-Length: 43 Body: http://localhost:8080/rest/node/to/createredirect |
Excerpt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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/binary/fcr:metadata" Request Body: PREFIX fedoraconfig: <http://fedora.info/definitions/v4/config#> INSERT { <> fedoraconfig:defaultDigestAlgorithm "sha-256" } WHERE { } |
Response:
Code Block |
---|
Status: 204 No Content |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Excerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Status |
|
Code Block |
---|
curl -X DELETE "http://localhost:8080/rest/resource/to/delete" |
Response:
Code Block |
---|
Status: 204 No Content |
All child resources of a deleted resource will also be removed. Delete requests create "tombstone" resources which need to be removed or overwritten before you can reuse a URI.
Example:
Code Block |
---|
curl -X GET "http://localhost:8080/rest/some/deleted/resource" |
Code Block |
---|
Status: 410 Gone Link: <http://localhost:8080/rest/some/deleted/resource/fcr:tombstone>; rel="hasTombstone" Body: Discovered tombstone resource at /some/deleted/resource, departed: 2016-11-14T17:26:17.334-06:00 |
Code Block |
---|
curl -X DELETE "http://localhost:8080/rest/some/deleted/resource/fcr:tombstone" |
Code Block |
---|
Status: 204 No Content |
Create a new node and reuse the deleted URL
Code Block |
---|
curl -X PUT "http://localhost:8080/rest/some/deleted/resource" |
Code Block |
---|
Status: 201 Created |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Statussubtle true colour Green title HEAD
Retrieve the resource headers
subtle | true |
---|---|
colour | Green |
title | HEAD |
Example:
Code Block |
---|
curl -u fedoraAdmin:fedoraAdmin -i -X HEAD "http -X HEAD "http://localhost:8080/rest/resource/to/head" |
Response:
Code Block |
---|
Status: 200 OK Headers: ETag: W/"8CE776D040FAAA4641C0E44706DA6747" X-State-Token: 62D5EAC8EE143FAB049E2485BC1A4122 Last-Modified: Thu, 04 Mar 2021 15:09:20 GMT Link: <http://localhost:8080/rest/path/to/resource>; rel="timegate" Link: <http://localhost:8080/rest/path/to/resource>; rel="original" Link: <http://localhost:8080/rest/resourcepath/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/resource/fcr:versions>; rel="timemap" Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type" Link: <http://www.w3.org/ns/ldp#Resource>; rel="type" Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type" Link: <http://mementoweb.org/ns#OriginalResource>; rel="type" Link: <http://mementoweb.org/ns#TimeGate>; rel="type" Link: <http://www.w3.org/ns/ldp#Resource>ldp#RDFSource>; rel="type" Link: <http://www.w3.org/ns/ldp#Container>; rel="type" Link: <http://www.w3.org/ns/ldp#BasicContainer>;fedora.info/definitions/v4/repository#Container>; rel="type" Accept-External-Content-Handling: copy,redirect,proxy 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-updateld+json Allow: MOVE,COPY, DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Example:
Link: <http://localhost:8080/rest/ |
path/to |
Response:
/resource/fcr:acl>; rel="acl"
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Vary: Accept-Datetime
Content-Type: text/turtle;charset=utf-8
Content-Length: 0 |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||||
---|---|---|---|---|---|---|---|---|
|
Excerpt | |||||
---|---|---|---|---|---|
| |||||
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)
...
|
Code Block |
---|
curl -i -X |
...
Response:
|
...
|
...
|
...
Response:
...
|
...
|
...
Example (2):
Code Block |
---|
curl -X MOVE "http://localhost:8080/rest/path/to/resource" |
Response:
Code Block |
---|
Status: 502 Bad Gateway |
Status:
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status subtle true colour Blue title COPY
Copy a resource (and its subtree) to a new location
subtle | true |
---|---|
colour | Blue |
title | COPY |
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:
...
Status:
|
...
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
Status | ||||||
---|---|---|---|---|---|---|
|
...
|