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

JSON-LD resource containing named graphs #158

Closed
pchampin opened this issue Mar 1, 2023 · 5 comments · Fixed by solid-contrib/specification-tests#101
Closed

JSON-LD resource containing named graphs #158

pchampin opened this issue Mar 1, 2023 · 5 comments · Fixed by solid-contrib/specification-tests#101

Comments

@pchampin
Copy link

pchampin commented Mar 1, 2023

When I post a JSON-LD resource containing named graphs, I get very different (and sometimes surprising) across different POD implementations. Note that I think the standard is currently silent on what should be the "correct" behaviour. Note also that this use-case is important if we want to use Verifiable Credentials (or Linked Data proofs) on Solid.

The example JSON-LD is available at

When you simply curl these URLs, you get

{
   "@context": { "ex": "http://example.org/ns/" },
  "@id": "ex:test",
   "@type": "ex:Graph",
   "@graph": {
     "@id": "ex:naughty",
      "@type": "ex:Trial"
   }
}

which expand the following dataset (in n-quads):

<http://example.org/ns/test> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/ns/Graph>.
<http://example.org/ns/naughty> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/ns/Trial> <http://example.org/ns/test>.

Now, curl -Haccept:text/turtle https://p20n.inrupt.net/dagstuhl.jsonld returns

@prefix n: <http://example.org/ns/>.
n:naughty a n:Trial.
n:test a n:Graph.

(note that the named graph has been collapsed into the default graph)

while curl -Haccept:text/turtle https://solid.champin.net/pa/dagstuhl.jsonld retuns

<http://example.org/ns/test> {
<http://example.org/ns/naughty> a <http://example.org/ns/Trial>
}
<http://example.org/ns/test> a <http://example.org/ns/Graph>.

which is not valid Turtle (despite a content-type: text/turtle in the response).
Note that it is valid TriG, which could be ok-ish if the content-type header was correct.

Conclusion: there should be a test for that in the test suite 😄

@pchampin
Copy link
Author

pchampin commented Mar 1, 2023

Note that the Turtle/Trig issue of CSS is a known issue: CommunitySolidServer/CommunitySolidServer#1327

@michielbdejong
Copy link
Collaborator

Thanks for reporting! I created an NSS issue about the collapsing of the named graph ^

You're right, we should add this as a test (the ones in https://github.com/solid-contrib/solid-crud-tests/blob/main/test/surface/conneg.test.ts are clearly not sufficient) and also test what Solid-Nextcloud and TrinPod do with this.

@michielbdejong
Copy link
Collaborator

I just checked the spec; it indeeds requires storage servers to store RDF documents, and

An RDF document is a document that encodes an RDF graph or RDF dataset

So although we usually only store triples inside RDF documents (i.e. the document encodes a graph), a Solid pod server should also support storing an RDF Dataset as a non-container resource.

michielbdejong added a commit to solid-contrib/specification-tests that referenced this issue Mar 28, 2023
edwardsph added a commit to solid-contrib/specification-tests that referenced this issue Mar 30, 2023
…#101)

* Add fixture from solid-contrib/test-suite#158 (comment)
* Fix fixture name
* Add new test in manifest as unreviewed
* Add requirement for named graphs support in JSON-LD and TTL

---------

Co-authored-by: Pete Edwards <[email protected]>
@michielbdejong
Copy link
Collaborator

See also solid/specification#291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants