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
Remove @omitDefault? #41
Comments
I think the An example is here: digitalbazaar/jsonld.js#117 Though, sadly, the playground example is now partially broken because the user's context went away. But the basic idea there was that some property needed to be marked with |
This issue was discussed in a meeting.
View the transcriptRemove @omitdefaultRob Sanderson: link: #41 Gregg Kellogg: also: #46 Rob Sanderson: The first issue we discussed briefly last call before we realized we needed to talk a bit more about it. Gregg Kellogg: Another issue is to provide a better example for its use. … Of @omitDefault. … The issue is suggesting that @omitDefault is not particularly useful when you can just omit when using default. I think Dave had alluded to some examples where it was useful and that’s why there’s an issue open to highlight where it’s actually useful. … Otherwise we could remove it from the spec. … The only way to make a default is to use @default. Dave Longley: There’s a few ways to have a default. There’s an interaction with explicit. A default of null, if the property is specified but not present. Then output has a default value of null … sometimes you don’t want it with a value of null, but instead absent. … Also, if you had specified a default, and some other properties to have flags on them. … a case would be when you say ‘foo’ and you want to embed:always for foo. … [example] Gregg Kellogg: Ok, I think you’ve made a case for why it needs to be there. Having implemented it I still don’t understand the need for it. As long as you take on the responsibility of better documenting the use of @omitDefault. … If you can provide an example so we can adequately spec it that would be sufficient. Action #1: provide example in issue frame/41 of @omitdefault need (Dave Longley) |
Here's an example of where Suppose the following input: {
"@context": {
"@vocab": "http://example.org/",
"child": {"@type": "@id"}
},
"@graph": [
{
"@id": "http://example.org#John",
"@type": "Person",
"name": "John",
"child": "http://example.org#Jane"
},
{
"@id": "http://example.org#Jane",
"@type": "Person",
"name": "Jane"
}
]
} Suppose this frame (that does not have {
"@context": {
"@vocab": "http://example.org/",
"child": {"@type": "@id"}
},
"@type": "Person",
"child": {
"@embed": "@always"
}
} This is the framed output: {
"@context": {
"@vocab": "http://example.org/",
"child": {
"@type": "@id"
}
},
"@graph": [
{
"@id": "http://example.org#Jane",
"@type": "Person",
"child": null,
"name": "Jane"
},
{
"@id": "http://example.org#John",
"@type": "Person",
"child": {
"@id": "http://example.org#Jane",
"@type": "Person",
"name": "Jane"
},
"name": "John"
}
]
} Note that because the option {
"@context": {
"@vocab": "http://example.org/",
"child": {"@type": "@id"}
},
"@type": "Person",
"child": {
"@embed": "@always",
"@omitDefault": true
}
} Which yields this (desirable) output: {
"@context": {
"@vocab": "http://example.org/",
"child": {
"@type": "@id"
}
},
"@graph": [
{
"@id": "http://example.org#Jane",
"@type": "Person",
"name": "Jane"
},
{
"@id": "http://example.org#John",
"@type": "Person",
"child": {
"@id": "http://example.org#Jane",
"@type": "Person",
"name": "Jane"
},
"name": "John"
}
]
} |
The
@omitDefault
flag can be added to a frame to change the default value for theomit default flag
, which might be set totrue
through an API call. This keyword is of dubious value, since the frame can simply add@default
at all.Propose removing the keyword. We may also want to consider how important the runtime flag is.
The text was updated successfully, but these errors were encountered: