class RDF::N3::Algebra::Str::Concatenation

The subject is a list of strings. The object is calculated as a concatenation of those strings.

@example

("a" "b") string:concatenation :s

Constants

NAME
URI

Public Instance Methods

resolve(list) click to toggle source

The string:concatenation operator takes a list of terms cast to strings and either binds the result of concatenating them to the output variable, removes a solution that does equal the literal object.

List entries are stringified using [SPARQL::Algebra::Expression.cast](ruby-rdf.github.io/sparql/SPARQL/Algebra/Expression#cast-class_method).

@param [RDF::N3::List] list @return [RDF::Term] @see RDF::N3::ListOperator#evaluate

# File lib/rdf/n3/algebra/str/concatenation.rb, line 19
def resolve(list)
  RDF::Literal(
    list.to_a.map do |o|
      SPARQL::Algebra::Expression.cast(RDF::XSD.string, o)
    end.join("")
  )
end