class ConceptQL::Operators::Recall

Mimics using a variable that has been set via “define” operator

The idea is that a concept might be very complex and it helps to break that complex concept into a set of sub-concepts to better understand it.

This operator will look for a sub-concept that has been created through the “define” operator and will fetch the results cached in the corresponding table

Public Instance Methods

annotate(db, opts = {}) click to toggle source
Calls superclass method ConceptQL::Operators::Operator#annotate
# File lib/conceptql/operators/recall.rb, line 38
def annotate(db, opts = {})
  @annotate ||= if valid?(db) && replaced?
    original.annotate(db, opts)
  else
    super
  end
end
domains(db) click to toggle source
# File lib/conceptql/operators/recall.rb, line 30
def domains(db)
  scope.domains(source, db)
end
original() click to toggle source
# File lib/conceptql/operators/recall.rb, line 46
def original
  nodifier.scope.fetch_operator(source)
end
query(db) click to toggle source
# File lib/conceptql/operators/recall.rb, line 26
def query(db)
  scope.from(db, source)
end
source() click to toggle source
# File lib/conceptql/operators/recall.rb, line 34
def source
  arguments.first
end

Private Instance Methods

replaced?() click to toggle source
# File lib/conceptql/operators/recall.rb, line 67
def replaced?
  options[:replaced]
end
validate(db, opts = {}) click to toggle source
Calls superclass method ConceptQL::Operators::Operator#validate
# File lib/conceptql/operators/recall.rb, line 52
def validate(db, opts = {})
  super
  if arguments.length == 1
    if scope.fetch_operator(source)
      scope.recall_dependencies[source].each do |d|
        if scope.recall_dependencies[d].include?(source)
          add_error("mutually referential recalls", d)
        end
      end
    else
      add_error("no matching label", source)
    end
  end
end