w3c / json-ld-framing

JSON-LD 1.1 Framing Specification
https://w3c.github.io/json-ld-framing/
Other
25 stars 20 forks source link

Recursion catch fails at top level #30

Closed azaroth42 closed 5 years ago

azaroth42 commented 5 years ago

The following graph produces what I believe is incorrect output in both PyLD and the Ruby Distiller:

<https://example.org/what> <https://example.org/ns/sameAs> <https://example.org/what> .
<https://example.org/what> <https://example.org/ns/age> "42"^^<http://www.w3.org/2001/XMLSchema#integer> .
parsed = from_rdf(what, {'format': 'application/nquads', 'useNativeTypes': True})
framing = {
    "@context": context,
    "@id": "https://example.org/what"
}
js = frame(parsed, framing)

js is now, with the obvious context:

    {
      "id": "https://example.org/what",
      "age": 42, 
      "sameAs": {
        "id": "https://example.org/what",
        "age": 42, 
        "sameAs": "https://example.org/what"
      }
    }

I would have expected:

    {
      "id": "https://example.org/what",
      "age": 42, 
      "sameAs":  "https://example.org/what"
    }
azaroth42 commented 5 years ago

But the playground does do as I would expect: http://tinyurl.com/y83cucrv

Issue for the implementations or the spec?

gkellogg commented 5 years ago

@azaroth42 did you try it on my distiller. I get the expected results. It would be embedded if @embed is true, or something similar.

azaroth42 commented 5 years ago

I did try it, and got the unexpected results! Is it possible to store the configuration for your distiller to make a pointer?

gkellogg commented 5 years ago

I'm afraid not, but if you copy and paste the input and frame from the playground into the form fields (you'll need to expand the "frame" field, you should see the results.

azaroth42 commented 5 years ago

Can't reproduce. Closing.