ontology_search.rb revision 0b1f82328c2dfaa295d78b22514c18396e447db0
require 'json'
#
# Beware! This is not tested well.
#
end
end
unless repository.ontologies.where("name = :prefix", prefix: prefix, repository_id: repository).empty?
end
#TODO Search only symbols of ontologies of the repository
#text_list.add(prefix)
end
repository.ontologies.select(:name).where("name ILIKE :prefix", prefix: "#{prefix}%").group("name").limit(5).each do |ontology|
end
Entity.select(:name).where("name ILIKE :prefix", prefix: "#{prefix}%").group("name").limit(5).each do |symbol|
#TODO Search only symbols of ontologies of the repository
end
end
text_list.to_a.sort.map { |x| {text: x} }
end
end
end
Ontology.select(:name).where("name ILIKE :prefix", prefix: "#{prefix}%").group("name").limit(5).each do |ontology|
end
Entity.select(:name).where("name ILIKE :prefix", prefix: "#{prefix}%").group("name").limit(5).each do |symbol|
end
end
text_list.to_a.sort.map { |x| {text: x} }
end
end
index = 0
keyword_list.each do |keyword|
end
end
if logic = Logic.find_by_name(keyword)
logic.ontologies.each { |o| keyword_hash[o.id] ||= o }
end
if index == 0
else
hash = Hash.new
keyword_hash.each_key do |key|
hash[key] ||= ontology_hash[key] if ontology_hash[key]
end
ontology_hash = hash
end
index += 1
end
end
end
end