class SPARQL::Algebra::Operator::UCase
The SPARQL
logical `ucase` operator.
@example
(ucase ?x)
@see www.w3.org/TR/sparql11-query/#func-ucase @see www.w3.org/TR/xpath-functions/#func-ucase
Constants
- NAME
Public Instance Methods
apply(operand, **options)
click to toggle source
The LCASE function corresponds to the XPath fn:lower-case function. It returns a string literal whose lexical form is the lower case of the lexcial form of the argument.
@param [RDF::Literal] operand
the operand
@return [RDF::Literal] literal of same type @raise [TypeError] if the operand is not a literal value
# File lib/sparql/algebra/operator/ucase.rb, line 23 def apply(operand, **options) case operand when RDF::Literal then RDF::Literal(operand.to_s.upcase, datatype: operand.datatype, language: operand.language) else raise TypeError, "expected an RDF::Literal::Numeric, but got #{operand.inspect}" end end