Skip to content

Conversation

@daltontc
Copy link

Created an option to write blank node lists as full objects in order to preserve blank node identifiers in the chain.

@dr0i dr0i self-assigned this Oct 28, 2022
@dr0i
Copy link
Member

dr0i commented Oct 28, 2022

Thx @daltontc for a pull request!
We would need an issue, though, which describes what and_why_ should be achieved.

I ask your assistance in understanding this.

Basically you want to have to "not convert list" to @list.

Your desired outcome from the java test in a more readable form:

[
   {
      "@id" : "_:b0",
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#first" : [ { "@id" : "Arnold" } ],
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest" : [ { "@id" : "_:b1" } ]
   },
   {
      "@id" : "_:b1",
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#first" : [ { "@id" : "Bob" } ],
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest" : [ { "@id" : "_:b2" } ]
   },
   {
      "@id" : "_:b2",
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#first" : [ { "@id" : "Catherine" } ],
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest" : [ { "@id" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
   }
]

This seems to come close to the one already in our tests at https://github.com/jsonld-java/jsonld-java/blob/master/core/src/test/resources/json-ld.org/fromRdf-0010-out.jsonld which implements https://w3c.github.io/json-ld-api/tests/fromRdf-manifest.html section "Test t0010 List pattern without rdf:nil".(for embedded view see also https://json-ld.org/test-suite/reports/ "Test 0010: List pattern without rdf:nil").
The corresponding input to that test differs from your input only by your adding of

_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .

As this rdf:nil seems to correspond to the title of the test ("Test t0010 List pattern without rdf:nil") it seems that it's a desired outcome to not have a @list by leaving out that rdf:nil , which implies that it is desired to have a @list if that rdf:nil is added.

There are some other tests related to your case, namely t0010,t0013,t0014 and t0015 (respectively see https://json-ld.org/test-suite/reports/ : Test 0010 etc.)

If you could point me to a jsonld spec which covers your implementation (I may well have overseen it) this would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants