Esempio n. 1
0
 def process_active_batch(self):
     """ Processes the current batch, determined by the row number
         by running the individual import processes in the proper order
     """
     p_label = self.active_processes[self.act_process_num]
     p_outcome = LastUpdatedOrderedDict()
     p_outcome['label'] = p_label
     if p_label == 'subjects':
         p_act = ProcessSubjects(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_subjects_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = p_act.new_entities
         p_outcome['reconciled_entities'] = p_act.reconciled_entities
         p_outcome['not_reconciled_entities'] = p_act.not_reconciled_entities
         p_outcome['count_new_assertions'] = 0
     elif p_label == 'media':
         p_act = ProcessMedia(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_media_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = p_act.new_entities
         p_outcome['reconciled_entities'] = p_act.reconciled_entities
         p_outcome['not_reconciled_entities'] = p_act.not_reconciled_entities
         p_outcome['count_new_assertions'] = 0
     elif p_label == 'persons':
         p_act = ProcessPersons(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_persons_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = p_act.new_entities
         p_outcome['reconciled_entities'] = p_act.reconciled_entities
         p_outcome['not_reconciled_entities'] = p_act.not_reconciled_entities
         p_outcome['count_new_assertions'] = 0
     elif p_label == 'links':
         p_act = ProcessLinks(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_link_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = []
         p_outcome['reconciled_entities'] = []
         p_outcome['not_reconciled_entities'] = []
         p_outcome['count_new_assertions'] = p_act.count_new_assertions
     elif p_label == 'descriptions':
         p_act = ProcessDescriptions(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_description_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = []
         p_outcome['reconciled_entities'] = []
         p_outcome['not_reconciled_entities'] = []
         p_outcome['count_new_assertions'] = p_act.count_new_assertions
     return p_outcome
Esempio n. 2
0
 def process_active_batch(self):
     """ Processes the current batch, determined by the row number
         by running the individual import processes in the proper order
     """
     p_label = self.active_processes[self.act_process_num]
     p_outcome = LastUpdatedOrderedDict()
     p_outcome['label'] = p_label
     if p_label == 'subjects':
         p_act = ProcessSubjects(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_subjects_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = p_act.new_entities
         p_outcome['reconciled_entities'] = p_act.reconciled_entities
         p_outcome[
             'not_reconciled_entities'] = p_act.not_reconciled_entities
         p_outcome['count_new_assertions'] = 0
     elif p_label == 'media':
         p_act = ProcessMedia(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_media_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = p_act.new_entities
         p_outcome['reconciled_entities'] = p_act.reconciled_entities
         p_outcome[
             'not_reconciled_entities'] = p_act.not_reconciled_entities
         p_outcome['count_new_assertions'] = 0
     elif p_label == 'persons':
         p_act = ProcessPersons(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_persons_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = p_act.new_entities
         p_outcome['reconciled_entities'] = p_act.reconciled_entities
         p_outcome[
             'not_reconciled_entities'] = p_act.not_reconciled_entities
         p_outcome['count_new_assertions'] = 0
     elif p_label == 'links':
         p_act = ProcessLinks(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_link_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = []
         p_outcome['reconciled_entities'] = []
         p_outcome['not_reconciled_entities'] = []
         p_outcome['count_new_assertions'] = p_act.count_new_assertions
     elif p_label == 'descriptions':
         p_act = ProcessDescriptions(self.source_id)
         p_act.start_row = self.start_row
         p_act.batch_size = self.batch_size
         p_act.process_description_batch()
         p_outcome['count_active_fields'] = p_act.count_active_fields
         p_outcome['new_entities'] = []
         p_outcome['reconciled_entities'] = []
         p_outcome['not_reconciled_entities'] = []
         p_outcome['count_new_assertions'] = p_act.count_new_assertions
     return p_outcome