Skip to content

Commit

Permalink
format changes and prep for DCAT imports
Browse files Browse the repository at this point in the history
  • Loading branch information
markwilkinson committed Oct 21, 2024
1 parent 4005d3b commit e79aa6f
Show file tree
Hide file tree
Showing 25 changed files with 636 additions and 214 deletions.
93 changes: 93 additions & 0 deletions VP/index-all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[
{
"uuid": "8a38755f-e805-42a6-b872-5bb4c9df1a1d",
"clientUrl": "http://testbed.ejprd.semlab-leiden.nl:5000",
"state": "ACTIVE",
"registrationTime": "2024-02-13T10:48:35.596Z",
"modificationTime": "2024-10-15T11:34:03.062Z"
},
{
"uuid": "cd65140d-27f6-45f3-afc0-84b3047ac0e0",
"clientUrl": "http://testbed.ejprd.semlab-leiden.nl:10000",
"state": "ACTIVE",
"registrationTime": "2024-02-27T15:53:06.198Z",
"modificationTime": "2024-10-15T11:34:02.970Z"
},
{
"uuid": "67f26b17-bed5-4be5-a9d9-e6488923faf1",
"clientUrl": "http://152.228.212.152:9000",
"state": "ACTIVE",
"registrationTime": "2024-03-25T11:48:35.327Z",
"modificationTime": "2024-10-17T07:31:55.958Z"
},
{
"uuid": "30874e87-2179-4101-a1a0-8451c5ed4d7f",
"clientUrl": "https://w3id.org/duchenne-fdp",
"state": "ACTIVE",
"registrationTime": "2024-05-24T11:03:06.503Z",
"modificationTime": "2024-10-18T11:37:18.262Z"
},
{
"uuid": "33cfda82-ae8b-417a-a867-ae101132ade9",
"clientUrl": "https://w3id.org/bgv-fdp",
"state": "INACTIVE",
"registrationTime": "2024-06-01T12:27:23.645Z",
"modificationTime": "2024-10-03T05:43:10.141Z"
},
{
"uuid": "7e435bb3-72e7-46b6-a4f6-64c0850f3eee",
"clientUrl": "https://w3id.org/ERKNet/fdp",
"state": "ACTIVE",
"registrationTime": "2024-08-13T10:12:41.598Z",
"modificationTime": "2024-10-17T10:12:41.517Z"
},
{
"uuid": "a0f736d9-7d38-48fa-b241-c76b29d73d65",
"clientUrl": "https://w3id.org/ERKNet/fdp/",
"state": "INACTIVE",
"registrationTime": "2024-08-13T13:46:02.737Z",
"modificationTime": "2024-08-30T10:23:34.927Z"
},
{
"uuid": "ecdc9b94-7084-4aea-9176-29251c35552f",
"clientUrl": "https://jbo.bgv.cbgp.upm.es",
"state": "INACTIVE",
"registrationTime": "2024-08-13T13:49:21.616Z",
"modificationTime": "2024-10-03T05:43:01.999Z"
},
{
"uuid": "196ff4c1-efed-496e-b465-c0754ff418ad",
"clientUrl": "http://fairdatapointorphanet.info:7070/",
"state": "INACTIVE",
"registrationTime": "2024-08-30T09:33:53.970Z",
"modificationTime": "2024-10-03T05:42:59.333Z"
},
{
"uuid": "38067156-fe30-4f1b-a234-84e6d53f0e42",
"clientUrl": "https://ostrails.github.io/sandbox/fdp.ttl",
"state": "ACTIVE",
"registrationTime": "2024-10-16T14:25:29.953Z",
"modificationTime": "2024-10-16T14:25:2* Connection #0 to host testbed.ejprd.semlab-leiden.nl left intact9.953Z"
},
{
"uuid": "5abb940a-fdca-4ec0-b133-df252c2fe4cb",
"clientUrl": "https: //ostrails.github.io/sandbox/proxyfdp.ttl",
"state": "ACTIVE",
"registrationTime": "2024-10-18T11:46:18.829Z",
"modificationTime": "2024-10-18T11:46:18.829Z"
},
{
"uuid": "88618abe-bfff-4289-bef9-a49f4fc01a0b",
"clientUrl": "https://ostrails.github.io/sandbox/proxyservice.ttl",
"state": "ACTIVE",
"registrationTime": "2024-10-18T14:37:32.592Z",
"modificationTime": "2024-10-18T14:37:32.592Z"
},
{
"uuid": "98179f89-2cfa-4084-b1cd-f7cbb73cff70",
"clientUrl": "https://ostrails.github.io/sandbox/gobierno.ttl",
"state": "ACTIVE",
"registrationTime": "2024-10-19T12:03:27.685Z",
"modificationTime": "2024-10-19T12:03:27.685Z"
}
]
84 changes: 41 additions & 43 deletions VP/vp-interface/Gemfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,58 @@
# frozen_string_literal: false

