Issue-34 - Aggregation: simple proposal an alternative example

From Linked Data Platform
Revision as of 00:35, 18 January 2013 by Nmihindu (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

1 Initial State

1.1 Existing LDP container

URL - http://localhost/containerA/
An LDP container including an existing composite resource.

GET http://localhost/containerA/
HTTP/1.1 200 OK

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<http://localhost/containerA/>
    a ldp:Container;
    dcterms:title "A Linked Data Platform Container";
    rdfs:member <http://localhost/containerA/resourceA> .

1.2 Existing local resource

URL - http://localhost/containerA/resourceA
An LDPR or a binary resource managed by the same server that manages the LDPC.

GET http://localhost/containerA/resourceA
Accept: */*
HTTP/1.1 200 OK
Content-Type: x/x

Content ...

1.3 Existing remote resource

URL - http://remote.org/resourceA
An LDPR or a binary resource managed by some some remote server.

GET http://remote.org/resourceA
Accept: */*
HTTP/1.1 200 OK
Content-Type: x/x

Content ...

2 Creating an aggregation

2.1 Creating an aggregation in the LDPC

POST http://localhost/containerA/
Content-Type: text/turtle

@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<>
   a ldp:Aggregation;
   dcterms:title "A Linked Data Platform Aggregation" ;
   ldp:contains <http://localhost/containerA/resourceA> .
HTTP/1.1 201 OK
Location: http://localhost/containerA/AggregationA

2.2 State of the LDP container

URL - http://localhost/containerA/

GET http://localhost/containerA/
HTTP/1.1 200 OK

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<http://localhost/containerA/>
    a ldp:Container;
    dcterms:title "A Linked Data Platform Container";
    rdfs:member <http://localhost/containerA/resourceA> ;
    rdfs:member <http://localhost/containerA/AggregationA> .

2.3 State of the LDP aggregation

GET http://localhost/containerA/AggregationA
HTTP/1.1 200 OK

@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<http://localhost/containerA/AggregationA>
   a ldp:Aggregation;
   dcterms:title "A Linked Data Platform Aggregation" ;
   ldp:contains <http://localhost/containerA/resourceA> .

3 Updating the aggregation

3.1 Adding another resource to the aggregation

Adding the resource <http://remote.org/resourceA> to the aggregation.

PUT http://localhost/containerA/AggregationA
Content-Type: text/turtle

@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<http://localhost/containerA/AggregationA>
   a ldp:Aggregation;
   dcterms:title "A Linked Data Platform Aggregation" ;
   ldp:contains <http://localhost/containerA/resourceA> ;
   ldp:contains <http://remote.org/resourceA> .
HTTP/1.1 204 No Content

3.2 State of the LDP aggregation

Same as above.

3.3 State of other resources

No other resource changes their state because of this operation.

4 Updating the aggregation

4.1 Removing a resource from the aggregation

Removing the resource <http://localhost/containerA/resourceA> from the aggregation.

PUT http://localhost/containerA/AggregationA
Content-Type: text/turtle

@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<http://localhost/containerA/AggregationA>
   a ldp:Aggregation;
   dcterms:title "A Linked Data Platform Aggregation" ;
   ldp:contains <http://remote.org/resourceA> .
HTTP/1.1 204 No Content

4.2 State of the LDP aggregation

Same as above.

4.3 State of the local resource

GET http://localhost/containerA/resourceA
Accept: */*
HTTP/1.1 200 OK
Content-Type: x/x

Content ...

4.4 State of other resources

No other resource changes their state because of this operation.

5 Deleting the aggregation

5.1 Deleting the aggregation

DELETE http://localhost/containerA/AggregationA
HTTP/1.1 204 No Content

5.2 State of the LDP aggregation

GET http://localhost/containerA/AggregationA
HTTP/1.1 410 Gone

5.3 Existing LDP container

GET http://localhost/containerA/
HTTP/1.1 200 OK

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<http://localhost/containerA/>
    a ldp:Container;
    dcterms:title "A Linked Data Platform Container";
    rdfs:member <http://localhost/containerA/resourceA> .

5.4 State of the local resource

GET http://localhost/containerA/resourceA
Accept: */*
HTTP/1.1 200 OK
Content-Type: x/x

Content ...

5.5 State of the remote resource

GET http://remote.org/resourceA
Accept: */*
HTTP/1.1 200 OK
Content-Type: x/x

Content ...