links.rb revision 1ce62f5bb9fe0d729f767af704035b9536e7d7fc
included do
end
end
# hash['name'] # maybe nil, in this case, we need to generate a name
link_name = hash['name']
source = Ontology.find_by_iri(source_iri) || (raise ArgumentError, "source ontology not found: #{source_iri}")
target = Ontology.find_by_iri(target_iri) || (raise ArgumentError, "target ontology not found: #{target_iri}")
# linktype
linktype = hash['type']
# moprhism
gmorphism = hash['morphism']
# login mapping
logic_mapping ||= LogicMapping.create! \
source: source.logic,
# finally, create or update the link
link.attributes = {
source: source,
}
#link.versions << LinkVersion.create(link: link,
# source: source.versions.current,
# target: target.versions.current)
# entity mapping
if hash["map"]
end
end
end
end