json-ld/json-ld.org — Issue #56: Specify how terms are treated when they are not specified in the context
Author: lanthaler
Created: 2012-01-12 13:24:40+00:00
State: open

The [syntax spec currently says that](http://json-ld.org/spec/latest/json-ld-syntax/#linking-data):

> JSON-LD defines a mechanism to map JSON terms, i.e., keys and values, to IRIs. This does not mean that JSON-LD requires every key or value to be an IRI, but rather ensures that keys and values can be mapped to IRIs if the developer desires to transform their data into Linked Data.

And I think it is a design decision that we allow mixing plain old JSON with linked JSON. Nevertheless, according to the API spec a key is *always* converted to an IRI even if that means to interpret the value directly as an IRI. For example the following JSON-LD document:

{
"@context": { "foaf": "http://xmlns.com/foaf/0.1/" },
"data": [
{
"@id": "_:bnode1",
"@type": "foaf:Person",
"foaf:homepage": "http://example.com/bob/",
"foaf:name": "Bob"
},
{
"@id": "_:bnode2",
"@type": "foaf:Person",
"foaf:homepage": "http://example.com/eve/",
"foaf:name": "Eve"
},
{
"@id": "_:bnode3",
"@type": "foaf:Person",
"foaf:homepage": "http://example.com/manu/",
"foaf:name": "Manu"
}
]
}

where "data" was intentionally not mapped to an IRI is translated to the following Turtle document:

_:c14n0

_:c14n1,
_:c14n2,
_:c14n3.
_:c14n1
"http://xmlns.com/foaf/0.1/Person";
"http://example.com/bob/";
"Bob".
_:c14n2
"http://xmlns.com/foaf/0.1/Person";
"http://example.com/eve/";
"Eve".
_:c14n3
"http://xmlns.com/foaf/0.1/Person";
"http://example.com/manu/";
"Manu".