Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ create_permissions.log
ontologies_api.iml

.env
.qodo
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ gem 'pandoc-ruby'
gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.git', branch: 'development'
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master'
gem 'ncbo_ontology_recommender', git: 'https://github.com/ontoportal-lirmm/ncbo_ontology_recommender.git', branch: 'development'
gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'development'
gem 'ontologies_linked_data', github: 'earthportal/ontologies_linked_data', branch: 'feature/projects'
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development'

Expand Down
113 changes: 64 additions & 49 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
GIT
remote: https://github.com/earthportal/ontologies_linked_data.git
revision: 74854f84705caac34edf4caaefcda199e9a83ae9
branch: feature/projects
specs:
ontologies_linked_data (0.0.1)
activesupport
bcrypt
goo
json
libxml-ruby
multi_json
oj
omni_logger
pony
rack
rack-test
rsolr
rubyzip

GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: e48a2d13a65cc2dd1c12d116cfc9da9061106861
Expand Down Expand Up @@ -55,26 +75,6 @@ GIT
ontologies_linked_data
redis

GIT
remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git
revision: b321d73a28b4f60fc5969da7a071b3c19c1a84f3
branch: development
specs:
ontologies_linked_data (0.0.1)
activesupport
bcrypt
goo
json
libxml-ruby
multi_json
oj
omni_logger
pony
rack
rack-test
rsolr
rubyzip

GIT
remote: https://github.com/ontoportal-lirmm/sparql-client.git
revision: 736b7650e28db3ce5e3e49511ac30f958a29e8f1
Expand Down Expand Up @@ -103,7 +103,7 @@ GIT

GIT
remote: https://github.com/sinatra/sinatra.git
revision: c235249abaafa2780b540aca1813dfcf3d17c2dd
revision: cfcc70dee1133690207b5a3dc6000426ec04e250
specs:
rack-protection (4.1.1)
base64 (>= 0.1.0)
Expand Down Expand Up @@ -145,7 +145,7 @@ GEM
airbrussh (1.5.3)
sshkit (>= 1.6.1, != 1.7.0)
ansi (1.5.0)
ast (2.4.2)
ast (2.4.3)
base64 (0.2.0)
bcp47_spec (0.2.1)
bcrypt (3.1.20)
Expand Down Expand Up @@ -221,49 +221,62 @@ GEM
mutex_m
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
google-cloud-core (1.7.1)
google-cloud-core (1.8.0)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (2.2.1)
google-cloud-env (2.2.2)
base64 (~> 0.2)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.4.0)
google-cloud-errors (1.5.0)
google-logging-utils (0.1.0)
google-protobuf (4.29.3)
google-protobuf (4.30.1)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-aarch64-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.30.1-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-arm64-darwin)
google-protobuf (4.30.1-x86-linux)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-x86_64-darwin)
google-protobuf (4.30.1-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.29.3-x86_64-linux)
google-protobuf (4.30.1-x86_64-linux)
bigdecimal
rake (>= 13)
googleapis-common-protos (1.6.0)
googleapis-common-protos (1.7.0)
google-protobuf (>= 3.18, < 5.a)
googleapis-common-protos-types (~> 1.7)
grpc (~> 1.41)
googleapis-common-protos-types (1.18.0)
googleapis-common-protos-types (1.19.0)
google-protobuf (>= 3.18, < 5.a)
googleauth (1.13.1)
googleauth (1.14.0)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.2)
google-logging-utils (~> 0.1)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.70.1)
grpc (1.71.0)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.71.0-aarch64-linux)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.71.0-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.70.1-arm64-darwin)
grpc (1.71.0-x86-linux)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.70.1-x86_64-darwin)
grpc (1.71.0-x86_64-darwin)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.70.1-x86_64-linux)
grpc (1.71.0-x86_64-linux)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
haml (5.2.2)
Expand All @@ -278,7 +291,7 @@ GEM
mutex_m
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.10.1)
json (2.10.2)
json-canonicalization (0.4.0)
json-ld (3.2.5)
htmlentities (~> 4.3)
Expand Down Expand Up @@ -306,12 +319,12 @@ GEM
net-pop
net-smtp
method_source (1.1.0)
mime-types (3.6.0)
mime-types (3.6.1)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0220)
mime-types-data (3.2025.0318)
mini_mime (1.1.5)
minitest (5.25.4)
minitest (5.25.5)
minitest-fail-fast (0.1.0)
minitest (~> 5)
minitest-hooks (1.5.2)
Expand Down Expand Up @@ -351,7 +364,7 @@ GEM
net-ssh (7.3.0)
netrc (0.11.0)
newrelic_rpm (9.17.0)
oj (3.16.9)
oj (3.16.10)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omni_logger (0.1.4)
Expand All @@ -361,7 +374,7 @@ GEM
pandoc-ruby (2.1.10)
parallel (1.26.3)
parseconfig (1.1.2)
parser (3.3.7.1)
parser (3.3.7.2)
ast (~> 2.4.1)
racc
pony (1.13.1)
Expand All @@ -372,7 +385,7 @@ GEM
public_suffix (6.0.1)
raabro (1.4.0)
racc (1.8.1)
rack (3.1.10)
rack (3.1.12)
rack-accept (0.4.5)
rack (>= 0.4)
rack-attack (6.7.0)
Expand Down Expand Up @@ -412,7 +425,7 @@ GEM
rexml (~> 3.2)
redis (5.4.0)
redis-client (>= 0.22.0)
redis-client (0.23.2)
redis-client (0.24.0)
connection_pool
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
Expand All @@ -436,7 +449,7 @@ GEM
rsolr (2.6.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
rubocop (1.72.2)
rubocop (1.74.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
Expand All @@ -447,8 +460,8 @@ GEM
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-ast (1.41.0)
parser (>= 3.3.7.2)
ruby-progressbar (1.13.0)
ruby-xxHash (0.4.0.2)
ruby2_keywords (0.0.5)
Expand Down Expand Up @@ -503,18 +516,20 @@ GEM
unicorn-worker-killer (0.4.5)
get_process_mem (~> 0)
unicorn (>= 4, < 7)
uri (1.0.2)
uri (1.0.3)
uuid (2.3.9)
macaddr (~> 1.0)
webmock (3.25.0)
webmock (3.25.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.9.1)

PLATFORMS
aarch64-linux
arm64-darwin
ruby
x86-linux
x86_64-darwin
x86_64-linux

Expand Down
26 changes: 26 additions & 0 deletions controllers/connector_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class ConnectorController < ApplicationController
namespace "/connector" do
get "/projects" do
validate_source!
begin
connector = Connectors::Factory.create(@source)
response = connector.fetch_projects(params)
reply 200, response
rescue Connectors::ProjectNotFoundError => e
error 404, { error: e.message }
rescue Connectors::ConnectorError => e
error 400, { error: e.message }
rescue StandardError => e
error 500, { error: e.message }
end
end

private
def validate_source!
@source = params[:source]&.upcase
error 400, { error: "Source parameter is required" } if @source.nil?
valid_sources = LinkedData.settings.connectors[:available_sources].keys
error 400, { error: "Invalid source. Valid sources: #{valid_sources.join(', ')}" } unless valid_sources.include?(@source)
end
end
end
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
- "9393:9393"
volumes:
# bundle volume for hosting gems installed by bundle; it speeds up gem install in local development
- app_api:/srv/ontoportal/ontologies_api
- .:/srv/ontoportal/ontologies_api
- repository:/srv/ontoportal/data/repository

ncbo_cron:
Expand Down
Loading