import.rb revision 3e7a51349781a4cf69b876a1488db647bb62a63d
transaction do
ontologies_count = 0
root = h
},
ontologies_count += 1
if distributed?
# generate IRI for sub-ontology
# find or create sub-ontology by IRI
ontology ||= SingleOntology.create!({iri: name, parent: self}, without_protection: true)
else
end
if h['language']
ontology.language = Language.find_or_create_by_name_and_iri h['language'], 'http://purl.net/dol/language/' + h['language']
end
if h['logic']
ontology.logic = Logic.find_or_create_by_name_and_iri h['logic'], 'http://purl.net/dol/logics/' + h['logic']
end
},
# remove outdated sentences and entities
},
},
},
source = h['source']
source_onto = Ontology.find_by_iri source
else "import_or_viewif" end
theorem = linktype.include? "Thm"
local = linktype.include? "Local"
inclusion = linktype.include? "Inc"
link = Link.create!({iri: name, ontology: self, source: source_onto, target: target_onto,
inclusion: inclusion, logic_mapping: logic_mapping }, without_protection: true)
}
save!
end
end
end
end
end