source "https://rubygems.org"
#sinatra (2.2.4, 1.4.8)
#sinatra-cross_origin (0.4.0)
#sinatra-respond_to (0.9.0, 0.4.0)
source 'https://rubygems.org'

gemspec
ruby "~> 3.3.0"
# gem 'activerecord', '~> 7', '>= 7', require: 'active_record'
gem "bcrypt"
gem "debase", git: "https://github.com/ruby-debug/debase.git", tag: "v0.2.5.beta2"
gem "linkeddata", "~> 3.2.0"
gem "metainspector", "~> 5-11-2"
gem "parseconfig", "~>1.1.2"
gem "pry"
gem "rake", "~> 13.0"
gem "rdf-raptor", "~> 3.1.0"
gem "require_all"
gem "rest-client", "~>2.1.0"
gem "rspec", "~> 3.11.0"
gem "rubocop"
gem "ruby-debug-ide"
gem "shotgun"
gem "sinatra", "~> 2.2"
#gem "sinatra", "~> 1.4.8"
gem "cgi", "~> 0.4.1"
gem "csv"
gem "fileutils", "~>1.5.0"
gem "json", "~> 2.7.1"
gem "json-canonicalization", "~> 1.0.0"
gem "openapi3_parser", "~> 0.10.0"
gem "securerandom"
gem "sinatra-cross_origin"
gem "swagger-blocks", "~> 3.0.0"
gem "tempfile"
gem "thin"
gem "tux"
gem "xml-simple", "~>1.1.8"
ruby '~> 3.3.0'
gem 'bcrypt'
gem 'debase', git: 'https://github.com/ruby-debug/debase.git', tag: 'v0.2.5.beta2'
gem 'linkeddata', '~> 3.2.0'
gem 'metainspector', '~> 5-11-2'
gem 'parseconfig', '~>1.1.2'
gem 'pry'
gem 'rake', '~> 13.0'
gem 'rdf-raptor', '~> 3.1.0'
gem 'require_all'
gem 'rest-client', '~>2.1.0'
gem 'rubocop'
gem 'ruby-debug-ide'
gem 'shotgun'
gem 'sinatra', '~> 2.2'
# gem "sinatra", "~> 1.4.8"
gem 'cgi', '~> 0.4.1'
gem 'csv'
gem 'fileutils', '~>1.5.0'
gem 'json', '~> 2.7.1'
gem 'json-canonicalization', '~> 1.0.0'
gem 'openapi3_parser', '~> 0.10.0'
gem 'securerandom'
gem 'sinatra-cross_origin'
gem 'swagger-blocks', '~> 3.0.0'
gem 'tempfile'
gem 'thin'
gem 'tux'
gem 'xml-simple', '~>1.1.8'

group :test do
gem "capybara"
gem "rack-test"
# gem 'database_cleaner', git: 'https://github.com/bmabey/database_cleaner.git'
gem 'capybara'
gem 'rack-test'
gem 'rspec', '~> 3.11.0'
gem 'rspec-core', '~> 3.11'
gem "rspec-openapi", "~> 0.18.3"

end

gem "dpop", "~> 0.1.3"
gem 'dpop', '~> 0.1.3'

gem "activesupport", "~> 7.0.3.1"
gem 'activesupport', '~> 7.0.3.1'

gem "erb", "~> 4.0"
gem 'erb', '~> 4.0'

# gem "omniauth", "~> 1.1"

# gem "omniauth-openid-connect", "~> 0.2.3"

gem "jwt", "~> 2.8"
gem 'jwt', '~> 2.8'

gem 'sinatra-respond_to', '~> 0.4.0'

