- From: Jindřich Mynarz <mynarzjindrich@gmail.com>
- Date: Thu, 15 Jan 2015 17:55:59 +0100
- To: public-linked-json@w3.org
Received on Thursday, 15 January 2015 16:56:47 UTC
Hi, is it possible to use JSON-LD API to coerce number-like strings into native JSON numbers (http://www.w3.org/TR/json-ld/#dfn-number)? The section of the specification on type coercion (http://www.w3.org/TR/json-ld/#type-coercion) seems to suggest that this is possible, but so far I haven't realized how. For example, is it possible to coerce the values of the "age" attribute to numbers in the following JSON-LD? { "@context": { "@vocab": "http://xmlns.com/foaf/0.1/", "xsd": "http://www.w3.org/2001/XMLSchema#", "age": { "@type": "xsd:integer" } }, "age": "42" } Setting a numeric datatype (such as xsd:integer) for the property via @type in @context doesn't do the job. Is there a way to go about this? Best, Jindřich -- http://mynarz.net/#jindrich
Received on Thursday, 15 January 2015 16:56:47 UTC