json-ld.org
json-ld.org copied to clipboard
compacting nested values
Hello, considering an expanded json-ld in the form
"http://example.com/vocab/wake": [
{
"http://example.com/vocab/minutes": [
{
"@value": 15
}
]
}
]
what should I have in the compaction context to have something like:
"wake" : 15
thanks for the help
Can't do that, I'm afraid. You can use Property Nesting to expand to that form, more or less.
{
"@context": {
"@vocab": "http://example.org/",
"minutes": {"@nest": "wake"},
"wake": "@nest"
},
"wake": {
"minutes": 15
}
}
Expands to:
[
{
"http://example.org/minutes": [
{
"@value": 15
}
]
}
]