Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section 6.6.1 Automatically deriving datatypes is underspecified #91

Open
chrdebru opened this issue Feb 16, 2024 · 7 comments · May be fixed by #144
Open

Section 6.6.1 Automatically deriving datatypes is underspecified #91

chrdebru opened this issue Feb 16, 2024 · 7 comments · May be fixed by #144
Assignees

Comments

@chrdebru
Copy link
Contributor

Section "6.6.1 Automatically deriving datatypes" is underspecified. The test cases assume that all values are string literals. The spec does mention automatically deriving datatypes for SQL with no "conversion tables" as specified in R2RML.

Proposal 1:

  • all values are string literals when they are returned.
  • only allow data type derivation when using rml-io.
  • do we return values as they appear or return a string representation of normalized values (JSON allows 3.4e-5 and 3.4e-5, for example)?

Proposal 2:

  • "copy/paste" R2RML's SQL derivations
  • plain CSV --> all strings
  • JSON --> string, integer, double (because of exponents)
  • XML --> based on XSD if available
  • And the rest defined in rml-io?

Proposal 2 would then allow 6.6.1 be rewritten as

"rml-core does not support the automatic derivation of data types and mappings should explicitly include data type mappings if one wishes to generate literals other than xsd:string. The generation of derived data types is supported and specified by the rml-io specification."

@pmaria
Copy link
Collaborator

pmaria commented Feb 16, 2024

Strong preference for proposal 2.
My preference would be to introduce separate notes for each reference formulation wherein these details can be described.

@chrdebru
Copy link
Contributor Author

chrdebru commented Feb 16, 2024

Then that means that some test cases need to be adapted (e.g., some JSON values have integer values that should be transformed as such). And somebody creating those notes, of course.

@dachafra
Copy link
Member

Strong preference for proposal 2.
My preference would be to introduce separate notes for each reference formulation wherein these details can be described.

+1

@DylanVanAssche
Copy link
Collaborator

+1 for proposal 2

@bjdmeest
Copy link
Member

+1 for proposal 2, but in line with the respective specs, JSON has following primitive types:

  • strings -> xsd string
  • numbers -> xsd double (or float? I would not suggest to specify integer IF parses as integer OR double IF parses as double, you can override the datatype in RML)
  • booleans --> xsd bool
  • null: NULL

for XML: why not take over the datatype as specified in XML (sure it'll be XSD in most cases, but all other cases should also be covered no?)

@chrdebru
Copy link
Contributor Author

The datatype for XML without a schema would be a string and one of the schemas if it can be looked up. XML data types only "exist" in the schema. XML DTDs, another XML schema language, only has character data which are strings. The problem, however, is that you then have two cases:

  • the XSD is referred to AND available (for download)
  • basic case when no schema is available

I believe core should support the basic case, and IO could handle both

@dachafra
Copy link
Member

dachafra commented Jul 5, 2024

I feel this issue is already being addressed in the rml-io-registry repository, right? Or do we want a default/basic behaviour in the rml-core? @pmaria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants