Hi,

Playing around with marmotta I tried to create a new LDPC.

I describe my  container in a file

$ cat simpleldpc.ttl
@prefix dct: <http://purl.org/dc/terms/> .
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<.> a ldp:DirectContainer ;
    sct:title "My first LDPC" .


Post this to the container which is there by default at
http://localhost:8080/ldp

$ curl -D - -X POST --data @simpleldpc.ttl http://localhost:8080/ldp
HTTP/1.1 201 Created
Server: Apache Marmotta/3.3.0-SNAPSHOT (build 2+)
Last-Modified: Fri, 04 Jul 2014 20:25:07 GMT
ETag: W/"1404505507000"
Location: http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3
Link: <https://wiki.apache.org/marmotta/LDPImplementationReport/2014-03-11>;
rel="describedby"
Link: <http://www.w3.org/ns/ldp#Container>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Content-Length: 0
Date: Fri, 04 Jul 2014 20:25:07 GMT


looks good to me, let's access the newly created resource:

$ curl -D - http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3
HTTP/1.1 200 OK
Server: Apache Marmotta/3.3.0-SNAPSHOT (build 2+)
Last-Modified: Fri, 04 Jul 2014 20:25:07 GMT
ETag: "e7fbd1bca63f04ca23b8f0092b5c2f3"
Link: <https://wiki.apache.org/marmotta/LDPImplementationReport/2014-03-11>;
rel="describedby"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>;
rel="meta"
Link: <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>;
rel="describedby"
Link: <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>;
rel="content"
Content-Type: text/turtle
Transfer-Encoding: chunked
Date: Fri, 04 Jul 2014 20:26:19 GMT

@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix : <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3> .

<http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>
ldp:interactionModel ldp:Container ;
    a ldp:Resource , ldp:NonRDFSource , ldp:RDFSource ;
    dcterms:modified "2014-07-04T20:25:07.000Z"^^xsd:dateTime ;
    dcterms:created "2014-07-04T20:25:07.000Z"^^xsd:dateTime ;
    dcterms:isFormatOf <
http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3> ;
    dcterms:hasFormat <
http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3> ;
    dcterms:format "application/x-www-form-urlencoded" .


The new resource has none of the two properties in the posted file. But it
is both an ldp:RDFSource and an ldp:NonRDFSource!

Let's see if it can nonetheless be used as a container, posting something
against it:

$ curl -D - -X POST --data @simplecontainer.ttl
http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3
HTTP/1.1 405 Method Not Allowed
Server: Apache Marmotta/3.3.0-SNAPSHOT (build 2+)
Last-Modified: Fri, 04 Jul 2014 20:25:07 GMT
ETag: "e7fbd1bca63f04ca23b8f0092b5c2f3"
Link: <https://wiki.apache.org/marmotta/LDPImplementationReport/2014-03-11>;
rel="describedby"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>; rel="type"
Link: <http://www.w3.org/ns/ldp#RDFSource>; rel="type"
Link: <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>;
rel="meta"
Link: <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>;
rel="describedby"
Link: <http://localhost:8080/ldp/f1f7816b-c90f-4b6e-aa76-48ad445d86d3>;
rel="content"
Content-Type: application/octet-stream
Content-Length: 36
Date: Fri, 04 Jul 2014 20:31:39 GMT

POST to NonRdfSource is not allowed


So creating an LDPC this way doesn't seem to work, instead I'm having quite
a weird resource lacking all the originally posted triples.

Why this behavior? What is the recommended way to create new LDPC in
marmotta?

Cheers,
Reto

Reply via email to