Skip to content

Commit

Permalink
CONCAT() without parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Nov 6, 2023
1 parent 59ffbde commit 23d47be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/sparql/algebra/operator/concat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class Concat < Operator
def evaluate(bindings, **options)
ops = operands.map {|op| op.evaluate(bindings, **options.merge(depth: options[:depth].to_i + 1))}

# rdf:nil is like empty string
if ops == [RDF.nil]
return RDF::Literal.new("")
end

raise TypeError, "expected all plain literal operands" unless ops.all? {|op| op.literal? && op.plain?}

ops.inject do |memo, op|
Expand Down

0 comments on commit 23d47be

Please sign in to comment.