digitalbazaar/jsonld.js — Issue #1: Framing deals with compaction strangely
Author: msporny
Created: 2011-11-09 00:37:56+00:00
State: open

Using this frame:

[{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"ex": "http://example.org/vocab#"
},
"@type": "ex:Library"
}]

On this input:

{
"@context": {
"@coerce": {
"ex:contains": "@iri"
},
"dc": "http://purl.org/dc/elements/1.1/",
"ex": "http://example.org/vocab#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@subject": [
{
"@subject": "http://example.org/library",
"@type": "ex:Library",
"ex:contains": "http://example.org/library/the-republic"
}, {
"@subject": "http://example.org/library/the-republic",
"@type": "ex:Book",
"dc:creator": "Plato",
"dc:title": "The Republic",
"ex:contains": "http://example.org/library/the-republic#introduction"
},
{
"@subject": "http://example.org/library2",
"@type": "ex:Library",
"ex:contains": "http://example.org/library/the-republic"
},
{
"@subject": "http://example.org/library/the-republic#introduction",
"@type": "ex:Chapter",
"dc:description": "An introductory chapter on The Republic.",
"dc:title": "The Introduction"
}]
}

Results in expanded output... but taking the square brackets away from the frame results in compacted output. People are expecting the output to always be compacted.