Framing graphs

Thus far, framing has only been defined over the merged node set from a JSON-LD document. Issue #118 [1] has been an open issue for some time to add support for named graphs when framing, and to allow framing to consider only the default graph.

PR #438 [2] solves this, using an algorithm originally developed by Dave Longley. I’ve implemented as well in my Ruby JSON-LD processor.

A formatted version of the spec can be viewed here [3].

Basically, if you use @graph at the top level of a frame, it will frame the default graph, rather than the merged graph. Within a sub-frame, the use of @graph will cause framing to occur based on the name of the subject of the nodes that match that frame. For example:

{
  "@context": {"@vocab": "http://example.org/"},
  "@type": "Library",
  "contains": {
    "@graph": {"@type": "Book"}
  }
}

Frames the merge graph, and adds any nodes of type Book from some other graph as values of “contains”. This is used as an example in [3].

Please review and provide feedback by Monday November 28th. Without objection, I will merge this at that time.

Gregg Kellogg
gregg@greggkellogg.net

[1] https://github.com/json-ld/json-ld.org/issues/118
[2] https://github.com/json-ld/json-ld.org/pull/438
[3] https://rawgit.com/json-ld/json-ld.org/issue-118-graph-framing/spec/latest/json-ld-framing/index.html

Received on Sunday, 20 November 2016 23:55:49 UTC