mappings.rb revision 5a102b3c56d4ac75632c7e9244ee0ce5bdbbf13a
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
}
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