sparna-git / skos-play

SKOS-Play allows to print SKOS files in HTML or PDF. It also embeds xls2rdf to generate RDF from Excel.
http://labs.sparna.fr/skos-play
GNU Lesser General Public License v3.0
66 stars 12 forks source link

datatype xsd:double is not added unless value is quoted #81

Closed EmidioStani closed 1 year ago

EmidioStani commented 1 year ago

Hello @tfrancart ,

when converting from spreadsheet, if the column has datatype xsd:double ( for example qudt:value^^xsd:double) and I have numeric value (240) then the datatype is not added to the value (240^^xsd:double), instead the numeric value is converted to double format (2.4E2) .

Is this expected behaviour ?

tfrancart commented 1 year ago

Hello Emidio, could you provide a minimal Excel input file demonstrating this behavior, as a reproductible test ? I am not sure this is the intended behavior, although I am sure that a difference between xsd:double and xsd:float or xsd:decimal is that xsd:decimal supports scientific notification. Thanks

EmidioStani commented 1 year ago

Hello @tfrancart ,

yes you can find the spreadsheet in attachment. demo_data_excel2skos (42).xlsx

However, I noticed this is related to the Turtle serialization, indeed in RDF4J, as for version 3.7.0 (May 2021), it has been introduced a setting (ABBREVIATE_NUMBERS) to disable abbreviations (in addition to other settings ), see issue https://github.com/eclipse/rdf4j/issues/2886.

When converting from RDF/XML (generated from Skos-Play!) to Turtle, I notice that the conversion to scientific notation is applied to:

however with:

the data type is added without altering the value, so I could have a workaround there.

It would be nice to have such settings that you could pass as parameters.

tfrancart commented 1 year ago

Thanks ! indeed this is related to Turtle serialisation, and the RDF/XML variant does not use scientific notation:

image

We still rely on RDF4J 2.5.4, probably time to upgrade !

tfrancart commented 1 year ago

Hello @EmidioStani this is now fixed !

image

EmidioStani commented 1 year ago

Thanks, it is solved !