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

Literals in SPARQL returned with incorrect type. #1817

Open
Aklakan opened this issue Feb 18, 2025 · 0 comments
Open

Literals in SPARQL returned with incorrect type. #1817

Aklakan opened this issue Feb 18, 2025 · 0 comments

Comments

@Aklakan
Copy link

Aklakan commented Feb 18, 2025

Qlever incorrectly returns numeric literals as xsd:int instead of xsd:integer. Not sure if this is an issue of the parser or the query processor.

SELECT (DATATYPE(?x) AS ?dt) { BIND(1 AS ?x) }

Actual result:

dt
http://www.w3.org/2001/XMLSchema#int

Expected result:

dt
http://www.w3.org/2001/XMLSchema#integer

The reason this is an issue is that it results in unexpectedly empty result sets when e.g. having a join with basic federation between a conforming system and qlever - i.e. term equality then no longer holds:

Example

SELECT * { #
  BIND(1 AS ?x) # conforming system that uses xsd:integer
  SERVICE <http://qlever.service/sparql> {
    BIND(1 AS ?x) # qlever that uses xsd:int
  }
}

Further issue:

  • 1.3 becomes xsd:double, should be xsd:decimal

From the SPARQL Spec:

Examples of literal syntax in SPARQL include:
...
1, which is the same as "1"^^xsd:integer
1.3, which is the same as "1.3"^^xsd:decimal
1.300, which is the same as "1.300"^^xsd:decimal
1.0e6, which is the same as "1.0e6"^^xsd:double

@Aklakan Aklakan changed the title Integer literals in SPARQL returned with incorrect type. Literals in SPARQL returned with incorrect type. Feb 18, 2025
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

No branches or pull requests

1 participant