links.rb revision ca86423fdf0e95c5ef6eb00c155991f8e3964533
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
link_name = hash['name']
# linktype
linktype = hash['type']
# morphism
gmorphism = hash['morphism']
# finally, create or update the link
link.attributes = {
}
source: source.current_version,
link.versions << link_version
link.update_version!(to: link_version)
# entity mapping
if hash["map"]
source = Entity.where(text: hash["map"].first["text"],ontology_id: link.source.id).first
target = Entity.where(text: hash["map"].second["text"], ontology_id: link.target.id).first
entity_mapping = EntityMapping.
where(source_id: source, target_id: target, link_id: link).
first_or_create!
end
end
end
end