- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Tue, 17 Jul 2012 19:04:22 +0200
- To: "'Gregg Kellogg'" <gregg@greggkellogg.net>, 'François Daoust' <francois@joshfire.com>
- Cc: "'Linked JSON'" <public-linked-json@w3.org>
I removed it as automatic typing was moved to the from/to RDF algorithms.
Furthermore we discussed to make the automatic type coercion configurable
[1] - which we kind of forgot I think to discuss further I think. I planned
to spend some time on the specs the next days.. I'll add some prose to
clarify this. Thanks for noticing this François!
[1] https://github.com/json-ld/json-ld.org/issues/100#issuecomment-5442379
--
Markus Lanthaler
@markuslanthaler
> -----Original Message-----
> From: Gregg Kellogg [mailto:gregg@greggkellogg.net]
> Sent: Tuesday, July 17, 2012 6:46 PM
> To: François Daoust
> Cc: Linked JSON; Markus Lanthaler
> Subject: Re: Possible value types in JSON-LD?
>
> There used to be something in there about this [1], but it seems to
> have been lost at some point.
>
> [[[
> A value with an associated type, also known as a typed value, is
> indicated by associating a value with an IRI which indicates the
> value's type. Typed values may be expressed in JSON-LD in three ways:
>
> • By utilizing the @type keyword when defining a term within a
> @context section.
> • By utilizing the expanded form for specifying objects.
> • By using a native JSON type.
> ]]]
>
> Looks like it was done in this commit by Markus [2]. Markus, do you
> recall why this was removed?
>
> Gregg
>
> [1] http://json-ld.org/spec/ED/json-ld-syntax/20120522/#typed-values
> [2] https://github.com/json-ld/json-
> ld.org/commit/9fc8cadfc6f05fbbf5d0c18216e688b5da53949e
>
> On Jul 17, 2012, at 7:51 AM, François Daoust wrote:
>
> > 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 17:04:57 UTC