w3c / json-ld-framing

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

Several frames in the same frame document? #38

Open iherman opened 5 years ago

iherman commented 5 years ago

Looking at 2.3.1 I tested the core library example of the document on playground with the following frame

{
  "@context": {
    "@vocab": "http://example.org/"
  },
  "@graph" : [
      {
        "@type": "Library",
        "contains": {
            "@type": "Book",
            "@embed": "@never"
        }
      },
      {
        "@type": "Book",
        "contains": {
            "@type": "Chapter",
            "@embed": "@last"
        }
      }
  ]
}

And I got the reply that a frame document must have only one frame object.

O.k., playground is playing per spec, but I was a bit surprised: why can't I have a frame like the one above? In the result, the 'library' would just list the books by ID, and the rest of the graph would include each book separately, including the relevant chapters. Isn't that a viable use case?

azaroth42 commented 5 years ago

Or ... can @graph be used in a frame document to dictate the presence of @graph in the resulting JSON-LD document?

iherman commented 5 years ago

Well, the example frame defines either a set of objects in a bush or a graph as part of the (messy) JSON-LD specification. So yes, by using other means we may get a graph.

I realize that this would mean a non-trivial extension of the current framing algorithm, though.

iherman commented 5 years ago

This issue was discussed in a meeting.

iherman commented 5 years ago

This issue was discussed in a meeting.

iherman commented 5 years ago

This issue was discussed in a meeting.

shkumar4 commented 4 months ago

I've a similar issue as mentioned here, where I need to define multiple types at root level with their own structure. Is there any update on this issue (last update is from June, 2019). In case, this is still under deferment, please let me know of any workaround for defining unreleted types at root level?