class RDF::N3::Algebra::Log::Conjunction

A function to merge formulae: logical AND.

The subject is a list of formulae. The object, which can be generated, is a formula containing a copy of each of the formulae in the list on the left. A cwm built-in function.

Constants

NAME
URI

Public Instance Methods

input_operand() click to toggle source

Return subject operand.

@return [RDF::Term]

# File lib/rdf/n3/algebra/log/conjunction.rb, line 32
def input_operand
  operands.first
end
resolve(list) click to toggle source

Evaluates this operator by creating a new formula containing the triples from each of the formulae in the list.

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

# File lib/rdf/n3/algebra/log/conjunction.rb, line 16
def resolve(list)
  form = RDF::N3::Algebra::Formula.new(graph_name: RDF::Node.intern(list.hash)) 
  log_debug(NAME, "list hash") {form.graph_name}

  list.each do |f|
    form.operands.push(*f.operands)
  end
  form = form.dup
  log_info(NAME, "result") {SXP::Generator.string form.to_sxp_bin}
  form
end