Class: ConceptQL::Operators::Filter
- Inherits:
-
BinaryOperatorOperator
- Object
- Operator
- BinaryOperatorOperator
- ConceptQL::Operators::Filter
- Defined in:
- lib/conceptql/operators/filter.rb
Constant Summary
Constants inherited from Operator
Instance Attribute Summary
Attributes inherited from Operator
#arguments, #options, #upstreams, #values
Instance Method Summary collapse
Methods inherited from BinaryOperatorOperator
#display_name, #graph_it, #upstreams
Methods inherited from Operator
#columns, #evaluate, #initialize, #label, #select_it, #set_values, #sql, #stream, #types
Methods included from Metadatable
#allows_many_upstreams, #allows_one_upstream, #argument, #category, #desc, #humanized_class_name, #inherited, #just_class_name, #option, #predominant_types, #preferred_name, #reset_categories, #to_metadata, #types
Constructor Details
This class inherits a constructor from ConceptQL::Operators::Operator
Instance Method Details
#query(db) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/conceptql/operators/filter.rb', line 8 def query(db) rhs = right.evaluate(db) rhs = rhs.select_group(:person_id, :criterion_id, :criterion_type) query = db.from(Sequel.as(left.evaluate(db), :l)) query = query .left_join(Sequel.as(rhs, :r), l__person_id: :r__person_id, l__criterion_id: :r__criterion_id, l__criterion_type: :r__criterion_type) .exclude(r__criterion_id: nil) .select_all(:l) db.from(query) end |