mappings.rb revision 7f2dad9b7bcc8a9c37626bab9d5f9c3dfa0bccbe
included do
autosave: false,
end
end
if kind.nil?
kind = Mapping::KINDS_MAPPING[key]
end
if kind.nil?
end
end
def update_or_create_from_hash(hash, _user, timestamp = Time.now)
# hash['name'] # maybe nil, in this case, we need to generate a name
# mapping_type
# morphism
end
# finally, create or update the mapping
}
sep = '//'
mapping.locid = "#{mapping.ontology.locid}#{sep}#{locid_portion}"
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
SymbolMapping.
where(source_id: source, target_id: target, mapping_id: mapping).
first_or_create!
end
end
end
end
end