W3C home > Mailing lists > Public > public-linked-json@w3.org > July 2012

Possible value types in JSON-LD?

From: François Daoust <francois@joshfire.com>
Date: Tue, 17 Jul 2012 16:51:31 +0200
Message-ID: <CAFZhi7wx-6D4=FHuRdDuG14hNiS5DDYqHJQqTsk8ft1kiQThSQ@mail.gmail.com>
To: Linked JSON <public-linked-json@w3.org>

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

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


[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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:53:20 UTC