SPARQL-Anything / sparql.anything

SPARQL Anything is a system for Semantic Web re-engineering that allows users to ... query anything with SPARQL.
https://sparql-anything.cc/
Apache License 2.0
217 stars 11 forks source link

extracting datetimes from spreadsheet cells (from discussion #481) #482

Closed luigi-asprino closed 5 months ago

luigi-asprino commented 5 months ago

Discussed in https://github.com/SPARQL-Anything/sparql.anything/discussions/481

Originally posted by **sgoetz-brox** May 29, 2024 When entering these values in an XLSX file (without manually changing the cell formatting; in a locale that uses `,` as decimal separator): ``` foo 23 23.0 23.42 23,42 2024-05-29 29.05.24 ``` I’m getting this output with SPARQL Anything: ``` "foo" "23.0"^^xsd:double "23.0" "23.42" "23.42"^^xsd:double "45441.0"^^xsd:double "45441.0"^^xsd:double ``` Instead, I would like to get everything as string (`xsd:string`), just like it’s _displayed_ in Excel/LibreCalc, i.e.: ``` "foo" "23" "23.0" "23.42" "23,42" "2024-05-29" "29.05.24" ``` When changing the formatting of a column to "Text" and entering the values again, I’m getting the desired output. But when converting an existing column, it still seems to convert the two dates into (I suppose) Excel’s own number representation. Anyway, I would like to avoid changing the input file, if possible.
luigi-asprino commented 5 months ago

The test failed as Github worker is set on a different timezone. The timezone of the extracted date needs to be set explicitly when creating the datetime literal. By default, this is set to UTC (therefore any date extracted from a spreadsheet will be on this timezone).

luigi-asprino commented 5 months ago

Still not working due to a missing class in dependecy