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.
Code Block |
---|
curl -i -XPUT -H"Content-Type: text/turtle" --data-binary @pcdm-object.ttl localhost:8080/rest/objects/ |
Where "pcdm-object.ttl" follows: Code Block |
---|
| @prefix pcdm: <http://pcdm.org/models#>
<> a pcdm:Object . |
Second, create the nested "raven/" pcdm:Object, which is also another ldp:BasicContainer. Code Block |
---|
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. Code Block |
---|
curl -i -XPUT -H"Content-Type: text/turtle" --data-binary @ldp-direct.ttl localhost:8080/rest/objects/raven/pages/ |
Where "ldp-direct.ttl" follows: Code Block |
---|
| @prefix ldp: <http://www.w3.org/ns/ldp#>
@prefix pcdm: <http://pcdm.org/models#>
<> 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! |