Closed jitsedesmet closed 1 year ago
This seems to resolve the problem. Query:
SELECT (MIN(?of) as ?min) (MAX(?of) as ?max)
where {
?p ?o ?of.
}
over:
<http://example.com/apple> <http://www.w3.org/2001/XMLSchema#datePred> "2010-06-21+08:00"^^<http://www.w3.org/2001/XMLSchema#date>.
<http://example.com/pear> <http://www.w3.org/2001/XMLSchema#datePred> "2010-06-21-08:00"^^<http://www.w3.org/2001/XMLSchema#date>.
gives:
[
{"max":"\"2010-06-21-08:00\"^^http://www.w3.org/2001/XMLSchema#date","min":"\"2010-06-21+08:00\"^^http://www.w3.org/2001/XMLSchema#date"}
]
This PR aims to resolve https://github.com/comunica/comunica/issues/1212. According to the spec, Min and Max should make use of the SPARQL ORDER BY ordering definition. I assume sparqlee implements this in
Ordering.ts
(Both the spec and the implementation are wild to me, so please correct me if this assumption is wrong).~The issue also makes me wonder whether there are problems regarding
date
(and similar types) within the other aggregators, since all aggregators call thetypedValue
of a literal. Before https://github.com/comunica/sparqlee/pull/163 this was always some basic JS type (if I recall correctly), but now there are also object typedValues, these do not implement the+
operator for example.~ The other aggregators do call the regularFunctions so should work.