Sha256: 047bf0addf7b9d64120170f9a25112fbd73c2e3d5bac1f3a91b530d812488b49
Contents?: true
Size: 936 Bytes
Versions: 28
Compression:
Stored size: 936 Bytes
Contents
module SPARQL; module Algebra class Operator ## # The SPARQL logical `not` operator. # # @example # (! ?x) # (not ?x) # # @see http://www.w3.org/TR/xpath-functions/#func-not class Not < Operator::Unary include Evaluatable NAME = [:'!', :not] ## # Returns the logical `NOT` (inverse) of the operand. # # Note that this operator operates on the effective boolean value # (EBV) of its operand. # # @param [RDF::Literal::Boolean] operand # the operand # @return [RDF::Literal::Boolean] `true` or `false` # @raise [TypeError] if the operand could not be coerced to a boolean literal def apply(operand) case bool = boolean(operand) when RDF::Literal::Boolean RDF::Literal(bool.false?) else super end end end # Not end # Operator end; end # SPARQL::Algebra
Version data entries
28 entries across 28 versions & 1 rubygems