Skip to content

Commit

Permalink
add :index_all_data step the process actions
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 26, 2024
1 parent 95cde49 commit abf1125
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/ncbo_cron/ontology_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module OntologyHelper
:process_rdf => true,
:generate_labels => true,
:extract_metadata => true,
:index_all_data => true,
:index_search => true,
:index_properties => true,
:run_metrics => true,
Expand Down
9 changes: 5 additions & 4 deletions test/test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ def backend_triplestore_delete
raise StandardError, 'Too many triples in KB, does not seem right to run tests' unless
count_pattern('?s ?p ?o') < 400000

LinkedData::Models::Ontology.where.include(:acronym).each do |o|
query = "submissionAcronym:#{o.acronym}"
LinkedData::Models::Ontology.unindexByQuery(query)
end
# LinkedData::Models::Ontology.where.include(:acronym).each do |o|
# query = "submissionAcronym:#{o.acronym}"
# LinkedData::Models::Ontology.unindexByQuery(query)
# end
#
LinkedData::Models::Ontology.indexCommit
Goo.sparql_update_client.update('DELETE {?s ?p ?o } WHERE { ?s ?p ?o }')
LinkedData::Models::SubmissionStatus.init_enum
Expand Down
10 changes: 5 additions & 5 deletions test/test_ontology_submission_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_queue_submission
assert_nil val

parser.queue_submission(o1.submissions[0], {
dummy_action: true, index_search: false, metrics: true,
dummy_action: true, index_all_data: false, index_search: false, metrics: true,
process_annotator: true, another_dummy_action: true, all: true})
val = @@redis.hget(NcboCron::Models::OntologySubmissionParser::QUEUE_HOLDER, parser.get_prefixed_id(o1.submissions[0].id.to_s))
options = MultiJson.load(val, symbolize_keys: true)
Expand All @@ -49,11 +49,11 @@ def test_queue_submission
o2 = @@ontologies[1]
o2.bring(:submissions) if o2.bring?(:submissions)
parser.queue_submission(o2.submissions[0], {
:process_rdf => false, :index_search => true, :metrics => true,
:process_rdf => false, :index_search => true, index_all_data: true, :metrics => true,
:process_annotator => false})
val = @@redis.hget(NcboCron::Models::OntologySubmissionParser::QUEUE_HOLDER, parser.get_prefixed_id(o2.submissions[0].id.to_s))
options = MultiJson.load(val, symbolize_keys: true)
assert_equal({:process_rdf => false, :index_search => true, :process_annotator => false}, options)
assert_equal({:process_rdf => false, :index_search => true, index_all_data: true, :process_annotator => false}, options)
end

def test_parse_submissions
Expand All @@ -76,13 +76,13 @@ def test_parse_submissions
o2_sub2.bring(:submissionStatus)

options_o1 = {
:dummy_action => true, :process_rdf => true, :index_search => true, :index_properties => true, :diff => true,
:dummy_action => true, :process_rdf => true, :index_all_data => true, :index_search => true, :index_properties => true, :diff => true,
:dummy_metrics => false, :run_metrics => false, :process_annotator => false,
:another_dummy_action => false, :all => false
}

options_o2 = {
dummy_action: false, process_rdf: true, index_search: false, index_properties: false, :diff => true,
dummy_action: false, process_rdf: true, index_search: false, :index_all_data => false, index_properties: false, :diff => true,
dummy_metrics: true, run_metrics: false, process_annotator: true,
another_dummy_action: true, all: false
}
Expand Down

0 comments on commit abf1125

Please sign in to comment.