Open azaroth42 opened 6 years ago
What do you think this might look like? Framing serves as a "program by example", and I'm not sure what such a frame might look like.
I can't recall what the issue was, closing :)
Ahha, and in coming back to an implementation, I recall the issue. It's related to https://github.com/w3c/json-ld-syntax/issues/19 and https://github.com/w3c/json-ld-api/issues/33.
Framing is a program-by-example or templating system, but it requires the absolute structure to be known from the root node down. We have a "Type" (or Concept, or Tag) that has a structure we'd like to see repeated every time it is referenced, but don't know all of the places in the structure where it might occur.
So we'd like the following to be able to be specified in a frame, without knowing the structure for property
, just to make a frame for resources that have a type
of Tag
:
{
"tag": {
"id": "http://example.org/tag1",
"type": "Tag",
"label": "example tag"
},
"property": {
"more_properties": {
"tag": {
"id": "http://example.org/tag1",
"type": "Tag",
"label": "example tag"
}
}
}
}
Rather than the second instance being just the URI.
In terms of potential syntax, the best I can come up with is a new keyword (I hear the groans from around the world) that would be a wildcard for properties. It can't be a second graph shape in @graph
as the processor wouldn't know which shape was the top, and which was the child template. It can't use @nest
as then you wouldn't be able to frame nested (structural, transparent) properties.
e.g. something like:
{
"@anywhere": {
"tag": {
"type": {"id": "Tag", "@embed": always"}
"label": {"@embed": "always"}
}
},
"property": { ... }
}
This issue was discussed in a meeting.
RESOLVED: Work on a proposal for solving framing#29 along the lines of embedded contexts / scoped contexts, but for embedded sub-frames {: #resolution3 .resolution}
This issue was discussed in a meeting.
RESOLVED: defer framing #29 to be discussed for inclusion in a future call
This issue was discussed in a meeting.
RESOLVED: Defer framing #29 until future WG
Since the @graph keyword (and using no @graph keyword) implies that "the absolute structure to be known from the root node down", then maybe using a @subgraph keyword would specifies a matching substructure (and might be used multiple times). Non-matching portions should be included "as is" from the input graph. This looks like a search and replace operation.
It would be useful to allow individual classes to have their own frames, such that a class which can appear at many points in the structure can be defined only once and then the definition inherited.
For example, a class like Type / Concept / Tag might appear anywhere in a structure associated with any other class. Currently (I believe) you would need to define all possible structures to ensure that the Type was framed consistently.