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

URI consistency for containers and the trailing slash #1596

Open
gregjan opened this issue May 11, 2022 · 1 comment
Open

URI consistency for containers and the trailing slash #1596

gregjan opened this issue May 11, 2022 · 1 comment
Labels

Comments

@gregjan
Copy link
Member

gregjan commented May 11, 2022

I've been adding descriptive statements to containers and I think that I've identified a bug that shows up where the trailing slash is used in some cases and not others in Trellis' system generated statements.

You should be able to reproduce this case in v 0.19.0 using curl commands:

curl -XPOST -H 'Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"' -H "Slug: example" http://localhost:9090/

Then examine the turtle serialization of the parent: (omitting prefixes)

<http://localhost:9090/>
        rdf:type      ldp:BasicContainer ;
        ldp:contains  <http://localhost:9090/example/> .

Note that there is a trailing slash on the new container URI. Now GET that new container in turtle:

<http://localhost:9090/example>
        rdf:type  ldp:BasicContainer .

Note the lack of a trailing slash in the subject above. I would expect that these statements describe the same resource. I have to interact with that resource at the URI with the trailing slash, so that seems like the right one to me..

There is one more context where I note inconsistent use of trailing slash and that is the use of the <> shorthand in a turtle post of a container.

curl -v -X POST \
    -H "Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel=\"type\"" \
    -H "Slug: groofolder" \
    -d "<> a <http://example.com/schema/1.0/Groo> ." \
    http://localhost:9090/

Then if you get the groofolder turtle, it looks like this:

<http://localhost:9090/groofolder>
        rdf:type  ldp:BasicContainer .

<http://localhost:9090/groofolder/>
        rdf:type  <http://example.com/schema/1.0/Groo> .

The <> is replaced by the URI with the trailing slash, but the Trellis system triple is w/o the slash. Perhaps it all comes down to that one system triple that represents the LDP type being generated w/o the slash..

@gregjan gregjan added the bug label May 11, 2022
@gregjan
Copy link
Member Author

gregjan commented May 19, 2022

Some follow up information. The activity streams for container CRUD seem to similarly omit the trailing slash.

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