Closed gkellogg closed 5 years ago
:+1: to the use case. Have you tried implementing a solution to this, @gkellogg ?
I generally implement things before considering a specification update, and I'll take a look, in due course. (Unless, of course @dlongley or @davidlehn beat me to it!).
Resolution on the WG call of 2018-09-14 was to accept this issue as valid and valuable, and to seek additional implementation experience for potential solutions.
So, this ends up running afoul of the general framing algorithm. When framing a property with a node value, it looks for a frame associated with the property, if there is none, it constructs one using @embed
, @explicit
and @requireAll
:
From Framing 4.4.2.3.2:
... If frame does not exist, create a new frame using a new dictionary with properties for
@embed
,@explicit
and@requireAll
taken from embed, explicit and requireAll.
The requested logic would require us to construct a new frame based on properties of the existing frame, which could have wide implications.
The best we can do without radical changes would be to make the sub-frames explicit (playground):
{
"@context" : {
"@vocab" : "http://purl.bdrc.io/ontology/core/",
"taxSubclassOf" : {
"@id" : "http://purl.bdrc.io/ontology/core/taxSubclassOf",
"@type" : "@id"
},
"bdr" : "http://purl.bdrc.io/resource/",
"children": { "@reverse": "http://purl.bdrc.io/ontology/core/taxSubclassOf" }
},
"@id" : "bdr:O9TAXTBRC201605",
"children": {
"children": {
"children": {}
}
}
}
This generates the following, with backwards and forwards links:
{
"@context" : {
"@vocab" : "http://purl.bdrc.io/ontology/core/",
"taxSubclassOf" : {
"@id" : "http://purl.bdrc.io/ontology/core/taxSubclassOf",
"@type" : "@id"
},
"bdr" : "http://purl.bdrc.io/resource/",
"children": { "@reverse": "http://purl.bdrc.io/ontology/core/taxSubclassOf" }
},
"@id" : "bdr:O9TAXTBRC201605",
"children": [{
"@id": "bdr:O9TAXTBRC201605_0001",
"@type": "Taxonomy",
"taxSubclassOf": "bdr:O9TAXTBRC201605",
"children": {
"@id": "bdr:O9TAXTBRC201605_0002",
"@type": "Taxonomy",
"taxSubclassOf": "bdr:O9TAXTBRC201605_0001"
}
}, {
"@id": "bdr:O9TAXTBRC201605_0010",
"@type": "Taxonomy",
"taxSubclassOf": "bdr:O9TAXTBRC201605"
}]
}
(Note that unused repetitions of "children" are ignored if there are no children).
This seems like an acceptable solution to me requiring no change.
This issue was discussed in a meeting.
RESOLVED: Add a note to the framing spec about the asymmetry, and longer explanation with examples in the primer document for issue framing#5 on @reverse recursion
Moved to Editorial given Resolution above.
From json-ld/json-ld.org#653
It would be nice to have the same possiblity of infinite recursion in the
@reverse
properties as there are in non-reverse ones (example), currently recursion only works as many times as the frame defines it (example).Copy/pasting the examples (and removing
@context
s):in the working case, I have
and frame
that produces the nice
but for the opposite:
and the frame
I'm not getting all the recursion, only