Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-05 Thread James Agnew
On the Java side, parsing and encoding of FHIR primitives into XML is all hand rolled, so no xs:decimal. I'm not sure what the concern is, but if there are any specific areas of concern I'm always hunting for new unit tests... James On Tue, Aug 4, 2015 at 2:15 AM, Paul A. Knapp wrote: > Are eit

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-05 Thread James Agnew
According to the spec, Json/Javascript numbers are 64 bit floats (IEEE 754) . Out of the box I would suspect that most libraries do not preserve precision since floats don't. Most libraries I've worked with at least have workarounds though t

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-05 Thread James Agnew
Hi David, Precision is preserved in JSON as well. Needing to behave consistently across encodings was actually the main reason for rolling our own primitives. Cheers, James On Tue, Aug 4, 2015 at 2:29 PM, David Booth wrote: > Hi James, > > What about for FHIR JSON? Would 1.200 in FHIR JSON s

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Grahame Grieve
Correct. javascript does not retain the precision Grahame On Wed, Aug 5, 2015 at 6:53 AM, Andy Stechishin wrote: > James, > > Am I correct in thinking that Javascript does employ a library to do JSON, > it is part of the language and as such, would not retain precision using > the current form

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread David Booth
Hi James, What about for FHIR JSON? Would 1.200 in FHIR JSON silently become 1.2, or do you also perform custom FHIR JSON parsing to retain the trailing digits? David On 08/04/2015 06:00 AM, James Agnew wrote: On the Java side, parsing and encoding of FHIR primitives into XML is all hand

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Lloyd McKenzie
I think we also need to note that tools manipulating the data using xpath or xquery (even when non-schema aware) will risk losing precision. *Lloyd McKenzie*, P.Eng. Senior Consultant, Information Technology Services Gevity Consulting Inc. E: lmcken...@gevityinc.com M: +1 587-334-1110 <1-587-334

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread David Booth
Sorry, I should have included a pointer to the context of this discussion: http://www.w3.org/2015/07/28-hcls-minutes.html#item04 The question was not about Java in general, but about the FHIR reference implementations that are written in Java (and in C#). The action was to find out whether thos

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Lloyd McKenzie
This particular conversation began around what we should do for RDF - which then involved what was being done elsewhere. One possibility is using schema 1.1, but there aren't many (any?) reasoners that support it. Going with string means we lose the ability to do math. Splitting out precision a

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Grahame Grieve
no, that's not where the conversation began. It began in schema. I don't know what would be right in RDF Grahame On Tue, Aug 4, 2015 at 11:42 PM, Lloyd McKenzie wrote: > And presumably take the same approach when we generate the RDF - which is > where the conversation began :) > > > *Lloyd McK

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Lloyd McKenzie
And presumably take the same approach when we generate the RDF - which is where the conversation began :) *Lloyd McKenzie*, P.Eng. Senior Consultant, Information Technology Services Gevity Consulting Inc. E: lmcken...@gevityinc.com M: +1 587-334-1110 <1-587-334-1110> W: gevityinc.com *GEVITY*

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Grahame Grieve
yes. It appears that for some tool stacks, the code generation schemas might need to use xs:string instead of xs:decimal - but not others. So I think that we should make a note about this in the code generation schemas. Grahame On Tue, Aug 4, 2015 at 11:36 PM, Lloyd McKenzie wrote: > I think t

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Oliver Ruebenacker
Hello, "Java uses BigDecimal"? You mean, it is available in Java. More relevantly, it is supported by some libs like Sesame (e.g. through Literal.decimalValue). Best, Oliver On Mon, Aug 3, 2015 at 11:55 PM, David Booth wrote: > Regarding the above action, and last week's discussion

Re: ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-04 Thread Lloyd McKenzie
I think the question is whether someone using code that's generated from the schema (as opposed to a reference implementation) is going to be in trouble because we use the xs:decimal type. *Lloyd McKenzie*, P.Eng. Senior Consultant, Information Technology Services Gevity Consulting Inc. E: lmcke

ACTION: Lloyd to ask James and Ewot about the underlying precision retention of xsd:decimal values

2015-08-03 Thread David Booth
Regarding the above action, and last week's discussion of xsd:decimal, Lloyd reports: "Java uses BigDecimal - so full retention of precision. C# uses decimal, which also retains precision." David Booth