Versions Compared

Key

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

...

Request URI: /fcr:sparql

Methods: GET

Warning

SPARQL query functionality is experimental and is not yet in any fcrepo4 release.

 

Status
titleGETPOST
HTML form for submitting SPARQL queries

...

Status
subtletrue
titleAccept
 text/html

 

 

text/tab-separated-values, text/csv, text/sse, text/plain, application/sparql-results+json, application/sparql-results+xml, application/sparql-results+bio, text/turtle, text/rdf+n3, application/n-triples, application/rdf+xml

 

StatuscolourBluetitlePOST execute a query using a subset of SPARQLExample:

Code Block
curl -X POST -H "Accept:text/csv" -H "Content-Type: application/sparql-query" -d @sparqlQuery"@sparql-query.txt -H "Accept: " "http://localhost:8080/rest/fcr:sparql"
 
Body:

sparql-query.txt

SELECT ?subject FROM <> x ?uuid
WHERE { ?subjectx dc:title<http://fedora.info/definitions/v4/repository#uuid> ?titleuuid }

 

Response:

 

Code Block
Status: 200
 
Headers:
Content-Type: text/turtle
 
Body:

Status:

languagetext
POST /rest/fcr:sparql HTTP/1.1
> Accept: */*
> Content-Type:application/sparql-query
> Content-Length: 85
> 
* upload completely sent off: 85 out of 85 bytes
< HTTP/1.1 200 OK
< Content-Type: text/tab-separated-values

?x
<http://localhost:8080/rest/07/e4/22/ef/07e422ef-8561-4300-91a4-fff4086c8be0>
<http://localhost:8080/rest/f3/e2/41/f8/f3e241f8-b0b0-4274-95e7-4d58a7af9dca>

 


Status:

Status
Status
subtletrue
colourGreen
title200
 OK

Status
subtletrue
colourRed
title400
 Bad Request

Transform

Request URI: /fcr:transform/{program}

Methods: GET, POST

Status
titleGET
get a resource transformed with the default transform

415
Unsupported Media Type

 

...

 

Status
colourBlue
titlePOST
 execute a query using a subset of SPARQLRequest Headers:

Example:

Code Block
titledefault transform
@prefix fcrepo : <http://fedora.info/definitions/v4/repository#>
id      = . :: xsd:string ;
title = dc:title :: xsd:string;
uuid = fcrepo:uuid :: xsd:string ; 
Code Block
curl http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:transform/default
curl -H "Content-Type: application/sparql-query" -d @sparqlQuery.txt -H "Accept: " "http://localhost:8080/rest/fcr:sparql"
 
Body:
SELECT ?subject FROM <> WHERE { ?subject dc:title ?title }

Response:

Code Block
Status: 200 OK
 
Headers:

Content-Type: applicationtext/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

Body:

[{"id":["http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f"],"title":[],"uuid":["07630a24-5a0b-4ba7-80ab-0691f68667ce"]}]turtle
 
Body:

Status:

Status
subtletrue
colourGreen
title200
 OK

Status
subtletrue
colourRed
title400
 Bad Request

Transform

Request URI:  /fcr:transform/{program}

Methods: GET, POST

Status
colourBlue
title
POST
GET
get a resource transformed with the supplied default transform

Output formats: application/json,text/tab-separated-values,text/csv,text/sse,text/plain,application/sparql-results+json,application/sparql-results+xml,application/sparql-results+bio,text/turtle,text/rdf+n3,application/N-triples,application/rdf_xml

Example:

Request Headers:

Example:

Code Block
titledefault transform
Code Block
curl -X POST -H "Content-Type: application/rdf+ldpath" -d "@post.txt" "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:transform"

Body:
@prefix fcrepo : <http://fedora.info/definitions/v4/repository#>
id      = . :: xsd:string ;
title = dc:title :: xsd:string;
uuid = fcrepo:uuid :: xsd:string ; 

Response:


Code Block
curl http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:transform/default

Response:

Code Block
Status: 200 OK

Headers:

Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

Body:

[{"id":["http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f"],"title":[],"uuid":["07630a24-5a0b-4ba7-80ab-0691f68667ce"]}]

...

Status
subtletrue
colourRed
title400
 Bad Request

...

 

...

Request URI: /path/to/some/resource/fcr:accessroles

Methods: GET, POST, DELETE

Warning

Arbitrary access roles may be set through this API. However, they are only enforced when paired with a Policy Enforcement Point that is aware of access roles.

Status
colourBlue
titlePOST
get a resource transformed with the supplied transform
Status
titleGET
 
Get a list of all the roles assigned to principals on this resource

Output formats: application/json

Query Parameters:

Status
subtletrue
titleeffective
  When supplied, gets the list of effective roles for this resource, including those inherited from the parent,text/tab-separated-values,text/csv,text/sse,text/plain,application/sparql-results+json,application/sparql-results+xml,application/sparql-results+bio,text/turtle,text/rdf+n3,application/N-triples,application/rdf_xml

Example:

Code Block
curl -X POST -H "Content-Type: application/rdf+ldpath" -d "@post.txt" "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessrolestransform"

Response:

Body:
@prefix fcrepo : <http://fedora.info/definitions/v4/repository#>
id      = . :: xsd:string ;
title = dc:title :: xsd:string;
uuid = fcrepo:uuid :: xsd:string ;

Response:

Code Block
Status: 200 OK

Headers:

Content-Type: application/json
Code Block
Status: 200 OK

Headers:
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

Body:

[{"principal name 3id":["adminhttp://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f"],"principal name 1title":["reader"],"principal name 2uuid":["writer07630a24-5a0b-4ba7-80ab-0691f68667ce"]}]

Status:

Status
subtletrue
colourGreen
title200
 OK

Status
subtletrue
colourGreenRed
title204
No Content

 

400
 Bad Request

Access Roles

Request URI: /path/to/some/resource/fcr:accessroles

Methods: GET, POST, DELETE

Warning

Arbitrary access roles may be set through this API. However, they are only enforced when paired with a Policy Enforcement Point that is aware of access roles.

Status
titleGET
 Get a list of all the roles assigned to principals on this resource

Output formats: application/json

Query Parameters StatuscolourBluetitlePOSTSet the roles assigned on this resourceRequest Headers:

Status
subtletrue
titleContent-Type
  application/json
effective
  When supplied, gets the list of effective roles for this resource, including those inherited from the parent

Example:

Code Block
curl -X POST -H "Content-Type: application/json" -d "@post.txt" "http://"http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles"

Body:
{
   

Response:

Code Block
Status: 200 OK

Headers:
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

Body:

{"principal name 13" : [ "readeradmin" ],
   "principal name 21" : [ "writerreader" ],
   "principal name 32" : [ "adminwriter" ]}
}

Response:

Code Block
Status: 201 Created

Headers:

Location: http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles
Content-Length: 0
Server: Jetty(8.1.11.v20130520)

Status:

Status:

Status
subtletrue
colourGreen
title200
 OK

Status
Status
subtletrue
colourGreen
title204201
No Content Created

...

 

Status
subtletrue
colour
Red
Blue
title
400 Bad Request
POST
Set the roles assigned on this resource

Request Headers: 

Status
colour
subtle
Red
true
title
DELETE
Content-Type
  application/json Clear all roles assignments from this resource

Example:

Code Block
curl -X DELETE POST -H "Content-Type: application/json" -d "@post.txt" "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles"

Response:

Body:
{
   "principal name 1" : [ "reader" ],
   "principal name 2" : [ "writer" ],
   "principal name 3" : [ "admin" ]
}

Response:

Code Block
Status: 204201 No ContentCreated

Headers:

Location: http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles
Content-Length: 0
Server: Jetty(8.1.11.v20130520)

...

Status
subtletrue
colourGreen
title201
Created

Status
subtletrue
colourRed
title204
No Content
400
Bad Request

...

 

Status
colourRed
titleDELETE
Clear all roles assignments from this resource

Example:

Code Block
curl -X DELETE "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles"

Response:

Code Block
Status: 204 No Content

Headers: 
Server: Jetty(8.1.11.v20130520)

Status:

Status
subtletrue
colourGreen
title204
No Content

?x
<http://localhost:8080/rest/pid:1/pid:2>
<http://localhost:8080/rest/pid:1>
<http://localhost:8080/rest/TEST>
<http://localhost:8080/rest/TEST/testds>
<http://localhost:8080/rest/test3>
<http://localhost:8080/rest/test3/n1>
<http://localhost:8080/rest/test5/00/f6/00/80/00f60080-e42e-4ccd-b06d-db565b997b3e>
<http://localhost:8080/rest/test5>
<http://localhost:8080/rest/test6/07/e4/22/ef/07e422ef-8561-4300-91a4-fff4086c8be0>
<http://localhost:8080/rest/test6/f3/e2/41/f8/f3e241f8-b0b0-4274-95e7-4d58a7af9dca>
<http://localhost:8080/rest/test6>
<http://localhost:8080/rest/2c/42/54/8a/2c42548a-0d00-4663-b103-21d0077e27b3>
<http://localhost:8080/rest/2c/42/54/8a/2c42548a-0d00-4663-b103-21d0077e27b3/ds1>
<http://localhost:8080/rest/withMixin>