mappings.rb revision 335258a6512a35cb1bb18c1d1693fd35016616bd
included do
autosave: false,
end
end
if kind.nil?
end
if kind.nil?
end
end
# hash['name'] # maybe nil, in this case, we need to generate a name
mapping_name = hash['name']
# mapping_type
mapping_type = hash['type']
# morphism
gmorphism = hash['morphism']
# finally, create or update the mapping
}
source: source.current_version,
mapping.versions << mapping_version
mapping.update_version!(to: mapping_version)
# symbol mapping
if hash["map"]
source = OntologyMember::Symbol.where(text: hash["map"].first["text"],ontology_id: mapping.source.id).first
target = OntologyMember::Symbol.where(text: hash["map"].second["text"], ontology_id: mapping.target.id).first
symbol_mapping = EntityMapping.
where(source_id: source, target_id: target, mapping_id: mapping).
first_or_create!
end
end
end
end