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

SPARQL: SUM fails sometimes, because it is rounding #3

Closed
k00ni opened this issue Jan 29, 2021 · 0 comments
Closed

SPARQL: SUM fails sometimes, because it is rounding #3

k00ni opened this issue Jan 29, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@k00ni
Copy link
Member

k00ni commented Jan 29, 2021

original from: semsol/arc2#100


Given the following RDF:

@prefix : <http://www.example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:ints :int 1, 2, 3 .
:decimals :dec 1.0, 2.2, 3.5 .
:doubles :double 1.0E2, 2.0E3, 3.0E4 .
:mixed1 :int 1 ; :dec 2.2 .
:mixed2 :double 2E-1 ; :dec 2.2 .

The following query:

PREFIX : <http://www.example.org/>
SELECT (SUM(?o) AS ?sum)
WHERE {
	?s :dec ?o
}

should return:

array {
  'variables' => array { "sum" }
  'rows' => array {
    array {
      'sum' => "11.1"
      'sum type' => 'literal"
    }
  }
}

but returns

array {
  'variables' => array { "sum" }
  'rows' => array {
    array {
      'sum' => "11" // <=============== problem
      'sum type' => 'literal"
    }
  }
}
@k00ni k00ni added the bug Something isn't working label Jan 29, 2021
@k00ni k00ni closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant