node_evaluator.rb revision 2a321cbae5b2d4957f2a1a36946087bdf78c5335
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen register :ontology, :start, to: :ontology_start
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen register :imported_axiom, :end, to: :imported_axiom
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen importer.dgnode_count = current_element['dgnodes'].to_i
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen importer.ontologies.each(&:create_translated_sentences)
f16c114c20bbd7d292d93415d1e56c8dd6abd3e7Timo Sirainen update_ontologies_per_logic_count!(importer.ontologies)
98c1cf256927e254f0c092acd2ddcd7ea50bd009Timo Sirainen self.internal_iri = child_name = current_element['name']
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen ontohub_iri = generate_ontology_iri(internal_iri, current_element)
98c1cf256927e254f0c092acd2ddcd7ea50bd009Timo Sirainen self.ontology = procure_ontology(current_element, internal_iri)
8fcff4c5b52f24d9c681805fdf06b486f1d0fcbeTimo Sirainen ontology.name = ontology.generate_name(current_element['name'])
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen altIri = ontology.alternative_iris.where(iri: internal_iri).
8fcff4c5b52f24d9c681805fdf06b486f1d0fcbeTimo Sirainen self.logic_callback = ParsingCallback.determine_for(ontology)
98c1cf256927e254f0c092acd2ddcd7ea50bd009Timo Sirainen logic_callback.ontology(current_element, ontology)
98c1cf256927e254f0c092acd2ddcd7ea50bd009Timo Sirainen ontology.current_version.state = 'done' if ontology.parent
a2637488c8d514ec1ac3914811deee814f9761b3Timo Sirainen ontology.sentences.original.find_each(&:set_display_text!)
a2637488c8d514ec1ac3914811deee814f9761b3Timo Sirainen symbol = ontology.symbols.update_or_create_from_hash(
a2637488c8d514ec1ac3914811deee814f9761b3Timo Sirainen logic_callback.symbol(current_element, symbol)
02b79f9c2636da1829eee5b92753602bba8b67edTimo Sirainen axiom = ontology.axioms.update_or_create_from_hash(
a2637488c8d514ec1ac3914811deee814f9761b3Timo Sirainen axiom = ontology.axioms.update_or_create_from_hash(
299183fbb6ec5d0828a0880da372540421ac4665Timo Sirainen if logic_callback.pre_theorem(current_element)
299183fbb6ec5d0828a0880da372540421ac4665Timo Sirainen theorem = ontology.theorems.update_or_create_from_hash(
299183fbb6ec5d0828a0880da372540421ac4665Timo Sirainen logic_callback.theorem(current_element, theorem)
299183fbb6ec5d0828a0880da372540421ac4665Timo Sirainen if logic_callback.pre_mapping(current_element)
299183fbb6ec5d0828a0880da372540421ac4665Timo Sirainen mapping = parent_ontology.mappings.update_or_create_from_hash(
299183fbb6ec5d0828a0880da372540421ac4665Timo Sirainen logic_callback.mapping(current_element, mapping)
dda2c506c8fc8ac2f88272de4523ded42baa0aa0Timo Sirainen source_iri = location ? location : internal_iri
dda2c506c8fc8ac2f88272de4523ded42baa0aa0Timo Sirainen commit_oid = ExternalRepository.add_to_repository(
9e59a1f3f095b3099478562cf3f3970a24736970Timo Sirainen "add reference #{Settings.OMS}: #{internal_iri} from #{source_iri}",
dda2c506c8fc8ac2f88272de4523ded42baa0aa0Timo Sirainen version.file_extension = ontology.file_extension
4d25408732be27e91f0430f71e87242760c2517cTimo Sirainen ontology.present = false