Current Release

This documentation covers the current version of Fedora. Looking for another version? See all documentation.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Fedora 6.x.x introduced the concept of "ghost nodes". These are URI path segments that do not resolve to a resource on their own.

For example, in a new empty repository:

curl -v -XPUT http://localhost:8080/rest/ghost/path/object

This would create a single resource at the path /rest/ghost/path/object

> curl -i -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/ghost/newThing     
HTTP/1.1 200 OK
Date: Mon, 10 Apr 2023 18:01:26 GMT
Set-Cookie: JSESSIONID=node0ppsmswh9fma1lnqa042y0hkp9.node0; Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 09-Apr-2023 18:01:26 GMT; SameSite=lax
ETag: W/"C0B283FE60C11A3E7943963799EE7A10"
X-State-Token: 21217075951D35683BA87AE42580C2BF
Last-Modified: Mon, 10 Apr 2023 18:00:50 GMT
Link: <http://localhost:8080/rest/ghost/newThing>; rel="timegate"
Link: <http://localhost:8080/rest/ghost/newThing>; rel="original"
Link: <http://localhost:8080/rest/ghost/newThing/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://fedora.info/definitions/v4/repository#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"
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:8080/rest/ghost/newThing/fcr:acl>; rel="acl"
Preference-Applied: return=representation
Vary: Prefer
Vary: Accept
Vary: Range
Vary: Accept-Encoding
Vary: Accept-Language
Vary: Accept-Datetime
Content-Type: text/turtle;charset=utf-8
Content-Length: 816
Server: Jetty(9.4.44.v20210927)

@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:8080/rest/ghost/newThing>
        fedora:created         "2023-04-10T18:00:50.202420Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:lastModified    "2023-04-10T18:00:50.202420Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:createdBy       "fedoraAdmin" ;
        fedora:lastModifiedBy  "fedoraAdmin" ;
        rdf:type               ldp:BasicContainer ;
        rdf:type               ldp:Resource ;
        rdf:type               fedora:Resource ;
        rdf:type               ldp:RDFSource ;
        rdf:type               ldp:Container ;
        rdf:type               fedora:Container .


The paths http://localhost:8080/rest/ghost and http://localhost:8080/rest/ghost/path both return a 404 Not Found for GET requests.

> curl -i -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/ghost         
HTTP/1.1 404 Not Found
Date: Mon, 10 Apr 2023 18:01:30 GMT
Set-Cookie: JSESSIONID=node0evxhuptudzd010yslilwp5pu010.node0; Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 09-Apr-2023 18:01:30 GMT; SameSite=lax
Content-Type: text/turtle;charset=utf-8
Content-Length: 32
Server: Jetty(9.4.44.v20210927)

Error: Resource /ghost not found

> curl -i -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/ghost/path
HTTP/1.1 404 Not Found
Date: Mon, 10 Apr 2023 17:57:18 GMT
Set-Cookie: JSESSIONID=node01jeiv46h6xn6h1peerv0d3zp5l5.node0; Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 09-Apr-2023 17:57:18 GMT; SameSite=lax
Content-Type: text/turtle;charset=utf-8
Content-Length: 37
Server: Jetty(9.4.44.v20210927)

Error: Resource /ghost/path not found

Why these are called "ghost" paths, is because they still have a haunting effect.

You cannot replace these path segments for new resources.

> curl -i -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/ghost -XPUT              
HTTP/1.1 409 Conflict
Date: Mon, 10 Apr 2023 18:05:05 GMT
Set-Cookie: JSESSIONID=node01i26p8o44mumkrmixiobx8zf718.node0; Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 09-Apr-2023 18:05:05 GMT; SameSite=lax
Content-Type: text/plain;charset=utf-8
Content-Length: 45
Server: Jetty(9.4.44.v20210927)

Resource path ghost is an immutable resource.

> curl -i -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/ghost/path -XPUT
HTTP/1.1 409 Conflict
Date: Mon, 10 Apr 2023 18:03:42 GMT
Set-Cookie: JSESSIONID=node013j2yecnv6mis8pb8dc60qyjm14.node0; Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 09-Apr-2023 18:03:42 GMT; SameSite=lax
Content-Type: text/plain;charset=utf-8
Content-Length: 50
Server: Jetty(9.4.44.v20210927)

Resource path ghost/path is an immutable resource.


You can create items off of the "ghost" path segments.

> curl -i -ufedoraAdmin:fedoraAdmin -XPUT http://localhost:8080/rest/ghost/newThing 
HTTP/1.1 201 Created
Date: Mon, 10 Apr 2023 18:00:50 GMT
...

http://localhost:8080/rest/ghost/newThing

> curl -i -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/ghost/newThing
HTTP/1.1 200 OK
Date: Mon, 10 Apr 2023 18:06:54 GMT



  • No labels