Closed reederz closed 9 years ago
Any update on this? I've been trying to create a LDPC, but I can't find any way to do it. Is it a known restriction?
That looks like a bug to me.
yes, the bug is with the example. To create a new LDPC you need to pass in the header the type of the resource you want to create, with the header
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type",
I think that means you have to adapt the example to:
$ curl -X POST -k -i -H "Content-Type: text/turtle; utf-8" -H "Link: Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel='type'" --cert ../eg/test-localhost.pem:test -H "Slug: XDir" -d @../eg/newContainer.ttl https://localhost:8443/2013/
Does that work?
I've tried creating a basic container with the adapted example:
[ 9:17PM ] [ justas@choedankal:~/Source/scala/RWW/rww-play/test_www(dev✔) ]
$ curl -X POST -k -i -H "Content-Type: text/turtle; utf-8" -H "Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel='type'" --cert ../eg/test-localhost.pem:test -H "Slug: XDir" -d @../eg/newContainer.ttl https://localhost:8443/2013/
HTTP/1.1 201 Created
Location: https://localhost:8443/2013/XDir
User: https://localhost:8443/2013/card#me
Content-Length: 0
Unfortunately, the end result is exactly the same as before I.e. the resulting XDir is a file (instead of directory) with the following content:
[ 9:18PM ] [ justas@choedankal:~/Source/scala/RWW/rww-play/test_www(dev✗) ]
$ cat XDir
<XDir> a <http://www.w3.org/ns/ldp#BasicContainer> ;
<http://xmlns.com/foaf/0.1/topic> "A container for some type X of resources" ;
<http://xmlns.com/foaf/0.1/maker> <https://localhost:8443/card#me> .
<> <http://www.w3.org/ns/ldp#contains> <XDir> .
ok, that looks like a bug then. Let me look at that.
The following works:
curl -X POST -k -i -H "Content-Type: text/turtle; utf-8" -H 'Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"' --cert ../eg/test-localhost.pem:test -H "Slug: XDir" -d @../eg/newContainer.ttl https://localhost:8443/2013/
If you can work out that my parser for link headers is incorrect, and that it should also allow quotation with single quotes '
then please open another issue.
I have fixed the curl description.
@bblfish I confirm- it works. Thanks
Works for me too. Thanks !
I'm talking about this example: https://github.com/read-write-web/rww-play/wiki/Curl-Interactions#creating-a-container .
Here's what I did:
After creation of this container, I trie to create a data resource in it using this example: https://github.com/read-write-web/rww-play/wiki/Curl-Interactions#creating-a-data-resource :