Skip to content

Instantly share code, notes, and snippets.

@escowles
Created February 10, 2018 12:06
Show Gist options
  • Select an option

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

Select an option

Save escowles/e6d09cab84d2c8d8e9042f3f8bcc4f0d to your computer and use it in GitHub Desktop.
#!/bin/sh
# create a basic container
curl -X PUT http://localhost:8080/rest/basic
# create an indrect container with ldp:contains as the membership resource
curl -X PUT -H "Content-type: text/turtle" -d "<> a <http://www.w3.org/ns/ldp#IndirectContainer>; <http://www.w3.org/ns/ldp#membershipResource> <http://localhost:8080/rest/basic>; <http://www.w3.org/ns/ldp#hasMemberRelation> <http://www.w3.org/ns/ldp#contains>; <http://www.w3.org/ns/ldp#insertedContentRelation> <http://www.openarchives.org/ore/terms/proxyFor> ." http://localhost:8080/rest/basic/indirect
# create a member
curl -X POST -H "Content-type: text/turtle" -d "<> <http://www.openarchives.org/ore/terms/proxyFor> <http://localhost:8080/rest> ." http://localhost:8080/rest/basic/indirect/
# get without containment (only ldp:contains /rest is present)
curl -H "Prefer: return=representation; omit=\"http://www.w3.org/ns/ldp#PreferContainment\"" http://localhost:8080/rest/basic
# get without membership (only ldp:contains /rest/basic/indirect is present)
curl -H "Prefer: return=representation; omit=\"http://www.w3.org/ns/ldp#PreferMembership\"" http://localhost:8080/rest/basic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment