Skip to content

Instantly share code, notes, and snippets.

@escowles
Created November 11, 2013 16:34
Show Gist options
  • Save escowles/7416103 to your computer and use it in GitHub Desktop.
Save escowles/7416103 to your computer and use it in GitHub Desktop.
SPARQL Update example using curl
#!/bin/sh
# create collection object
curl -X POST http://localhost:8080/rest/objects/col1?mixin=fedora:object
echo
# create work object
curl -X POST http://localhost:8080/rest/objects/work1?mixin=fedora:object
echo
# link work to collection
echo "insert data { <http://localhost:8080/rest/objects/work1> <http://fedora.info/definitions/v4/rels-ext#isMemberOfCollection> <http://localhost:8080/rest/objects/col1> . }" | curl -X PATCH --upload-file - http://localhost:8080/rest/objects/work1
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment