Skip to content

Instantly share code, notes, and snippets.

@escowles
Created June 9, 2017 18:12
Show Gist options
  • Select an option

  • Save escowles/29ab8f71ce39072ca12deb2ec11c4bd2 to your computer and use it in GitHub Desktop.

Select an option

Save escowles/29ab8f71ce39072ca12deb2ec11c4bd2 to your computer and use it in GitHub Desktop.
#!/bin/sh
BASE=http://localhost:8080/rest/$RANDOM
# create some basic containers
curl -X PUT $BASE/1 && echo
curl -X PUT $BASE/2 && echo
# create indirect container /1/members
curl -i -X PUT -H "Content-Type: text/turtle" --data-binary "
@prefix ore: <http://www.openarchives.org/ore/terms/> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix pcdm: <http://pcdm.org/models#> .
<> a ldp:IndirectContainer ;
ldp:hasMemberRelation <http://fedora.info/definitions/v4/repository#lastModified> ;
ldp:insertedContentRelation ore:proxyFor ;
ldp:membershipResource <$BASE/1> . " $BASE/1/members && echo
# create proxy for /2
curl -i -X POST -H "Content-type: text/turtle" --data-binary "
@prefix ore: <http://www.openarchives.org/ore/terms/> .
<> a ore:Proxy ;
ore:proxyFor <$BASE/2> ;
ore:proxyIn <$BASE/1> ." $BASE/1/members && echo
# retrieve membership resource and observer triple <$BASE/1> fedora:lastModified <$BASE/2>
curl -i $BASE/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment