Skip to content

Commit

Permalink
various typos, and silence rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
markwilkinson committed Jan 4, 2024
1 parent dc2309a commit 317fc75
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 22 deletions.
11 changes: 10 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 13 additions & 3 deletions TransformationPipeline/data/administrative_yarrrml.pre-yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ prefixes:
foaf: http://xmlns.com/foaf/0.1/
schema: https://schema.org/


sources:
source_location:
access: /mnt/data/administrative.csv
Expand Down Expand Up @@ -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


Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions VP/vp-interface/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: false

source "https://rubygems.org"

gemspec
Expand Down
3 changes: 2 additions & 1 deletion VP/vp-interface/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# require './config/environment'
# frozen_string_literal: false

require_relative "../../config/environment" # for docker
require "swagger/blocks"
require "sinatra"
Expand Down
18 changes: 7 additions & 11 deletions VP/vp-interface/app/controllers/routes.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -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
2 changes: 2 additions & 0 deletions VP/vp-interface/lib/services.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: false

require "openapi3_parser"
require "cgi"

Expand Down
14 changes: 8 additions & 6 deletions VP/vp-interface/lib/vp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: false

require "linkeddata"
require "digest"
require "restclient"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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("
Expand Down

0 comments on commit 317fc75

Please sign in to comment.