Versions Compared

Key

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

...

Describe the root Object of the Repository

Code Block
languagebash
curl -X GET http://localhost:8080/rest

Get the Response as "application/rdf+json" rather than the default "application/n3"

Code Block
languagebash
curl -H "Accept:application/rdf+json" -X GET http://localhost:8080/rest

You can get responses in the following format's:

  • application/n3 (or text/rdf+n3 or text/n3)
  • text/turtle
  • application/n-triples
  • application/rdf+xml
  • application/rdf+json

Create a new Object "test" as a child of the root Object

Code Block
languagebash
curl -X POST http://localhost:8080/rest/test?mixin=fedora:object

Now that Object "test" exists we can create a child of "test" using the same command

Code Block
languagebash
curl -X POST http://localhost:8080/rest/test?mixin=fedora:object

Ingest a Data-stream

Code Block
languagebash
echo "Test Datastream" > test_datastream.txt

...


curl -d @test_datastream.txt -X POST http://localhost:8080/rest/test/test_datastream\?mixin\=fedora:datastream

Get a Data-streams content

Code Block
languagebash
curl -X GET http://localhost:8080/rest/test/test_datastream/fcr:content



Purge a Data-stream

curl -X DELETE http://localhost:8080/rest/test/test_datastream

Add a new property to the "test" Object

echo "PREFIX dc: <http://purl.org/dc/elements/1.1/> INSERT DATA { <http://localhost:8080/rest/test> dc:title 'Test Title' }" > query.txt
curl -d @query.txt -H "Content-Type: application/sparql-update" -X PATCH http://localhost:8080/rest/test/

Please refer to https://wiki.duraspace.org/display/FF/REST+API for more information on what can be done with the REST API and cURL.
And checkout https://wiki.duraspace.org/display/FF/Object+properties+and+SPARQL-UPDATE for how to use the SPARQL update in greater detail.

...