Skip to content

Instantly share code, notes, and snippets.

@zimeon
Created January 5, 2018 18:53
Show Gist options
  • Save zimeon/a4b02fe70b4f3fba0f07681f2422021a to your computer and use it in GitHub Desktop.
Save zimeon/a4b02fe70b4f3fba0f07681f2422021a to your computer and use it in GitHub Desktop.
Shell session creating LDP-NR with fcrepo4 and inspecting results
simeon@RottenApple ~> curl -i -X POST -H "Content-Type: text/plain" -H "Slug: a" http://localhost:8080/rest --data "hello"
HTTP/1.1 201 Created
Date: Fri, 05 Jan 2018 18:49:14 GMT
ETag: "36d0d1ed6ee9c7d7cad5b5d2970f3f6c490c5857"
Last-Modified: Fri, 05 Jan 2018 18:49:14 GMT
Link: <http://localhost:8080/rest/a/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/a"
Location: http://localhost:8080/rest/a
Content-Type: text/plain
Content-Length: 28
Server: Jetty(9.2.3.v20140905)
http://localhost:8080/rest/a
simeon@RottenApple ~> curl -i http://localhost:8080/rest/a
HTTP/1.1 200 OK
Date: Fri, 05 Jan 2018 18:49:20 GMT
ETag: "36d0d1ed6ee9c7d7cad5b5d2970f3f6c490c5857"
Last-Modified: Fri, 05 Jan 2018 18:49:14 GMT
Content-Type: text/plain
Accept-Ranges: bytes
Content-Disposition: attachment; filename=""; creation-date="Fri, 05 Jan 2018 18:49:14 GMT"; modification-date="Fri, 05 Jan 2018 18:49:14 GMT"; size=5
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
Link: <http://localhost:8080/rest/a/fcr:metadata>; rel="describedby"
Allow: DELETE,HEAD,GET,PUT,OPTIONS
ETag: "36d0d1ed6ee9c7d7cad5b5d2970f3f6c490c5857"
Last-Modified: Fri, 05 Jan 2018 18:49:14 GMT
Cache-Control: no-transform, must-revalidate, max-age=0
Content-Length: 5
Server: Jetty(9.2.3.v20140905)
hello
simeon@RottenApple ~> curl -i http://localhost:8080/rest/a/fcr:metadata
HTTP/1.1 200 OK
Date: Fri, 05 Jan 2018 18:49:35 GMT
ETag: W/"36d0d1ed6ee9c7d7cad5b5d2970f3f6c490c5857"
Last-Modified: Fri, 05 Jan 2018 18:49:14 GMT
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>;rel="type"
Link: <http://localhost:8080/rest/a>; rel="describes"
Accept-Patch: application/sparql-update
Allow: HEAD,GET,DELETE,PUT,PATCH,OPTIONS
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept, Range, Accept-Encoding, Accept-Language
Content-Type: text/turtle;charset=utf-8
Content-Length: 2038
Server: Jetty(9.2.3.v20140905)
@prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
@prefix test: <info:fedora/test/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsi: <http://www.w3.org/2001/XMLSchema-instance> .
@prefix xmlns: <http://www.w3.org/2000/xmlns/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://localhost:8080/rest/a>
rdf:type fedora:Binary ;
rdf:type fedora:Resource ;
fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
premis:hasSize "5"^^<http://www.w3.org/2001/XMLSchema#long> ;
ebucore:hasMimeType "text/plain"^^<http://www.w3.org/2001/XMLSchema#string> ;
fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
fedora:created "2018-01-05T18:49:14.495Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2018-01-05T18:49:14.495Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
premis:hasMessageDigest <urn:sha1:aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d> ;
ebucore:filename ""^^<http://www.w3.org/2001/XMLSchema#string> ;
rdf:type ldp:NonRDFSource ;
fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
<http://www.iana.org/assignments/relation/describedby> <http://localhost:8080/rest/a/fcr:metadata> ;
fedora:hasParent <http://localhost:8080/rest/> ;
fedora:hasFixityService <http://localhost:8080/rest/a/fcr:fixity> .
simeon@RottenApple ~> curl -i http://localhost:8080/rest
HTTP/1.1 200 OK
Date: Fri, 05 Jan 2018 18:50:17 GMT
ETag: W/"fae245bdcfc8a26929e5fec8ad921992ce68e68a"
Last-Modified: Fri, 05 Jan 2018 18:49:14 GMT
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#Container>;rel="type"
Link: <http://www.w3.org/ns/ldp#BasicContainer>;rel="type"
Accept-Patch: application/sparql-update
Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,application/ld+json,multipart/form-data,application/sparql-update
Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept, Range, Accept-Encoding, Accept-Language
Content-Type: text/turtle;charset=utf-8
Content-Length: 1512
Server: Jetty(9.2.3.v20140905)
@prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
@prefix test: <info:fedora/test/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsi: <http://www.w3.org/2001/XMLSchema-instance> .
@prefix xmlns: <http://www.w3.org/2000/xmlns/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://localhost:8080/rest/>
fedora:lastModified "2018-01-05T18:49:14.456Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
rdf:type ldp:BasicContainer ;
fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
rdf:type fedora:RepositoryRoot ;
rdf:type fedora:Resource ;
rdf:type fedora:Container ;
ldp:contains <http://localhost:8080/rest/a> ;
fedora:hasTransactionProvider <http://localhost:8080/rest/fcr:tx> .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment