conceptql 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +226 -117
- data/LICENSE +21 -0
- data/README.md +35 -83
- data/bin/conceptql +2 -1
- data/bin/conceptql_utils +6 -0
- data/config/multiple_vocabularies.csv +4 -0
- data/config/provenance.yml +489 -0
- data/config/race.yml +50 -0
- data/config/vocabularies.csv +87 -0
- data/lib/conceptql/behaviors/code_lister.rb +23 -0
- data/lib/conceptql/behaviors/drugish.rb +17 -0
- data/lib/conceptql/behaviors/labish.rb +19 -0
- data/lib/conceptql/behaviors/metadatable.rb +226 -73
- data/lib/conceptql/behaviors/provenanceable.rb +26 -0
- data/lib/conceptql/behaviors/single_event.rb +11 -0
- data/lib/conceptql/behaviors/timeless.rb +11 -0
- data/lib/conceptql/behaviors/utilizable.rb +206 -0
- data/lib/conceptql/behaviors/windowable.rb +27 -0
- data/lib/conceptql/cli.rb +117 -108
- data/lib/conceptql/columnizer.rb +75 -0
- data/lib/conceptql/data_model/base.rb +462 -0
- data/lib/conceptql/data_model/gdm.rb +155 -0
- data/lib/conceptql/data_model/gdm_wide.rb +42 -0
- data/lib/conceptql/data_model/omopv4_plus.rb +12 -0
- data/lib/conceptql/data_model.rb +30 -0
- data/lib/conceptql/database.rb +214 -0
- data/lib/conceptql/date_adjuster.rb +66 -18
- data/lib/conceptql/diagram.rb +243 -0
- data/lib/conceptql/lexicon/lexicon_gdm.rb +47 -0
- data/lib/conceptql/lexicon/lexicon_no_db.rb +49 -0
- data/lib/conceptql/lexicon/lexicon_ohdsi.rb +63 -0
- data/lib/conceptql/lexicon/lexicon_strategy.rb +116 -0
- data/lib/conceptql/lexicon.rb +111 -0
- data/lib/conceptql/nodifier.rb +65 -24
- data/lib/conceptql/operators/after.rb +34 -14
- data/lib/conceptql/operators/any_overlap.rb +8 -6
- data/lib/conceptql/operators/before.rb +34 -10
- data/lib/conceptql/operators/binary_operator_operator.rb +66 -23
- data/lib/conceptql/operators/casting_operator.rb +51 -36
- data/lib/conceptql/operators/co_reported.rb +111 -0
- data/lib/conceptql/operators/concurrent_within.rb +69 -0
- data/lib/conceptql/operators/contains.rb +12 -8
- data/lib/conceptql/operators/count.rb +17 -9
- data/lib/conceptql/operators/date_range.rb +48 -14
- data/lib/conceptql/operators/death.rb +14 -4
- data/lib/conceptql/operators/dedup.rb +31 -0
- data/lib/conceptql/operators/during.rb +7 -12
- data/lib/conceptql/operators/episode.rb +146 -0
- data/lib/conceptql/operators/equal.rb +9 -3
- data/lib/conceptql/operators/ethnicity.rb +49 -0
- data/lib/conceptql/operators/except.rb +19 -12
- data/lib/conceptql/operators/filter.rb +23 -8
- data/lib/conceptql/operators/first.rb +16 -3
- data/lib/conceptql/operators/from.rb +52 -4
- data/lib/conceptql/operators/gender.rb +34 -11
- data/lib/conceptql/operators/hospice.rb +19 -0
- data/lib/conceptql/operators/hospitalization.rb +19 -0
- data/lib/conceptql/operators/information_periods.rb +36 -0
- data/lib/conceptql/operators/invalid.rb +35 -0
- data/lib/conceptql/operators/last.rb +16 -3
- data/lib/conceptql/operators/match.rb +91 -0
- data/lib/conceptql/operators/multiple_vocabularies.rb +172 -0
- data/lib/conceptql/operators/numeric.rb +65 -23
- data/lib/conceptql/operators/numeric_filter.rb +68 -0
- data/lib/conceptql/operators/occurrence.rb +153 -32
- data/lib/conceptql/operators/one_in_two_out.rb +237 -38
- data/lib/conceptql/operators/operator.rb +624 -178
- data/lib/conceptql/operators/pass_thru.rb +17 -3
- data/lib/conceptql/operators/person.rb +18 -6
- data/lib/conceptql/operators/person_filter.rb +9 -3
- data/lib/conceptql/operators/place_of_service_filter.rb +43 -0
- data/lib/conceptql/operators/provenance.rb +55 -0
- data/lib/conceptql/operators/provider_filter.rb +62 -0
- data/lib/conceptql/operators/race.rb +55 -7
- data/lib/conceptql/operators/read.rb +168 -0
- data/lib/conceptql/operators/recall.rb +49 -14
- data/lib/conceptql/operators/snf.rb +19 -0
- data/lib/conceptql/operators/sum.rb +29 -12
- data/lib/conceptql/operators/temporal_operator.rb +108 -16
- data/lib/conceptql/operators/time_window.rb +20 -32
- data/lib/conceptql/operators/trim_date.rb +71 -0
- data/lib/conceptql/operators/trim_date_end.rb +28 -40
- data/lib/conceptql/operators/trim_date_start.rb +28 -41
- data/lib/conceptql/operators/union.rb +67 -6
- data/lib/conceptql/operators/vocabulary.rb +151 -0
- data/lib/conceptql/paths.rb +41 -0
- data/lib/conceptql/query.rb +191 -26
- data/lib/conceptql/query_modifiers/gdm/admission_date_query_modifier.rb +46 -0
- data/lib/conceptql/query_modifiers/gdm/drug_query_modifier.rb +54 -0
- data/lib/conceptql/query_modifiers/gdm/lab_query_modifier.rb +57 -0
- data/lib/conceptql/query_modifiers/gdm/pos_query_modifier.rb +46 -0
- data/lib/conceptql/query_modifiers/gdm/provenance_query_modifier.rb +45 -0
- data/lib/conceptql/query_modifiers/gdm/provider_query_modifier.rb +53 -0
- data/lib/conceptql/query_modifiers/gdm_wide/admission_date_query_modifier.rb +42 -0
- data/lib/conceptql/query_modifiers/gdm_wide/drug_query_modifier.rb +52 -0
- data/lib/conceptql/query_modifiers/gdm_wide/lab_query_modifier.rb +55 -0
- data/lib/conceptql/query_modifiers/gdm_wide/pos_query_modifier.rb +37 -0
- data/lib/conceptql/query_modifiers/gdm_wide/provenance_query_modifier.rb +38 -0
- data/lib/conceptql/query_modifiers/omopv4_plus/admission_date_query_modifier.rb +45 -0
- data/lib/conceptql/query_modifiers/omopv4_plus/drug_query_modifier.rb +80 -0
- data/lib/conceptql/query_modifiers/omopv4_plus/pos_query_modifier.rb +47 -0
- data/lib/conceptql/query_modifiers/omopv4_plus/provenance_query_modifier.rb +45 -0
- data/lib/conceptql/query_modifiers/omopv4_plus/provider_query_modifier.rb +26 -0
- data/lib/conceptql/query_modifiers/query_modifier.rb +20 -0
- data/lib/conceptql/rdbms/duckdb.rb +25 -0
- data/lib/conceptql/rdbms/generic.rb +120 -0
- data/lib/conceptql/rdbms/postgres.rb +51 -0
- data/lib/conceptql/rdbms/spark.rb +22 -0
- data/lib/conceptql/rdbms.rb +22 -0
- data/lib/conceptql/scope.rb +481 -31
- data/lib/conceptql/sql_formatters/formatter.rb +25 -0
- data/lib/conceptql/sql_formatters.rb +22 -0
- data/lib/conceptql/utils.rb +113 -0
- data/lib/conceptql/utils_cli.rb +17 -0
- data/lib/conceptql/version.rb +3 -1
- data/lib/conceptql/visitors/metadata_extractor.rb +54 -0
- data/lib/conceptql/vocabularies/behaviors/costish.rb +24 -0
- data/lib/conceptql/vocabularies/behaviors/gdmish.rb +19 -0
- data/lib/conceptql/vocabularies/behaviors/omopish.rb +32 -0
- data/lib/conceptql/vocabularies/dynamic_vocabularies.rb +63 -0
- data/lib/conceptql/vocabularies/entry.rb +138 -0
- data/lib/conceptql/vocabularies/vocabulary_class_factory.rb +85 -0
- data/lib/conceptql/window/base.rb +26 -0
- data/lib/conceptql/window/date_range.rb +25 -0
- data/lib/conceptql/window/table.rb +116 -0
- data/lib/conceptql/window.rb +72 -0
- data/lib/conceptql.rb +65 -2
- data/lib/sequel/extensions/pg_ctas_explain.rb +22 -0
- data/lib/sequel/extensions/pg_vacuum_table.rb +23 -0
- data/schemas/gdm.yml +882 -0
- data/schemas/gdm_wide.yml +757 -0
- data/schemas/ohdsi_vocabs.yml +143 -0
- data/schemas/omopv4_plus.yml +729 -0
- data/schemas/omopv4_plus_more_ignorables.tsv +13 -0
- metadata +267 -207
- data/.gitignore +0 -23
- data/Gemfile +0 -4
- data/Guardfile +0 -56
- data/LICENSE.txt +0 -22
- data/Rakefile +0 -1
- data/conceptql.gemspec +0 -32
- data/doc/ConceptQL Specification (alpha).pdf +0 -0
- data/doc/diagram_0.png +0 -0
- data/doc/implementation_notes.md +0 -39
- data/doc/spec.md +0 -1344
- data/lib/conceptql/behaviors/debuggable.rb +0 -70
- data/lib/conceptql/behaviors/dottable.rb +0 -103
- data/lib/conceptql/behaviors/preppable.rb +0 -20
- data/lib/conceptql/converter.rb +0 -65
- data/lib/conceptql/debugger.rb +0 -48
- data/lib/conceptql/fake_grapher.rb +0 -20
- data/lib/conceptql/graph.rb +0 -52
- data/lib/conceptql/graph_nodifier.rb +0 -203
- data/lib/conceptql/logger.rb +0 -10
- data/lib/conceptql/operators/complement.rb +0 -38
- data/lib/conceptql/operators/concept.rb +0 -70
- data/lib/conceptql/operators/condition_type.rb +0 -71
- data/lib/conceptql/operators/cpt.rb +0 -25
- data/lib/conceptql/operators/drug_type_concept.rb +0 -21
- data/lib/conceptql/operators/from_seer_visits.rb +0 -23
- data/lib/conceptql/operators/hcpcs.rb +0 -25
- data/lib/conceptql/operators/icd10.rb +0 -28
- data/lib/conceptql/operators/icd9.rb +0 -28
- data/lib/conceptql/operators/icd9_procedure.rb +0 -25
- data/lib/conceptql/operators/intersect.rb +0 -34
- data/lib/conceptql/operators/loinc.rb +0 -25
- data/lib/conceptql/operators/medcode.rb +0 -28
- data/lib/conceptql/operators/medcode_procedure.rb +0 -27
- data/lib/conceptql/operators/ndc.rb +0 -29
- data/lib/conceptql/operators/observation_by_enttype.rb +0 -29
- data/lib/conceptql/operators/observation_period.rb +0 -30
- data/lib/conceptql/operators/overlapped_by.rb +0 -23
- data/lib/conceptql/operators/overlaps.rb +0 -19
- data/lib/conceptql/operators/place_of_service_code.rb +0 -24
- data/lib/conceptql/operators/procedure_occurrence.rb +0 -25
- data/lib/conceptql/operators/prodcode.rb +0 -29
- data/lib/conceptql/operators/rxnorm.rb +0 -24
- data/lib/conceptql/operators/snomed.rb +0 -24
- data/lib/conceptql/operators/snomed_condition.rb +0 -26
- data/lib/conceptql/operators/source_vocabulary_operator.rb +0 -58
- data/lib/conceptql/operators/standard_vocabulary_operator.rb +0 -45
- data/lib/conceptql/operators/started_by.rb +0 -22
- data/lib/conceptql/operators/to_seer_visits.rb +0 -24
- data/lib/conceptql/operators/visit.rb +0 -15
- data/lib/conceptql/operators/visit_occurrence.rb +0 -30
- data/lib/conceptql/tree.rb +0 -53
- data/lib/conceptql/utils/temp_table.rb +0 -72
- data/spec/conceptql/behaviors/dottable_spec.rb +0 -99
- data/spec/conceptql/converter_spec.rb +0 -51
- data/spec/conceptql/date_adjuster_spec.rb +0 -68
- data/spec/conceptql/operators/after_spec.rb +0 -16
- data/spec/conceptql/operators/before_spec.rb +0 -16
- data/spec/conceptql/operators/casting_operator_spec.rb +0 -68
- data/spec/conceptql/operators/complement_spec.rb +0 -15
- data/spec/conceptql/operators/concept_spec.rb +0 -40
- data/spec/conceptql/operators/condition_type_spec.rb +0 -128
- data/spec/conceptql/operators/contains_spec.rb +0 -19
- data/spec/conceptql/operators/cpt_spec.rb +0 -29
- data/spec/conceptql/operators/date_range_spec.rb +0 -33
- data/spec/conceptql/operators/death_spec.rb +0 -10
- data/spec/conceptql/operators/during_spec.rb +0 -30
- data/spec/conceptql/operators/except_spec.rb +0 -15
- data/spec/conceptql/operators/first_spec.rb +0 -35
- data/spec/conceptql/operators/from_spec.rb +0 -13
- data/spec/conceptql/operators/gender_spec.rb +0 -27
- data/spec/conceptql/operators/hcpcs_spec.rb +0 -29
- data/spec/conceptql/operators/icd10_spec.rb +0 -34
- data/spec/conceptql/operators/icd9_procedure_spec.rb +0 -29
- data/spec/conceptql/operators/icd9_spec.rb +0 -34
- data/spec/conceptql/operators/intersect_spec.rb +0 -28
- data/spec/conceptql/operators/last_spec.rb +0 -36
- data/spec/conceptql/operators/loinc_spec.rb +0 -29
- data/spec/conceptql/operators/medcode_procedure_spec.rb +0 -34
- data/spec/conceptql/operators/medcode_spec.rb +0 -34
- data/spec/conceptql/operators/observation_period_spec.rb +0 -10
- data/spec/conceptql/operators/occurrence_spec.rb +0 -87
- data/spec/conceptql/operators/overlapped_by_spec.rb +0 -32
- data/spec/conceptql/operators/overlaps_spec.rb +0 -21
- data/spec/conceptql/operators/person_filter_spec.rb +0 -15
- data/spec/conceptql/operators/person_spec.rb +0 -10
- data/spec/conceptql/operators/place_of_service_code_spec.rb +0 -24
- data/spec/conceptql/operators/procedure_occurrence_spec.rb +0 -10
- data/spec/conceptql/operators/prodcode_spec.rb +0 -35
- data/spec/conceptql/operators/query_double.rb +0 -20
- data/spec/conceptql/operators/query_double_spec.rb +0 -7
- data/spec/conceptql/operators/race_spec.rb +0 -21
- data/spec/conceptql/operators/rxnorm_spec.rb +0 -29
- data/spec/conceptql/operators/snomed_spec.rb +0 -29
- data/spec/conceptql/operators/source_vocabulary_operator_spec.rb +0 -35
- data/spec/conceptql/operators/standard_vocabulary_operator_spec.rb +0 -35
- data/spec/conceptql/operators/started_by_spec.rb +0 -22
- data/spec/conceptql/operators/temporal_operator_spec.rb +0 -51
- data/spec/conceptql/operators/time_window_spec.rb +0 -77
- data/spec/conceptql/operators/union_spec.rb +0 -21
- data/spec/conceptql/operators/visit_occurrence_spec.rb +0 -10
- data/spec/conceptql/query_spec.rb +0 -22
- data/spec/conceptql/tree_spec.rb +0 -50
- data/spec/doubles/stream_for_casting_double.rb +0 -9
- data/spec/doubles/stream_for_occurrence_double.rb +0 -25
- data/spec/doubles/stream_for_temporal_double.rb +0 -6
- data/spec/spec_helper.rb +0 -102
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'conceptql'
|
|
3
|
-
|
|
4
|
-
describe ConceptQL::Query do
|
|
5
|
-
describe '#query' do
|
|
6
|
-
it 'passes request on to tree' do
|
|
7
|
-
yaml = Psych.dump({ icd9: '799.22' })
|
|
8
|
-
mock_tree = double("tree")
|
|
9
|
-
mock_operator = double("operator")
|
|
10
|
-
mock_query = double("query")
|
|
11
|
-
mock_db = double("db")
|
|
12
|
-
|
|
13
|
-
expect(mock_db).to receive(:extend_datasets).with(Module).and_return(mock_db)
|
|
14
|
-
|
|
15
|
-
query = ConceptQL::Query.new(mock_db, yaml, mock_tree)
|
|
16
|
-
expect(mock_tree).to receive(:root).with(query).and_return(mock_operator)
|
|
17
|
-
expect(mock_operator).to receive(:evaluate).with(mock_db).and_return(mock_query)
|
|
18
|
-
expect(mock_query).to receive(:tap).and_return(mock_query)
|
|
19
|
-
query.query
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
data/spec/conceptql/tree_spec.rb
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'conceptql/tree'
|
|
3
|
-
|
|
4
|
-
describe ConceptQL::Tree do
|
|
5
|
-
describe '#root' do
|
|
6
|
-
before do
|
|
7
|
-
@mock_query_obj = double("mock query")
|
|
8
|
-
@mock_nodifier = double("mock nodifier")
|
|
9
|
-
@mock_scope = double("mock scope")
|
|
10
|
-
@tree = ConceptQL::Tree.new(nodifier: @mock_nodifier, scope: @mock_scope)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'should walk single operator criteria tree and convert to operator' do
|
|
14
|
-
expect(@mock_nodifier).to receive(:create).with(@mock_scope, :icd9, '799.22').and_return(:success_indicator)
|
|
15
|
-
expect(@mock_query_obj).to receive(:statement).and_return({ icd9: '799.22' })
|
|
16
|
-
|
|
17
|
-
expect(@tree.root(@mock_query_obj)).to eq(:success_indicator)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it 'should extend all operators created with behavior passed in' do
|
|
21
|
-
mock_icd9_obj = double("mock icd9")
|
|
22
|
-
expect(mock_icd9_obj).to receive(:extend).with(:mock_behavior)
|
|
23
|
-
|
|
24
|
-
tree = ConceptQL::Tree.new(nodifier: @mock_nodifier, behavior: :mock_behavior, scope: @mock_scope)
|
|
25
|
-
expect(@mock_nodifier).to receive(:create).with(@mock_scope, :icd9, '799.22').and_return(mock_icd9_obj)
|
|
26
|
-
expect(@mock_query_obj).to receive(:statement).and_return({ icd9: '799.22' })
|
|
27
|
-
|
|
28
|
-
tree.root(@mock_query_obj)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it 'should walk multi-criteria operator' do
|
|
32
|
-
expect(@mock_nodifier).to receive(:create).with(@mock_scope, :icd9, '799.22').and_return(:mock_icd9)
|
|
33
|
-
expect(@mock_nodifier).to receive(:create).with(@mock_scope, :nth, { occurrence: 1, expression: :mock_icd9 }).and_return(:success_indicator)
|
|
34
|
-
|
|
35
|
-
expect(@mock_query_obj).to receive(:statement).and_return({ nth: { occurrence: 1, expression: { icd9: '799.22' } } })
|
|
36
|
-
|
|
37
|
-
expect(@tree.root(@mock_query_obj)).to eq(:success_indicator)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it 'should walk multi-operator criteria tree and convert to operators' do
|
|
41
|
-
expect(@mock_nodifier).to receive(:create).with(@mock_scope, :icd9, '799.22').and_return(:mock_icd9)
|
|
42
|
-
expect(@mock_nodifier).to receive(:create).with(@mock_scope, :any, :mock_icd9).and_return(:success_indicator)
|
|
43
|
-
|
|
44
|
-
expect(@mock_query_obj).to receive(:statement).and_return({ any: [{ icd9: '799.22' }] })
|
|
45
|
-
|
|
46
|
-
expect(@tree.root(@mock_query_obj)).to eq(:success_indicator)
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
class StreamForOccurrenceDouble < ConceptQL::Operators::Operator
|
|
2
|
-
def query(db)
|
|
3
|
-
ds = db.from(:table)
|
|
4
|
-
# Occurrence needs window functions to work
|
|
5
|
-
meta_def(ds, :supports_window_functions?){true}
|
|
6
|
-
ds
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def evaluate(db)
|
|
10
|
-
query(db)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
# Stole this from:
|
|
14
|
-
# https://github.com/jeremyevans/sequel/blob/63397b787335d06de97dc89ddf49b7a3a93ffdc9/spec/core/expression_filters_spec.rb#L400
|
|
15
|
-
#
|
|
16
|
-
# By default, the Sequel.mock datasets don't allow window functions, but I need them
|
|
17
|
-
# enabled for testing
|
|
18
|
-
#
|
|
19
|
-
# I saw that Sequel tests had this little nugget in them to temporarily enable
|
|
20
|
-
# window functions and sure enough, it works
|
|
21
|
-
def meta_def(obj, name, &block)
|
|
22
|
-
(class << obj; self end).send(:define_method, name, &block)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
require 'sequel'
|
|
2
|
-
|
|
3
|
-
shared_examples_for(:evaluator) do
|
|
4
|
-
let(:evaluator) { described_class.new }
|
|
5
|
-
it "should respond to evaluate" do
|
|
6
|
-
expect(evaluator.respond_to?(:evaluate)).to be true
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it "should respond to query" do
|
|
10
|
-
expect(evaluator.respond_to?(:query)).to be true
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it "shoudl respond to types" do
|
|
14
|
-
expect(evaluator.respond_to?(:types)).to be true
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
shared_examples_for(:source_vocabulary_operator) do
|
|
19
|
-
let(:source_vocabulary_operator) { described_class.new }
|
|
20
|
-
it_behaves_like :evaluator
|
|
21
|
-
|
|
22
|
-
it "should respond to #table" do
|
|
23
|
-
expect(source_vocabulary_operator.respond_to?(:table)).to be true
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "should respond to #concept_column" do
|
|
27
|
-
expect(source_vocabulary_operator.respond_to?(:concept_column)).to be true
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it "should respond to #source_column" do
|
|
31
|
-
expect(source_vocabulary_operator.respond_to?(:source_column)).to be true
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it "should respond to #vocabulary_id" do
|
|
35
|
-
expect(source_vocabulary_operator.respond_to?(:vocabulary_id)).to be true
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
shared_examples_for(:standard_vocabulary_operator) do
|
|
40
|
-
let(:standard_vocabulary_operator) { described_class.new }
|
|
41
|
-
|
|
42
|
-
it_behaves_like :evaluator
|
|
43
|
-
|
|
44
|
-
it "should respond to #table" do
|
|
45
|
-
expect(standard_vocabulary_operator.respond_to?(:table)).to be true
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
it "should respond to #concept_column" do
|
|
49
|
-
expect(standard_vocabulary_operator.respond_to?(:concept_column)).to be true
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it "should respond to #vocabulary_id" do
|
|
53
|
-
expect(standard_vocabulary_operator.respond_to?(:vocabulary_id)).to be true
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
shared_examples_for(:operator) do
|
|
58
|
-
let(:operator) { described_class.new }
|
|
59
|
-
|
|
60
|
-
it "should respond to #values" do
|
|
61
|
-
expect(operator.respond_to?(:values)).to be true
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it "should respond to #arguments" do
|
|
65
|
-
expect(operator.respond_to?(:arguments)).to be true
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
it "should respond to #upstreams" do
|
|
69
|
-
expect(operator.respond_to?(:upstreams)).to be true
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
shared_examples_for(:temporal_operator) do
|
|
74
|
-
let(:temporal_operator) { described_class.new }
|
|
75
|
-
|
|
76
|
-
it "should respond to #where_clause" do
|
|
77
|
-
expect(temporal_operator.respond_to?(:where_clause)).to be true
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
shared_examples_for(:casting_operator) do
|
|
82
|
-
let(:casting_operator) { described_class.new }
|
|
83
|
-
it_behaves_like(:evaluator)
|
|
84
|
-
|
|
85
|
-
it "should respond to #my_type" do
|
|
86
|
-
expect(casting_operator.respond_to?(:my_type)).to be true
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it "should respond to #i_point_at" do
|
|
90
|
-
expect(casting_operator.respond_to?(:i_point_at)).to be true
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
it "should respond to #these_point_at_me" do
|
|
94
|
-
expect(casting_operator.respond_to?(:these_point_at_me)).to be true
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def require_double(double_name)
|
|
99
|
-
p = Pathname.new('.')
|
|
100
|
-
p = p + 'spec' + 'doubles' + (double_name + '_double')
|
|
101
|
-
require(p.expand_path)
|
|
102
|
-
end
|