Skip to content

Instantly share code, notes, and snippets.

@escowles
Created August 6, 2020 13:17
Show Gist options
  • Save escowles/9fbe6fa1db8ebcbc40eab1a71affdeb0 to your computer and use it in GitHub Desktop.
Save escowles/9fbe6fa1db8ebcbc40eab1a71affdeb0 to your computer and use it in GitHub Desktop.
#!/bin/sh
# test inbound references in f6
INBOUND="http://fedora.info/definitions/fcrepo#PreferInboundReferences"
BASE=http://localhost:8998/rest/$RANDOM
# create an object
curl -X PUT $BASE/obj1
# create a second object linking to the first
curl -X PUT -H "Content-type: text/turtle" -d "<> <http://purl.org/dc/terms/relation> <$BASE/obj1> ." $BASE/obj2
# retrieve the first object with inbound links
curl -i -H "Prefer: return=representation; include=\"$INBOUND\"" $BASE/obj1
# expected: <obj2> <dct:relation> <obj1> triple should appear
# actual: only triples with subject <obj1> appear
Date: Thu, 06 Aug 2020 13:16:15 GMT
ETag: W/"51D83178EA018332A7D91E46F24A966A"
X-State-Token: 51D83178EA018332A7D91E46F24A966A
Last-Modified: Thu, 06 Aug 2020 13:16:14 GMT
Link: <http://localhost:8998/rest/29105/obj1>; rel="timegate"
Link: <http://localhost:8998/rest/29105/obj1>; rel="original"
Link: <http://localhost:8998/rest/29105/obj1/fcr:versions>; rel="timemap"
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Container>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Container>; rel="type"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Accept-External-Content-Handling: copy,redirect,proxy
Accept-Patch: application/sparql-update
Accept-Post: text/turtle,text/rdf+n3,text/n3,application/rdf+xml,application/n-triples,application/ld+json
Allow: DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS
Link: <http://localhost:8998/rest/29105/obj1/fcr:acl>; rel="acl"
Preference-Applied: return=representation; include="http://fedora.info/definitions/fcrepo#PreferInboundReferences"
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Vary: Accept-Datetime
Content-Type: text/turtle;charset=utf-8
Content-Length: 705
Server: Jetty(9.4.24.v20191120)
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
<http://localhost:8998/rest/29105/obj1>
fedora:created "2020-08-06T13:16:14.965437Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
fedora:lastModified "2020-08-06T13:16:14.965437Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
rdf:type ldp:BasicContainer ;
rdf:type ldp:Resource ;
rdf:type ldp:RDFSource ;
rdf:type ldp:Container ;
rdf:type fedora:Container ;
rdf:type fedora:Resource .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment