Versions Compared

Key

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

...

The text/html response also includes embedded RDFa markup.

...

 

Asynchronous API support

Versioning

CND node types

Changelog

 

Endpoints

 

Resources

 

Objects

 

Request URI: /path/to/some/resource

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

 

 

Status
titleGET
  Retrieve all triples for the resource

Query Parameters:

Status
subtletrue
titlenon-member-properties
 By default, we include triples for all member resources, in addition to triples about the given node. Setting this to true will exclude member resources from the result.

Status
subtletrue
titleoffset
 Pagination control for member resources

Status
subtletrue
titleLIMIT
 Pagination control for member resources

 

Request Headers:

Status
subtletrue
titleAccept
  text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/json+rdf, application/n-triples, text/html

 

Example:

Code Block
curl -H "Accept: text/turtle" "http://localhost:8080/rest/"

Response:

The REST API is based loosely around the Linked Data Platform 1.0 Architecture, which:

[...] describes the use of HTTP for accessing, updating, creating and deleting resources from servers that expose their resources as Linked Data.  It provides clarifications and extensions of the rules of Linked Data [LINKED-DATA]:

  1. Use URIs as names for things
  2. Use HTTP URIs so that people can look up those names
  3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL)
  4. Include links to other URIs, so that they can discover more things

 

Changes planned

Asynchronous API support

Versioning

CND node types

Changelog

 

Endpoints

 

Resources

Repository objects can be loosely divided into two classes of resources:

 - Object and containers ("fedora:object"), containing RDF properties and 0 or more child nodes
 - Binaries, containing any binary payload

 

Objects

Request URI: /path/to/some/resource

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

 

...

 

Status
titleGET
  Retrieve all triples for the resource

Query Parameters:

Status
subtletrue
titlenon-member-properties
 By default, we include triples for all member resources, in addition to triples about the given node. Setting this to true will exclude member resources from the result.

Status
subtletrue
titleoffset
 Pagination control for member resources

Status
subtletrue
titleLIMIT
 Pagination control for member resources

 

Request Headers:

Status
subtletrue
titleAccept
  text/turtle, text/rdf+n3, application/n3, text/n3, application/rdf+xml, application/json+rdf, application/n-triples, text/html

Status
subtletrue
titleIf-None-Match
Status
subtletrue
titleIf-Modified-Since

Example (1):

Code Block
curl -H "Accept: text/turtle" "http://localhost:8080/rest/"

Response:

Code Block
Status: 200 OK
 
Headers:
Content-Type: text/turtle
Cache-Control: 
Last-Modified-At: 2013-01-01T01:23:45Z
Link: http://localhost:8080/rest/?offset=0&limit=10;rel="first"
Link: http://www.w3.org/ns/ldp/Resource;rel="type"
Accept-Patch: application/sparql-update
 
Body:

<http://localhost:8080/rest/>
        a       <http://www.w3.org/ns/ldp#Container> , <http://www.w3.org/ns/ldp#Page> ;
        <http://www.w3.org/ns/ldp#membersInlined>
                "true" ;
        <http://www.w3.org/ns/ldp#membershipObject>
                <http://www.w3.org/ns/ldp#MemberSubject> ;
        <http://www.w3.org/ns/ldp#membershipPredicate>
                <http://fedora.info/definitions/v4/repository#hasChild> ;
        <http://www.w3.org/ns/ldp#membershipSubject>
                <http://localhost:8080/rest/> ;
        <http://www.w3.org/ns/ldp#pageOf>
                <http://localhost:8080/rest/> ;
		<http://fedora.info/definitions/v4/rest-api#exportsAs>
                <http://localhost:8080/rest//fcr:export?format=jcr/xml> ;
        <http://fedora.info/definitions/v4/rest-api#hasNamespaces>
                <http://localhost:8080/rest/fcr:namespaces> ;
        <http://fedora.info/definitions/v4/rest-api#hasTransactionProvider>
                <http://localhost:8080/rest/fcr:tx> ;
        <http://fedora.info/definitions/v4/rest-api#hasWorkspaces>
                <http://localhost:8080/rest/fcr:workspaces> ;
        <http://microformats.org/wiki/rel-sitemap>
                <http://localhost:8080/rest/sitemap> ;


Example (2):

Code Block
curl -H "Accept: text/turtle" "http://localhost:8080/rest/path/to/resource"

Response:

Code Block
Status: 200 OK
 
Headers:
ETag: "d98e86c48a3e31857f5311f51ad7a2e13a7cedee"
Content-Type: text/turtle
Cache-Control: must-revalidate
Last-Modified: Fri, 15 Nov 2013 23:31:07 +0000
Link: http://localhost:8080/rest/path/to/resource/?offset=0&limit=10;rel="first"
Link: http://www.w3.org/ns/ldp/Resource;rel="type"
Accept-Patch: application/sparql-update
 
Body:

<http://localhost:8080/rest/path/to/resource>
		a       <http://fedora.info/definitions/v4/rest-api#resource> , <http://fedora.info/definitions/v4/rest-api#object> , 		
				<http://www.w3.org/ns/ldp#Container> , <http://www.w3.org/ns/ldp#Page> ;
        <http://fedora.info/definitions/v4/repository#uuid>
                "e8baa85c-f05a-49e8-9578-9adef92ac60d"^^<http://www.w3.org/2001/XMLSchema#string> ;
        <http://www.w3.org/ns/ldp#inlinedResource>
                <http://localhost:8080/rest/path/to> ;
        <http://www.w3.org/ns/ldp#membersInlined>
                "true" ;
        <http://www.w3.org/ns/ldp#pageOf>
                <http://localhost:8080/rest/path/to/resource> .
        <http://fedora.info/definitions/v4/rest-api#exportsAs>
                <http://localhost:8080/rest/path/to/resource/fcr:export?format=jcr/xml> ;
        <http://fedora.info/definitions/v4/rest-api#hasVersions>
                <http://localhost:8080/rest/path/to/resource/fcr:versions> ;
        <http://fedora.info/definitions/v4/repository#created>
                "2013-11-15T23:31:07.275Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        <http://fedora.info/definitions/v4/repository#createdBy>
                "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        <http://fedora.info/definitions/v4/repository#hasParent>
                <http://localhost:8080/rest/path/to> ;
        <http://fedora.info/definitions/v4/repository#lastModified>
                "2013-11-15T23:31:07.268Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
Code Block
Status: 200
 
Headers:
ETag: "686897696a7c876b7e"
Content-Type: text/turtle
Content-Length: 123456
Cache-Control: 
Last-Modified-At: 2013-01-01T01:23:45Z
Link: http://localhost:8080/rest/?offset=0&limit=10;rel="first"
Link: http://www.w3.org/ns/ldp/Resource;rel="type"
Accept-Patch: application/sparql-update
 
Body:
<x> <y> <z>


Status:

Status
subtletrue
colourGreen
title200
  OK

Status
subtletrue
colourYellow
title304
 Not Modified

Status
subtletrue
colourRed
title404
 Not Found

 

...

 

Status
colourBlue
titlePOST
 Create a new node at the given path

...