The actual values show that the ASC(?b) order seems to be ignored.
Looking at the code in lib/sparql/algebra/operator/order.rb, I believe the error is at the lines 37-54:
operand(0).inject(false) do |memo, op|
debug(options) {"(order) #{op.inspect}"}
memo ||= begin
# CODE
comp == 0 ? false : comp
end
end || 0 # They compare equivalently if there are no matches
Shouldn't it be:
operand(0).inject(0) do |memo, op|
debug(options) {"(order) #{op.inspect}"}
memo = begin
# CODE
comp
end
end if memo == 0
Does the false value have a specific meaning for comp? (it is used as the initial value and the value used in case of equality in the block, but overwritten by the || operator)
Hello,
I believe the current implementation of the ORDER operator only takes into account the first ordering command.
I've made a small script to try and reveal the issue:
When executing this script, I get this:
The actual values show that the ASC(?b) order seems to be ignored.
Looking at the code in
lib/sparql/algebra/operator/order.rb
, I believe the error is at the lines 37-54:Shouldn't it be:
Does the
false
value have a specific meaning for comp? (it is used as the initial value and the value used in case of equality in the block, but overwritten by the || operator)