Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDP-RS creation with POST and Turtle payload results in a LDP-NR. #56

Closed
scossu opened this issue Apr 14, 2018 · 2 comments
Closed

LDP-RS creation with POST and Turtle payload results in a LDP-NR. #56

scossu opened this issue Apr 14, 2018 · 2 comments
Labels
Milestone

Comments

@scossu
Copy link
Owner

scossu commented Apr 14, 2018

Environment

Operating system: various

Python version: N/A

LAKEsuperior release, branch, or commit #: 1.0.0a13

Observed behavior

(from @acoburn 's email:)

[...] issue that I ran into related to trying to create a direct container via POST (PUT seems to work correctly). This is the file I'm using:

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

<> dcterms:title "Direct Container" ;
    ldp:membershipResource <http://localhost:8000/ldp/member> ;
    ldp:hasMemberRelation dcterms:relation .

(assume the pre-existing presence of /ldp/member)

Whenever I try to create a new resource via POST, the new resource is stored as an LDP-NR. Here are the various commands I've used:

curl -i localhost:8000/ldp -XPOST --data-binary @dc.ttl
curl -i localhost:8000/ldp -XPOST --data-binary @dc.ttl -H"Content-Type: text/turtle"
curl -i localhost:8000/ldp -XPOST --data-binary @dc.ttl -H"Content-Type: text/turtle" -H"Slug: dc"
curl -i localhost:8000/ldp -XPOST --data-binary @dc.ttl -H"Content-Type: text/turtle" -H"Slug: dc" -H"Link: <http://www.w3.org/ns/ldp#DirectContainer>; rel=\"type\""

In every case, the new resource is an LDP-NR. Though when I use equivalent commands to create a resource via PUT, everything works correctly. This same issue seems to apply to regular RDF source/container resources as well: they are created correctly as an LDP-RS under PUT but not under POST.

Expected behavior

Containers should be created with POST the same way they are created with PUT.

Other notes worth mentioning

This may be the case with indirect containers as well. Needs testing.

@scossu scossu added this to the alpha.14 milestone Apr 14, 2018
@scossu scossu added the bug label Apr 14, 2018
@scossu scossu changed the title Direct container creation fails with POST LDP-RS creation with POST and Turtle payload results in a LDP-NR. Apr 15, 2018
@scossu
Copy link
Owner Author

scossu commented Apr 15, 2018

@acoburn This is not restricted to LDP-DCs. Changing issue title.

scossu added a commit that referenced this issue Apr 16, 2018
Allow creating resources providing RDF bytestring. Also resolves #56.
@scossu
Copy link
Owner Author

scossu commented Apr 16, 2018

Fixed in #59.

@scossu scossu closed this as completed Apr 16, 2018
@scossu scossu mentioned this issue Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant