links.rb revision 9207b76195d960634cc7bf91a1c9331632fedf29
included do
end
end
# hash['name'] # maybe nil, in this case, we need to generate a 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,
}
end
end
end