Possible value types in JSON-LD?

Hi,

I was looking at the JSON-LD Syntax spec and realized that I could not
easily answer the question: "can I directly use a number as value in
JSON-LD?" looking at the spec. All the examples in the JSON-LD Syntax
spec use string values, including those in the "Type coercion" section
[1]:

The only example I could find that uses a number as value is Example
25 in the "Data Round Tripping" section of the JSON-LD API spec [2]:
{
 "@context": {
  "number": {
   "@id": "http://example.com/vocab#number",
   "@type": "xsd:nonNegativeInteger"
  }
 },
 "number" : 42
}

Could one of the examples in the syntax spec use values that are not
strings (namely number and boolean) to clarify that developers do no
need to convert such values into strings?

Also, the spec borrows terms definitions from JSON, including number,
null, and true and false, but I do not see a definition for "value"
[3]. Do I miss something? Or is it already covered by one of the
remaining open issues (e.g. JSON-LD grammar or alignment with RDF
terms?)

Thanks,
Francois.

[1] http://json-ld.org/spec/latest/json-ld-syntax/#type-coercion
[2] http://json-ld.org/spec/latest/json-ld-api/#data-round-tripping
[3] http://json-ld.org/spec/latest/json-ld-syntax/#how-to-read-this-document

Received on Tuesday, 17 July 2012 14:52:03 UTC