ontology_search.rb revision c0db3f29bc01c8d672cf19648b1172dd8d21d2d4
3dc5cf7d5b8a1b07204e85997595907de39df819Eileen Bolloff# Beware! This is not tested well.
3dc5cf7d5b8a1b07204e85997595907de39df819Eileen Bolloff class Response < Struct.new(:page,:ontologiesPerPage,:ontologiesInSet,:ontologies)
4abcc3febd724b202d60bd92a1a9052c02b9eb03Eileen Bolloff def make_repository_keyword_list_json(repository, prefix)
3dc5cf7d5b8a1b07204e85997595907de39df819Eileen Bolloff JSON.generate(make_repository_keyword_list(repository, prefix))
f71f4d86365be9f6eea0b441455fbfd686f43cd4Eileen Bolloff JSON.generate(make_global_keyword_list(prefix))
1115fd7e3171f7aaeb98472789edf016996b7278henning mueller def make_repository_keyword_list(repository, prefix)
25e680b4f0bbd68678787e4d349bc99e23ee0c73Eileen Bolloff #unless repository.ontologies.where("name = :prefix", prefix: prefix, repository_id: repository).empty?
f71f4d86365be9f6eea0b441455fbfd686f43cd4Eileen Bolloff repository.ontologies.select(:name).where("name ILIKE :prefix", prefix: "#{prefix}%").limit(25).group("name").limit(5).each do |ontology|
25e680b4f0bbd68678787e4d349bc99e23ee0c73Eileen Bolloff Entity.collect_keywords(prefix, repository).each do |symbol|
25e680b4f0bbd68678787e4d349bc99e23ee0c73Eileen Bolloff text_list.add(symbol.display_name) if symbol.display_name
1115fd7e3171f7aaeb98472789edf016996b7278henning mueller repository.ontologies.select(:id).each do |ontology|
c28fc8aa2cdf7f9c9ae76899354350473d155981Eugen Kuksa Logic.where("name ILIKE :prefix", prefix: "#{prefix}%").limit(5).each do |logic|
keyword_list.each do |keyword|
keyword_list.each do |keyword|
return nil