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

ARC2_Store::query: function AVG fails sometimes, because it is rounding up #99

Open
k00ni opened this issue Dec 15, 2017 · 0 comments
Open
Labels
bug sparql+ ARC2 version of SPARQL sparql 1.0

Comments

@k00ni
Copy link
Collaborator

k00ni commented Dec 15, 2017

I don't expect this issue to be solved soon, but i want to document it because i need it for a pull request.

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 (AVG(?o) AS ?avg)
WHERE {
	?s :dec ?o
}

should return:

array {
  'variables' => array { "avg" }
  'rows' => array {
    array {
      'avg' => "2.22"
      'avg type' => 'literal"
    }
  }
}

but returns

array {
  'variables' => array { "avg" }
  'rows' => array {
    array {
      'avg' => "2" // <=============== problem
      'avg type' => 'literal"
    }
  }
}
@k00ni k00ni changed the title ARC2_Store::query: AVG fails sometimes, because it is rounding up ARC2_Store::query: function AVG fails sometimes, because it is rounding up Dec 16, 2017
@k00ni k00ni added bug sparql 1.0 sparql+ ARC2 version of SPARQL labels May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sparql+ ARC2 version of SPARQL sparql 1.0
Projects
None yet
Development

No branches or pull requests

1 participant