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

Compare with Current View Page History

« Previous Version 11 Next »

This page presents straw man data models for objects that may not need Linked Data Platform Containers (LDPCs).

The defining characteristics of this class of objects:

  • They do not contain bitstreams, but rather, metadata about bitstreams held elsewhere
  • They may contain pointer(s) to the referenced bitstreams (or bitstream objects)

The related concept in LDP (Linked Data Platform) terms:  Non-LDPC LDPRs

Example 1:  Fedora container object with a child resource at a specified path redirecting to external content

Request 1:  create container object

curl -i -X PUT "http://localhost:8080/rest/my_external_datastream_obj"

HTTP/1.1 201 Created
ETag: "f93bbf77fee0fa16da4872102a54240e7135eaf2"
Last-Modified: Thu, 12 Mar 2015 20:56:08 GMT
Content-Length: 53
Location: http://localhost:8080/rest/my_external_datastream_obj
Content-Type: text/plain
Server: Jetty(8.1.12.v20130726)

curl -H "Accept: text/turtle" "http://localhost:8080/rest/my_external_datastream_obj"

<http://localhost:8080/rest/my_external_datastream_obj> a ldp:RDFSource , ldp:Container , <http://www.jcp.org/jcr/nt/1.0folder> , <http://www.jcp.org/jcr/nt/1.0hierarchyNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0created> , fedora:Container , fedora:Resource , fedora:Resource , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified> , <http://www.jcp.org/jcr/mix/1.0referenceable> ;
        fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:uuid "fe7a8497-d826-490d-a786-ba601e039055"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:primaryType "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:created "2015-03-12T20:56:08.468Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:mixinTypes "fedora:Container"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:Resource"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:lastModified "2015-03-12T20:56:08.468Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
        fedora:hasParent <http://localhost:8080/rest/> ;
        fedora:exportsAs <http://localhost:8080/rest/my_external_datastream_obj/fcr:export?format=jcr/xml> .

<http://localhost:8080/rest/my_external_datastream_obj/fcr:export?format=jcr/xml> dc:format <http://fedora.info/definitions/v4/repository#jcr/xml> .

<http://fedora.info/definitions/v4/repository#jcr/xml> rdfs:label "jcr/xml"^^<http://www.w3.org/2001/XMLSchema#string> .

Request 2:  create child external content object

curl -i -X PUT -H"Content-Type: message/external-body; access-type=URL; URL=\"http://en.wikipedia.org/wiki/File:Harry_Whittier_Frees_-_What%27s_Delaying_My_Dinner.jpg\"" "http://localhost:8080/rest/my_external_datastream_obj/extds"

HTTP/1.1 201 Created
ETag: "cbc2d06dd76fe1b3f6379e5dc0b8212ab056443e"
Last-Modified: Thu, 12 Mar 2015 21:08:33 GMT
Link: <http://localhost:8080/rest/my_external_datastream_obj/extds/fcr:metadata>; rel="describedby"
Content-Length: 59
Location: http://localhost:8080/rest/my_external_datastream_obj/extds
Content-Type: text/plain
Server: Jetty(8.1.12.v20130726)

http://localhost:8080/rest/my_external_datastream_obj/extds

curl -i "http://localhost:8080/rest/my_external_datastream_obj/extds"

HTTP/1.1 307 Temporary Redirect
ETag: "cbc2d06dd76fe1b3f6379e5dc0b8212ab056443e"
Last-Modified: Thu, 12 Mar 2015 21:08:33 GMT
Content-Type: message/external-body; access-type=URL; url="http://en.wikipedia.org/wiki/File:Harry_Whittier_Frees_-_What%27s_Delaying_My_Dinner.jpg"
Content-Length: 0
Accept-Ranges: bytes
Content-Disposition: attachment; filename=""; creation-date="Thu, 12 Mar 2015 21:08:33 GMT"; modification-date="Thu, 12 Mar 2015 21:08:33 GMT"; size=0
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/my_external_datastream_obj/extds/fcr:metadata>; rel="describedby"
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Location: http://en.wikipedia.org/wiki/File:Harry_Whittier_Frees_-_What%27s_Delaying_My_Dinner.jpg
Server: Jetty(8.1.12.v20130726)

The complete thing

curl -H "Accept: text/turtle" -H "Prefer:  return=representation; include=\"http://fedora.info/definitions/v4/repository#EmbedResources\";" "http://localhost:8080/rest/my_external_datastream_obj"

<http://localhost:8080/rest/my_external_datastream_obj> a ldp:RDFSource , ldp:Container , <http://www.jcp.org/jcr/nt/1.0folder> , <http://www.jcp.org/jcr/nt/1.0hierarchyNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0created> , fedora:Container , fedora:Resource , fedora:Resource , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified> , <http://www.jcp.org/jcr/mix/1.0referenceable> ;
        fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:uuid "fe7a8497-d826-490d-a786-ba601e039055"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:primaryType "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:created "2015-03-12T20:56:08.468Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:mixinTypes "fedora:Container"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:Resource"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:lastModified "2015-03-12T21:08:33.787Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:writable "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
        fedora:hasParent <http://localhost:8080/rest/> ;
        ldp:contains <http://localhost:8080/rest/my_external_datastream_obj/extds> .

<http://localhost:8080/rest/my_external_datastream_obj/extds> a <http://www.jcp.org/jcr/nt/1.0resource> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0mimeType> , <http://www.jcp.org/jcr/mix/1.0lastModified> , fedora:Binary , fedora:Resource , <http://www.jcp.org/jcr/mix/1.0created> , <http://www.jcp.org/jcr/mix/1.0lastModified> , <http://www.jcp.org/jcr/mix/1.0referenceable> ;
        fedora:lastModifiedBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:uuid "86aa4107-768d-4e2d-9064-78be072c0888"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:mimeType "message/external-body; access-type=URL; url=\"http://en.wikipedia.org/wiki/File:Harry_Whittier_Frees_-_What%27s_Delaying_My_Dinner.jpg\""^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:digest <urn:sha1:da39a3ee5e6b4b0d3255bfef95601890afd80709> ;
        premis:hasSize "0"^^<http://www.w3.org/2001/XMLSchema#long> ;
        fedora:createdBy "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:primaryType "nt:resource"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:created "2015-03-12T21:08:33.787Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        fedora:mixinTypes "fedora:Binary"^^<http://www.w3.org/2001/XMLSchema#string> ;
        fedora:lastModified "2015-03-12T21:08:33.787Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
        premis:hasOriginalName ""^^<http://www.w3.org/2001/XMLSchema#string> .

<http://localhost:8080/rest/my_external_datastream_obj> fedora:exportsAs <http://localhost:8080/rest/my_external_datastream_obj/fcr:export?format=jcr/xml> .

<http://localhost:8080/rest/my_external_datastream_obj/fcr:export?format=jcr/xml> dc:format <http://fedora.info/definitions/v4/repository#jcr/xml> .

<http://fedora.info/definitions/v4/repository#jcr/xml> rdfs:label "jcr/xml"^^<http://www.w3.org/2001/XMLSchema#string> .

Example 2: LDP-RS as datastreams

This strawman proposal addresses the following issues:

  1. Allow Fedora to create LDP-RS (RDF resources) that are NOT containers (LDPC), as allowed per the LDP spec.  These will henceforth be called LDP-RS-NCs ("LDP RDF Source, Non-containers") for the sake of this discussion
  2. Allow the LDP-RS-NCs created by Fedora to contain arbitrary RDF
    1. No requirements on allowable subjects, predicates, or objects in the triples
    2. No constraints on constructs such as blank nodes
  3. Allow the LDP-RS-NCs created to by Fedora to be 'pure' in that they are logically unmodified from client requests
    1. No server managed triples are added by Fedora
  4. Allow the LDP-RS interaction model as defined by LDP on these resources
    1. Retrieve triples in specified representation (xml, turtle, ntriples, etc)
    2. Logical PUT operation (i.e. logical contents of graph are stored, not necessarily the serialization bytes)
    3. SPARQL Update semantics (PATCH)
    4. Interpretation of relative URIs as per the LDP spec (for example, allowing null relative URIs "<>" to refer to the to-be-created resource URI)

Proposal

LDP-RS-NCs in Fedora shall be datastreams, differing only from binary datastreams (exposed as LDP-NRs in LDP) in the following significant ways:

  1. Fedora's HTTP APIs support LDP-RS operations on these resources such as the logical PUT and  PATCH,  resolution of relative URIs in the content, etc.
  2. Fedora may describe these resources using slightly different metadata in their corresponding 'fcr:metadata' resources.  For example, LDP-RS-NCs may have a different mixin type than LDP-NRs
  3. Basic validation as well-formed RDF or SPARQL/update statements is a prerequisite for accepting content.
  4. The binary representation of an LDP-RS-NC as persisted in Fedora as datastream content may potentially be opaque (a decision would need to be made on this)
    1. The serialization format may be specified in advance.  For example, Fedora may chose to serialize as turtle, always
    2. Fedora may perhaps chose to store the exact binary content supplied by the client via PUT, and record metadata indicating which RDF serialization had been persisted.
    3. Likewise, the content may be entirely opaque, leaving it an implementation decision that can change at any time.

An LDP-RS-NC shall be created when the client specifies an LDPR interaction model for newly created resources as per section 5.2.3.4 of the LDP spec.

  • No labels