Archived

If you are looking for the last documentation in the 4.x series, see 4.7.5. 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

« Previous Version 4 Next »

Fedora4 (F4) implements the Linked Data Platform (LDP) W3C Recommendation. Additionally, the Portland Common Data Model (PCDM) has increasingly become adopted as a common content modeling approach in Fedora4.

This guide is designed to describe the details of both LDP and PCDM in the context of F4 by walking through a simple example of a single collection, consisting of a single book that implements page ordering.

0: Final State - Complete

This diagram depicts the logical structure of resources and relationships of a collection ("poe") that consists of a book ("raven") that consists of three pages that are ordered.

The following steps will walk through the process of creating this structure from the ground up.
The different types of LDP containers and sources will be detailed, as well as the PCDM types and relationships in the steps below. 

1: Final State - Book
The ldp:BasicContainers are simply containers of other resources. BasicContainers can contain both other containers as well as ldp:NonRdfSources (or "binaries").
There are three PCDM types here:
  • pcdm:Object
  • pcdm:Collection
  • pcdm:File

Additionally, there are two PCDM relationships that indicate resource membership and file membership:

  • pcdm:hasMember
  • pcdm:hasFile

The descriptions of these resource types and relationships may be found in the detailed Portland Common Data Model page.

Book - Create DirectContainer

Here we will begin to walk through the mechanics of creating the structures that will facilitate creation of the book and its pages.


First, create the top-level "objects/" pcdm:Object, which is also an ldp:BasicContainer.

curl -i -XPUT -H"Content-Type: text/turtle" --data-binary @pcdm-object.ttl localhost:8080/rest/objects/

Where "pcdm-object.ttl" follows:

pcdm-object.ttl
@prefix pcdm: <http://pcdm.org/models#>
 
<> a pcdm:Object .

Second, create the nested "raven/" pcdm:Object, which is also another ldp:BasicContainer.

curl -i -XPUT -H"Content-Type: text/turtle" --data-binary @pcdm-object.ttl localhost:8080/rest/objects/raven/

Lastly, create an ldp:DirectContainer, "pages/" that will facilitate the establishment of relationships between "raven/" and its constituent pages.

curl -i -XPUT -H"Content-Type: text/turtle" --data-binary @ldp-direct.ttl localhost:8080/rest/objects/raven/pages/

Where "ldp-direct.ttl" follows:

ldp-direct.ttl
@prefix ldp: <http://www.w3.org/ns/ldp#>

<> a ldp:DirectContainer ;
  ldp:membershipResource </rest/objects/raven/> ;
  ldp:hasMemberRelation pcdm:hasMember .

An ldp:DirectContaner is an LDP construct that activates the creation of certain RDF triples when a new resource is added as a child of this container.
Specifically, when an new resources is added inside of the "pages/" DirectContainer, a new triple on the ldp:membershipResource ("raven/") will be created with the predicate defined by the ldp:hasMemberRelation property ("pcdm:hasMember") and a subject that is a reference to the new resource.

We will see this in action next!

Book - Create cover

Create a new pcdm:Object, "cover/", that is also an ldp:BasicContainer within the "pages/" DirectContainer.
 

curl -i -XPUT -H"Content-Type: text/turtle" --data-binary @pcdm-object.ttl localhost:8080/rest/objects/raven/pages/cover/

Where "pcdm-object.ttl" follows:

pcdm-object.ttl
@prefix pcdm: <http://pcdm.org/models#>

<> a pcdm:Object .

As described in the previous step, the addition of "cover/" automatically creates the following new triple on "raven/"

<http://localhost:8080/rest/objects/raven/> pcdm:hasMember <http://localhost:8080/rest/objects/raven/pages/cover/>

Restating from the previous step,

  • the subject of the triple comes from the "ldp:membershipResource" defined on "pages/"
  • the predicate of the triple comes from the "ldp:hasMemberRelation" defined on "pages/", and
  • the object of the triple is the new resource ("cover/") that was added to the ldp:DirectContainer ("pages/")
2: Final State - Collection

 

3: Final State - Ordered Pages

 

  • No labels