Class: ConceptQL::GraphNodifier

Inherits:
Object
  • Object
show all
Defined in:
lib/conceptql/graph_nodifier.rb

Defined Under Namespace

Classes: BinaryOperatorNode, DefineNode, DotNode, RecallNode, VsacNode

Constant Summary collapse

BINARY_OPERATOR_TYPES =
%w(before after meets met_by started_by starts contains during overlaps overlapped_by finished_by finishes coincides except person_filter less_than less_than_or_equal equal not_equal greater_than greater_than_or_equal filter).map { |temp| [temp, "not_#{temp}"] }.flatten.map(&:to_sym)

Instance Method Summary collapse

Instance Method Details

#create(type, values, tree) ⇒ Object



157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/conceptql/graph_nodifier.rb', line 157

def create(type, values, tree)
  if BINARY_OPERATOR_TYPES.include?(type)
    return BinaryOperatorNode.new(type, values)
  elsif type == :define
    return DefineNode.new(type, values).tap { |n| n.tree = self }
  elsif type == :recall
    return RecallNode.new(type, values).tap { |n| n.tree = self }
  elsif type == :vsac
    types = values.pop
    return VsacNode.new(type, values, types)
  end
  DotNode.new(type, values)
end

#typesObject



153
154
155
# File 'lib/conceptql/graph_nodifier.rb', line 153

def types
  @types ||= {}
end