Skip to content

Instantly share code, notes, and snippets.

@bmaddy
Created February 18, 2014 16:01
Show Gist options
  • Save bmaddy/9073793 to your computer and use it in GitHub Desktop.
Save bmaddy/9073793 to your computer and use it in GitHub Desktop.
bmaddy@foo:~/src/sandbox/2014/fedora_lens[master]$ curl -X GET -H "Content-Type: text/turtle" "http://localhost:8080/rest/node/to/update"
<http://localhost:8080/rest/node/to/update> <http://fedora.info/definitions/v4/rest-api#hasAccessRoles> <http://localhost:8080/rest/node/to/update/fcr:accessroles> .
<http://localhost:8080/rest/node/to/update/fcr:export?format=jcr/xml> <http://www.w3.org/2000/01/rdf-schema#label> "jcr/xml"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://localhost:8080/rest/node/to/update> <http://fedora.info/definitions/v4/rest-api#exportsAs> <http://localhost:8080/rest/node/to/update/fcr:export?format=jcr/xml> ;
<http://fedora.info/definitions/v4/rest-api#hasVersions> <http://localhost:8080/rest/node/to/update/fcr:versions> ;
<http://www.w3.org/ns/ldp#nextPage> <http://localhost:8080/rest/node/to/update?limit=-1&amp;offset=-1> ;
<http://www.w3.org/ns/ldp#firstPage> <http://localhost:8080/rest/node/to/update?limit=-1&amp;offset=0> ;
<http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/node/to/update/86> .
<http://localhost:8080/rest/node/to/update/86> <http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/node/to/update> .
<http://localhost:8080/rest/node/to/update> <http://fedora.info/definitions/v4/repository#hasChild> <http://localhost:8080/rest/node/to/update/86> .
<http://localhost:8080/rest/node/to/update/86> <http://fedora.info/definitions/v4/repository#primaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#created> "2014-02-17T22:17:55.28Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://localhost:8080/rest/node/to/update> <http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/node/to/update/3e> .
<http://localhost:8080/rest/node/to/update/3e> <http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/node/to/update> .
<http://localhost:8080/rest/node/to/update> <http://fedora.info/definitions/v4/repository#hasChild> <http://localhost:8080/rest/node/to/update/3e> .
<http://localhost:8080/rest/node/to/update/3e> <http://fedora.info/definitions/v4/repository#primaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#created> "2014-02-17T22:19:57.992Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://localhost:8080/rest/node/to/update> <http://www.w3.org/ns/ldp#membersInlined> "true"^^<http://www.w3.org/2001/XMLSchema#string> ;
a <http://www.w3.org/ns/ldp#Container> ;
<http://www.w3.org/ns/ldp#membershipSubject> <http://localhost:8080/rest/node/to/update> ;
<http://www.w3.org/ns/ldp#membershipPredicate> <http://fedora.info/definitions/v4/repository#hasChild> ;
<http://www.w3.org/ns/ldp#membershipObject> <http://www.w3.org/ns/ldp#MemberSubject> ;
a <http://www.w3.org/ns/ldp#Page> ;
<http://www.w3.org/ns/ldp#pageOf> <http://localhost:8080/rest/node/to/update> ;
<http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/node/to> .
<http://localhost:8080/rest/node/to> <http://fedora.info/definitions/v4/repository#hasChild> <http://localhost:8080/rest/node/to/update> .
<http://localhost:8080/rest/node/to/update> <http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/node/to> .
<http://localhost:8080/rest/node/to> <http://fedora.info/definitions/v4/repository#primaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#created> "2014-02-04T01:59:02.242Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://localhost:8080/rest/node/to/update> a <http://fedora.info/definitions/v4/rest-api#resource> , <http://fedora.info/definitions/v4/rest-api#object> ;
<http://fedora.info/definitions/v4/repository#primaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://purl.org/dc/elements/1.1/title> "some-resource-title"^^<http://www.w3.org/2001/XMLSchema#string> , "a new title"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#created> "2014-02-04T01:59:02.242Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#versionHistory> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/9b/e0/ec/9be0eca8318518d305dde3151233904638129868> ;
<http://fedora.info/definitions/v4/repository#lastModified> "2014-02-17T22:19:57.992Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#baseVersion> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/9b/e0/ec/9be0eca8318518d305dde3151233904638129868/jcr:rootVersion> ;
<http://fedora.info/definitions/v4/repository#predecessors> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/9b/e0/ec/9be0eca8318518d305dde3151233904638129868/jcr:rootVersion> ;
<http://fedora.info/definitions/v4/repository#isCheckedOut> "true"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#mixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#lastModifiedBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#uuid> "56e8942d-ceb5-4f37-b2d6-a0cf61831216"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://purl.org/dc/elements/1.1/relation> "<relationships><relationship type='primary'>/rest/ee/89/7e/53/ee897e53-7953-4208-bee7-08c76379fce8</relationship><relationship type='secondary'>/rest/ee/89/7e/53/ee897e53-7953-4208-bee7-08c76379fce8/e8/dc/a6/cc/e8dca6cc-cdb0-4b27-b3d5-fbae6b6d91b4</relationship></relationships>"^^<http://www.w3.org/2001/XMLSchema#string> ;
<http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
a <http://fedora.info/definitions/v4/rest-api#resource> , <http://fedora.info/definitions/v4/rest-api#object> .
bmaddy@foo:~/src/sandbox/2014/fedora_lens[master]$ cat update.rdf
<http://localhost:8080/rest/node/to/update/fcr:export?format=jcr/xml> <http://www.w3.org/2000/01/rdf-schema#label> "jcr/xml" .
<http://localhost:8080/rest/node/to/update> a <http://www.w3.org/ns/ldp#Container>,
<http://www.w3.org/ns/ldp#Page>,
<http://fedora.info/definitions/v4/rest-api#resource>,
<http://fedora.info/definitions/v4/rest-api#object>;
<http://fedora.info/definitions/v4/repository#baseVersion> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/9b/e0/ec/9be0eca8318518d305dde3151233904638129868/jcr:rootVersion>;
<http://fedora.info/definitions/v4/repository#created> "2014-02-04T01:59:02.242Z";
<http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin";
<http://fedora.info/definitions/v4/repository#hasParent> <http://localhost:8080/rest/node/to>;
<http://fedora.info/definitions/v4/repository#isCheckedOut> "true";
<http://fedora.info/definitions/v4/repository#lastModified> "2014-02-04T01:59:01.504Z";
<http://fedora.info/definitions/v4/repository#lastModifiedBy> "bypassAdmin";
<http://fedora.info/definitions/v4/repository#mixinTypes> "fedora:resource",
"fedora:object";
<http://fedora.info/definitions/v4/repository#predecessors> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/9b/e0/ec/9be0eca8318518d305dde3151233904638129868/jcr:rootVersion>;
<http://fedora.info/definitions/v4/repository#primaryType> "nt:folder";
<http://fedora.info/definitions/v4/repository#uuid> "56e8942d-ceb5-4f37-b2d6-a0cf61831216";
<http://fedora.info/definitions/v4/repository#versionHistory> <http://localhost:8080/rest/jcr:system/jcr:versionStorage/9b/e0/ec/9be0eca8318518d305dde3151233904638129868>;
<http://fedora.info/definitions/v4/rest-api#exportsAs> <http://localhost:8080/rest/node/to/update/fcr:export?format=jcr/xml>;
<http://fedora.info/definitions/v4/rest-api#hasAccessRoles> <http://localhost:8080/rest/node/to/update/fcr:accessroles>;
<http://fedora.info/definitions/v4/rest-api#hasVersions> <http://localhost:8080/rest/node/to/update/fcr:versions>;
<http://purl.org/dc/elements/1.1/relation> "<relationships><relationship type='primary'>/rest/ee/89/7e/53/ee897e53-7953-4208-bee7-08c76379fce8</relationship><relationship type='secondary'>/rest/ee/89/7e/53/ee897e53-7953-4208-bee7-08c76379fce8/e8/dc/a6/cc/e8dca6cc-cdb0-4b27-b3d5-fbae6b6d91b4</relationship></relationships>";
<http://purl.org/dc/elements/1.1/title> "a new title";
<http://www.w3.org/ns/ldp#firstPage> <http://localhost:8080/rest/node/to/update?limit=-1&amp;offset=0>;
<http://www.w3.org/ns/ldp#inlinedResource> <http://localhost:8080/rest/node/to>;
<http://www.w3.org/ns/ldp#membersInlined> "true";
<http://www.w3.org/ns/ldp#membershipObject> <http://www.w3.org/ns/ldp#MemberSubject>;
<http://www.w3.org/ns/ldp#membershipPredicate> <http://fedora.info/definitions/v4/repository#hasChild>;
<http://www.w3.org/ns/ldp#membershipSubject> <http://localhost:8080/rest/node/to/update>;
<http://www.w3.org/ns/ldp#nextPage> <http://localhost:8080/rest/node/to/update?limit=-1&amp;offset=-1>;
<http://www.w3.org/ns/ldp#pageOf> <http://localhost:8080/rest/node/to/update> .
bmaddy@foo:~/src/sandbox/2014/fedora_lens[master]$ curl -X PUT -H "Content-Type: text/turtle" "http://localhost:8080/rest/node/to/update" -d "@update.rdf"
org.fcrepo.kernel.exception.MalformedRdfException: Could not persist triple containing type assertion:http://www.w3.org/ns/ldp#Container because no such mixin/type can be found in the repository!
at org.fcrepo.kernel.utils.iterators.RdfAdder.operateOnMixin(RdfAdder.java:79)
at org.fcrepo.kernel.utils.iterators.PersistingRdfStreamConsumer.operateOnTriple(PersistingRdfStreamConsumer.java:133)
at org.fcrepo.kernel.utils.iterators.PersistingRdfStreamConsumer.consume(PersistingRdfStreamConsumer.java:116)
at org.fcrepo.kernel.FedoraResource.replaceProperties(FedoraResource.java:397)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment