diff --git a/.rubocop.yml b/.rubocop.yml index b319e04..4d2a223 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,4 +13,13 @@ Layout/LineLength: Max: 120 Metrics/MethodLength: - Max: 40 + Max: 100 + +Metrics/AbcSize: + Enabled: false + +Style/ClassVars: + Enabled: false + +Layout/ExtraSpacing: + Enabled: false diff --git a/TransformationPipeline/data/administrative_yarrrml.pre-yaml b/TransformationPipeline/data/administrative_yarrrml.pre-yaml index e7deb80..3ded5d9 100644 --- a/TransformationPipeline/data/administrative_yarrrml.pre-yaml +++ b/TransformationPipeline/data/administrative_yarrrml.pre-yaml @@ -13,7 +13,6 @@ prefixes: foaf: http://xmlns.com/foaf/0.1/ schema: https://schema.org/ - sources: source_location: access: /mnt/data/administrative.csv @@ -70,8 +69,12 @@ mapping: predicate: rdfs:label - objects: + - function : idlab-fn:concat + parameters: + - [idlab-fn:str, $(org_id)] + - [idlab-fn:otherStr, 'Organization'] + - [idlab-fn:delimiter, '#'] type: iri - value: $(org_id)#OrganizationID predicate: sio:SIO_000671 @@ -81,7 +84,14 @@ mapping: graph: this:$(uniqid)_Context sources: - source_location - subjects: $(org_id)#OrganizationID + subjects: + - function : idlab-fn:concat + parameters: + - [idlab-fn:str, $(org_id)] + - [idlab-fn:otherStr, 'Organization'] + - [idlab-fn:delimiter, '#'] + type: iri + predicateobject: - objects: type: iri diff --git a/VP/vp-interface/Gemfile b/VP/vp-interface/Gemfile index 29537cc..461761e 100644 --- a/VP/vp-interface/Gemfile +++ b/VP/vp-interface/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: false + source "https://rubygems.org" gemspec diff --git a/VP/vp-interface/app/controllers/application_controller.rb b/VP/vp-interface/app/controllers/application_controller.rb index c9135dc..969da1a 100644 --- a/VP/vp-interface/app/controllers/application_controller.rb +++ b/VP/vp-interface/app/controllers/application_controller.rb @@ -1,4 +1,5 @@ -# require './config/environment' +# frozen_string_literal: false + require_relative "../../config/environment" # for docker require "swagger/blocks" require "sinatra" diff --git a/VP/vp-interface/app/controllers/routes.rb b/VP/vp-interface/app/controllers/routes.rb index 2b6e261..b5a590f 100644 --- a/VP/vp-interface/app/controllers/routes.rb +++ b/VP/vp-interface/app/controllers/routes.rb @@ -1,8 +1,8 @@ +# frozen_string_literal: false def set_routes(classes: allclasses) - - set :server_settings, :timeout => 180 - set :public_folder, 'public' + set :server_settings, timeout: 180 + set :public_folder, "public" get "/flair-gg-vp-server" do content_type :json @@ -29,19 +29,19 @@ def set_routes(classes: allclasses) get "/flair-gg-vp-server/ontology-search" do term = params["uri"] - term = term.gsub(/\S+\:/, "") unless term =~ /^http/ - @discoverables = VP.current_vp.ontology_search_shell(term: term) # "./lib/vp" + term = term.gsub(/\S+:/, "") unless term =~ /^http/ + @discoverables = VP.current_vp.ontology_search_shell(term: term) # "./lib/vp" erb :discovered_layout end get "/flair-gg-vp-server/retrieve-services" do term = params["services"] - @servicecollection, @commonparams = VP.current_vp.retrieve_sevices(term: term) # "./lib/vp" + @servicecollection, @commonparams = VP.current_vp.retrieve_sevices(term: term) # "./lib/vp" erb :services_layout end get "/flair-gg-vp-server/wordcloud" do - @freqs = Wordcloud.new.count_words # "./lib/wordcloud" + @freqs = Wordcloud.new.count_words # "./lib/wordcloud" erb :wordcloud end @@ -65,15 +65,11 @@ def set_routes(classes: allclasses) end post "/flair-gg-vp-server/execute-data-services" do - @results = VP.current_vp.execute_data_services(params: params) erb :execution_results_layout - end before do @services = VP.current_vp.collect_data_services - end - end diff --git a/VP/vp-interface/lib/services.rb b/VP/vp-interface/lib/services.rb index 9c305fd..7ebc582 100644 --- a/VP/vp-interface/lib/services.rb +++ b/VP/vp-interface/lib/services.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: false + require "openapi3_parser" require "cgi" diff --git a/VP/vp-interface/lib/vp.rb b/VP/vp-interface/lib/vp.rb index ad2788a..5b71e03 100644 --- a/VP/vp-interface/lib/vp.rb +++ b/VP/vp-interface/lib/vp.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: false + require "linkeddata" require "digest" require "restclient" @@ -19,8 +21,8 @@ class VP @@thisvp = "" def initialize(config: vpconfig) - @vpconfig = vpconfig # my configuration - @networkgraph = RDF::Graph.new # the full network of FDP triples + @vpconfig = config # my configuration + @networkgraph = RDF::Graph.new # the full network of FDP triples @fdps = [] # the FDPs that I know @aboutme = [] # the list of keywords for the word cloud load_fdps_from_cache @@ -52,7 +54,7 @@ def self.restart fdpsites = VPConfig::FDPSITES # current sites fdpsites.each do |fdp_address| # one for every active FDP site - warn "deleting #{fdp_address}" + warn "deleting #{fdp_address}" hexaddress = Digest::SHA256.hexdigest fdp_address FileUtils.rm_f("./cache/#{hexaddress}.marsh") # clear existing cache end @@ -61,7 +63,7 @@ def self.restart fdpsites = VPConfig::FDPSITES # new set of sites fdpsites.each do |fdp_address| # one for every active FDP site - warn "working with #{fdp_address}" + warn "working with #{fdp_address}" fdp = FDP.new(address: fdp_address) fdp.freezeme vp.add_fdp(fdp: fdp) @@ -104,13 +106,13 @@ def keyword_search_shell(keyword:) discoverables = keyword_search(keyword: keyword) discoverables end - + def ontology_search_shell(term:) warn "in ontology search shell" discoverables = ontology_search(uri: term) discoverables end - + def keyword_search(keyword: "") @graph = self.networkgraph vpd = SPARQL.parse("