Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document describes the basic interactions for these object types within Fedora, and some specific behavior decisions the application makes. For more details about

BasicContainer

ldp:BasicContainer are created by default in Fedora PUT or POST requests if no interaction model or unsupported RDF serialization Content-Type is provided. They are ldp:containers, and as a result, objects which are created as children of these containers will create containment triples from the BasicContainer to the child object, using the ldp:contains predicate.

...

DirectContainer

In addition to the regular containment behaviors of defined for ldp:ContainersBasicContainers, ldp:DirectContainers are used to produce membership triples between a membership resource and the immediate children of the DirectContainer. For more information, you may refer to the LDP specification and LDP-PCDM-F4 In Action.

The membership resource of a DirectContainer is defined by the Object object of a ldp:membershipResource property. If this property is not set, by default a property with the DirectContainer itself usedis added. Any resource URI may be specified as the object, whether it is within the Fedora repository or not. However, it must be a resource URI, literals Literal objects are disallowed. Only one membership resource may be specified per DirectContainer.

To specify which predicate to use for the membership triples, either a ldp:hasMemberRelation or ldp:isMemberOfRelation property with the desired predicate as its the object should be set on the DirectContainer. If the former property is set, for each child of the DirectContainer a membership property will be created with the membership resource as the subject and the child as the object. If the ldp:isMemberOfRelation is used, the subject and object will be reversed. If no property is provided, by default a ldp:hasMemberRelation property with the object ldp:member will be added to the DirectContainer. Only one of these two properties may be present per container, and only a single instance of itmembership predicate can be provided per DirectContainer.

To create a DirectContainer with default properties, simply provide the appropriate interaction model:

...

The properties of the DirectContainer may be updated after creation via PATCH or PUT.

Then to add a member to the container, create a child of direct_container:

Code Block
curl -XPUT http://localhost:8080/rest/direct_container/member1

The membership triples produced will be included in GET responses to the membership resource if the DirectContainer specifies ldp:hasMemberRelation (<http://localhost:8080/rest/membership_resc> in the example above), or in the response for child objects if ldp:isMemberOfRelation was set.

Code Block
curl http://localhost:8080/rest/membership_resc

@prefix ldp:   <http://www.w3.org/ns/ldp#> .
<http://localhost:8080/rest/membership_resc>
        <http://example.com/hasMember>  <http://localhost:8080/rest/direct_container/member1> ;
        ...

Membership triples are returned in responses from mementosof objects as well. It should be noted that even with autoversioning enabled, adding membership triples to a resource does not trigger a new memento of that resource. If the DirectContainer , the membership resource, or a child of the DirectContainer is deleted along with and its fcr:tombstone are deleted, any membership triples resulting from that resource it will no longer appear in mementos. Similarly, deleting children of DirectContainers and their fcr:tombstones will remove membership triples involving those resources.

IndirectContainer

As ldp:IndirectContainers are a subclass of ldp:DirectContainer, so everything previously described about those above applies here as well. What they Additionally, IndirectContainers add is the ability to create membership triples to resources which are not the immediate children of the container, via proxy objects.

By default, IndirectContainers will have a ldp:insertedContentRelation property with the object ldp:MemberSubject. If the property has this object, then the container will function like the same as a DirectContainer in that ; membership triples will only be generated for immediate children of the container.

If any other predicate URI is provided as the object of this property, then membership will only be generated between the membership resource and resources referenced by the children of the IndirectContainer. These children are referred to as proxy objects. Only resources referenced by the children using the same predicate defined via the ldp:insertedContentRelation of the IndirectContainer will generate membership triples. Additionally, membership will only be generated for resource URIs referenced by the children, not literalsLiteral values referenced by these predicates will be ignored.

Only one member may be referenced per proxy, but the same member resource can be referenced by any number of proxy objects in any number of IndirectContainers.

...

To add "http://localhost:8080/rest/member1member2" as a member of membership_resc, you could create a proxy as follows:

Code Block
echo "
<> <http://example.com/proxyFor> <http://localhost:8080/rest/member1>member2>" |
curl -XPUT http://localhost:8080/rest/indirect_container/proxy1 -H"Content-Type: text/turtle" --data-binary "@-"

At which point a GET request to membership_resc would return the membership triple:

Code Block
curl http://localhost:8080/rest/membership_resc

@prefix ldp:   <http://www.w3.org/ns/ldp#> .
<http://localhost:8080/rest/membership_resc>
        <http://example.com/hasMember>  <http://localhost:8080/rest/member1>member2> .
        ...

Deleting a proxy object will remove the membership triple generated by it, but will not affect the original referenced object otherwise. Deleting the proxy's tombstone will remove any membership triples produced by it in existing mementos.