gem "sinatra-respond_to", "~> 0.4.0"
31 changes: 31 additions & 0 deletions VP/vp-interface/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionpack (7.0.3.1)
actionview (= 7.0.3.1)
activesupport (= 7.0.3.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.3.1)
activesupport (= 7.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
Expand Down Expand Up @@ -43,6 +56,7 @@ GEM
commonmarker (1.1.5-x86_64-linux)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
csv (3.2.8)
daemons (1.4.1)
debase-ruby_core_source (3.2.1)
Expand All @@ -61,6 +75,7 @@ GEM
unicode-types (~> 1.8)
erb (4.0.4)
cgi (>= 0.3.3)
erubi (1.13.0)
eventmachine (1.2.7)
faraday (2.7.10)
faraday-net_http (>= 2.0, < 3.1)
Expand Down Expand Up @@ -146,6 +161,9 @@ GEM
sparql-client (~> 3.2, >= 3.2.2)
yaml-ld (~> 0.0)
logger (1.5.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
matrix (0.4.2)
metainspector (5.15.0)
addressable (~> 2.8.4)
Expand Down Expand Up @@ -196,6 +214,13 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rainbow (3.1.1)
rake (13.0.6)
rdf (3.3.1)
Expand Down Expand Up @@ -293,6 +318,10 @@ GEM
rspec-mocks (3.11.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-openapi (0.18.3)
actionpack (>= 5.2.0)
rails-dom-testing
rspec-core
rspec-support (3.11.1)
rubocop (1.54.2)
json (~> 2.3)
Expand Down Expand Up @@ -412,6 +441,8 @@ DEPENDENCIES
require_all
rest-client (~> 2.1.0)
rspec (~> 3.11.0)
rspec-core (~> 3.11)
rspec-openapi (~> 0.18.3)
rubocop
ruby-debug-ide
securerandom
Expand Down
72 changes: 35 additions & 37 deletions VP/vp-interface/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,61 +1,60 @@
# frozen_string_literal: false

require_relative "../../config/environment" # for docker
require "swagger/blocks"
require "sinatra"
require "sinatra/base"
require "json"
require "erb"
require_relative '../../config/environment' # for docker
require 'swagger/blocks'
require 'sinatra'
require 'sinatra/base'
require 'json'
require 'erb'
# require 'omniauth'
# require 'omniauth-openid-connect'
require 'jwt'

# DO NOT change the order of loading below. The files contain executable code that builds the overall configuration before this module starts
require_relative "../../lib/configuration" # VPConfig and FDPConfig
require_relative "models"
require_relative "routes"
require_relative "../../lib/cache"
require_relative "../../lib/fdp"
require_relative "../../lib/vp"
require_relative "../../lib/metadata_functions"
require_relative "../../lib/services"
require_relative "../../lib/wordcloud"

require_relative '../../lib/configuration' # VPConfig and FDPConfig
require_relative 'models'
require_relative 'routes'
require_relative '../../lib/cache'
require_relative '../../lib/fdp'
require_relative '../../lib/vp'
require_relative '../../lib/metadata_functions'
require_relative '../../lib/services'
require_relative '../../lib/wordcloud'

class ApplicationController < Sinatra::Application
include Swagger::Blocks

set :bind, "0.0.0.0"
set :bind, '0.0.0.0'
before do
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers['Access-Control-Allow-Origin'] = '*'
end

configure do
set :public_folder, "public"
set :views, "app/views"
set :public_folder, 'public'
set :views, 'app/views'
enable :cross_origin
end

# routes...
options "*" do
response.headers["Allow"] = "GET, PUT, POST, DELETE, OPTIONS"
response.headers["Access-Control-Allow-Headers"] = "Authorization, Content-Type, Accept, X-User-Email, X-Auth-Token"
response.headers["Access-Control-Allow-Origin"] = "*"
options '*' do
response.headers['Allow'] = 'GET, PUT, POST, DELETE, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type, Accept, X-User-Email, X-Auth-Token'
response.headers['Access-Control-Allow-Origin'] = '*'
200
end

swagger_root do
key :swagger, "2.0"
key :swagger, '2.0'
info do
key :version, "1.0.0"
key :title, "FLAIR-GG Virtual Platform Server"
key :description, "Enables discovery of Germplasm resources"
key :termsOfService, "https://example.org"
key :version, '1.0.0'
key :title, 'FLAIR-GG Virtual Platform Server'
key :description, 'Enables discovery of Germplasm resources'
key :termsOfService, 'https://example.org'
contact do
key :name, "Mark D. Wilkinson"
key :name, 'Mark D. Wilkinson'
end
license do
key :name, "MIT"
key :name, 'MIT'
end
end
# tag do
Expand All @@ -66,9 +65,9 @@ class ApplicationController < Sinatra::Application
# key :url, 'https://fairdata.services/Champion/about'
# end
# end
key :schemes, ["http"]
key :host, ENV.fetch("HARVESTER", nil)
key :basePath, "/flair-gg-vp-server"
key :schemes, ['http']
key :host, ENV.fetch('HARVESTER', nil)
key :basePath, '/flair-gg-vp-server'
# key :consumes, ['application/json']
# key :produces, ['application/json']
end
Expand All @@ -77,9 +76,8 @@ class ApplicationController < Sinatra::Application
SWAGGERED_CLASSES = [ErrorModel, AllResourcesResponse, OntologySearchResponse, KeywordSearchResponse, self].freeze

set_routes(classes: SWAGGERED_CLASSES)
VP.new(config: VPConfig.new) # set up index and active sites)

VP.new(config: VPConfig.new) # set up index and active sites)

run! # if app_file == $PROGRAM_NAME
end

Loading

0 comments on commit e79aa6f

Please sign in to comment.