On 12/01/17 03:35, Conal Tuohy wrote:
On 12 January 2017 at 12:34, Grahame Grieve <
[email protected]> wrote:
Consider this JSON-LD:
{
"@type": "fhir:Claim",
"@id": "http://hl7.org/fhir/Claim/760152",
"Quantity.value": {
"decimal": 123.45
}
"@context": {
"fhir": "http://hl7.org/fhir/",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"decimal": {
"@id": "fhir:value",
"@type": "xsd:decimal"
}
"Quantity.value": {
"@id": "http://hl7.org/fhir/Quantity.value"
}
}
}
This is valid,
No, it's not valid. Paste it into http://json-ld.org/playground/ and see
but Jena logs an error: WARNING: Lexical form '1.2345E2' not
valid for datatype http://www.w3.org/2001/XMLSchema#decimal
I think this is a bug in Jena - or JsonLD-java?
Maybe there is a bug there, maybe not, but you need to get your JSON-LD
correct first.
Agreed.
Also, in JSON, a bare number is a long or double, not decimal, so try
putting in the lexical form in a string:
>> "Quantity.value": {
>> "decimal": 123.45
"decimal": "123.45"
http://json-ld.org/spec/latest/json-ld/#dfn-number
[[
a number is equivalent to either a long or double, depending on if the
number has a non-zero fractional part
]]
Andy