-
Notifications
You must be signed in to change notification settings - Fork 34
Recursively nested properties and compaction #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I attempted a similar thing, and I think it could, in theory, only work by declaring one of the nests as nested within the other, e.g.: "n1": "@nest",
"n2": {"@id": "@nest", "@nest": "n1"} But the compaction algorithm doesn't support that. |
No, one level only. Basically, when compacting, we match to the term "baz" and see that it is nested on "n2". There is nothing to say that "n2" is, itself, nested under "n1". In theory, (but I don't believe in practice), you might use the following context: {
"@context": {
"foo": "http://example.org/foo",
"bar": {"@id": "http://example.org/bar", "@nest": "n1"},
"baz": {"@id": "http://example.org/baz", "@nest": "n2"},
"n1": "@nest",
"n2": {"@id": "@nest", "@nest": "n1"}
},
"foo": "FOO",
"n1": {
"bar": "BAR",
"n2": {
"baz": "BAZ"
}
}
} But, the processing rules don't allow that. |
This issue was discussed in a meeting.
View the transcriptRecursive Nesting and CompactionRob Sanderson: #391 Rob Sanderson: Next one is related by pchampin. Pierre-Antoine Champin: This issue is just to check that recursively nested properties are … after round-tripping. … I didn’t suggest any change. This can be closed. This was just to support my other arguments in the previous issue. Gregg Kellogg: We should also defer this, rather than close. Proposed resolution: Defer #391 on recursively nested properties to future version as new feature that can be experimented with (Rob Sanderson) Gregg Kellogg: +1 Rob Sanderson: +1 Pierre-Antoine Champin: +1 David I. Lehn: +1 Ruben Taelman: +1 Tim Cole: +1 Harold Solbrig: +1 Resolution #2: Defer #391 on recursively nested properties to future version as new feature that can be experimented with 3. |
Hello, What could I do if I must have Recursively nested properties in my json-ld, is there a workaround or a trick :)? Thanks
|
@MajdT51 without a context in your data, and a description of what you are trying to achieve with it, it is hard to understand exactly what you question is... |
Thanks @pchampin ,
So basically it is a recursive nested object "nameType" inside object "data". And I'm using this context
However, it is seems not to be valid and pyld shows me this error As I understood this is not possible now with json-ld 1.1 :( is this correct and are there any workarounds? |
the two lines |
Following the discussion in #380, I have a question:
Consider the following data:
Can I expand it and compact it back to the same shape (including the doubly-nested property
baz
)?I gave it a try there but with no luck.
If this is indeed impossible, I'm not suggesting we should fix it now. But I'm trying to decide how bad it is if we introduce an asymmetry between expansion and compaction wrt nested properties in #388. If it appears that the asymetry is already there (in the example above), that would help be byte the bullet.
The text was updated successfully, but these errors were encountered: