Skip to content

Commit

Permalink
Merge pull request #210 from ncbo/develop
Browse files Browse the repository at this point in the history
Develop to master merge, release v5.31.0
  • Loading branch information
alexskr authored Jun 12, 2024
2 parents 67bfd05 + 013a322 commit f339344
Show file tree
Hide file tree
Showing 41 changed files with 382,874 additions and 1,017 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.bundle/
*.swp
*.gemtags
.bundle
Expand Down
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ gem 'rest-client'
gem 'rsolr'
gem 'rubyzip', '~> 1.0'
gem 'thin'
gem 'request_store'


# Testing
group :test do
Expand All @@ -31,7 +33,6 @@ end
group :development do
gem 'rubocop', require: false
end

# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'goo', github: 'ncbo/goo', branch: 'master'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'
gem 'goo', github: 'ncbo/goo', branch: 'develop'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'develop'
29 changes: 17 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/ncbo/goo.git
revision: ef2d816df2d263c905bd034efd449a964fa4890f
branch: master
revision: 70007faf43d0d96292809f89f15a27a757ccaa25
branch: develop
specs:
goo (0.0.2)
addressable (~> 2.8)
Expand All @@ -16,8 +16,8 @@ GIT

GIT
remote: https://github.com/ncbo/sparql-client.git
revision: e89c26aa96f184dbe9b52d51e04fb3d9ba998dbc
branch: master
revision: 1657f0dd69fd4b522d3549a6848670175f5e98cc
branch: develop
specs:
sparql-client (1.0.1)
json_pure (>= 1.4)
Expand All @@ -39,7 +39,7 @@ GEM
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.7)
bigdecimal (3.1.8)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.2.3)
Expand Down Expand Up @@ -84,7 +84,7 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
mime-types-data (3.2024.0507)
mini_mime (1.1.5)
minitest (4.7.5)
minitest-reporters (0.14.24)
Expand All @@ -94,7 +94,7 @@ GEM
powerbar
multi_json (1.15.0)
net-http-persistent (2.9.4)
net-imap (0.4.10)
net-imap (0.4.11)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -120,7 +120,7 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.5)
racc (1.7.3)
racc (1.8.0)
rack (2.2.9)
rack-test (0.8.3)
rack (>= 1.0, < 3)
Expand All @@ -132,19 +132,20 @@ GEM
redis-client (>= 0.22.0)
redis-client (0.22.1)
connection_pool
regexp_parser (2.9.0)
regexp_parser (2.9.2)
request_store (1.7.0)
rack (>= 1.4)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rsolr (2.6.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
rubocop (1.63.4)
rubocop (1.63.5)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -169,6 +170,7 @@ GEM
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
strscan (3.1.0)
systemu (2.6.5)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
Expand All @@ -182,8 +184,10 @@ GEM
macaddr (~> 1.0)

PLATFORMS
arm64-darwin-22
aarch64-linux
x86_64-darwin-21
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
activesupport (~> 4)
Expand All @@ -204,6 +208,7 @@ DEPENDENCIES
rack
rack-test (~> 0.6)
rake (~> 10.0)
request_store
rest-client
rsolr
rubocop
Expand Down
1,010 changes: 520 additions & 490 deletions config/solr/term_search/schema.xml

Large diffs are not rendered by default.

60 changes: 41 additions & 19 deletions lib/ontologies_linked_data/config/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,13 @@ def config(&block)
yield @settings, overide_connect_goo if block_given?

# Check to make sure url prefix has trailing slash
@settings.rest_url_prefix = @settings.rest_url_prefix + '/' unless @settings.rest_url_prefix[-1].eql?('/')
@settings.rest_url_prefix = "#{@settings.rest_url_prefix}/" unless @settings.rest_url_prefix[-1].eql?('/')

puts "(LD) >> Using rdf store #{@settings.goo_host}:#{@settings.goo_port}#{@settings.goo_path_query}"
puts "(LD) >> Using term search server at #{@settings.search_server_url}"
puts "(LD) >> Using property search server at #{@settings.property_search_server_url}"
puts '(LD) >> Using HTTP Redis instance at '+
"#{@settings.http_redis_host}:#{@settings.http_redis_port}"
puts '(LD) >> Using Goo Redis instance at '+
"#{@settings.goo_redis_host}:#{@settings.goo_redis_port}"
puts "(LD) >> Using HTTP Redis instance at #{@settings.http_redis_host}:#{@settings.http_redis_port}"
puts "(LD) >> Using Goo Redis instance at #{@settings.goo_redis_host}:#{@settings.goo_redis_port}"

connect_goo unless overide_connect_goo
end
Expand Down Expand Up @@ -132,15 +130,14 @@ def connect_goo
port: @settings.goo_redis_port)

if @settings.enable_monitoring
puts "(LD) >> Enable SPARQL monitoring with cube #{@settings.cube_host}:"+
"#{@settings.cube_port}"
puts "(LD) >> Enable SPARQL monitoring with cube #{@settings.cube_host}:#{@settings.cube_port}"
conf.enable_cube do |opts|
opts[:host] = @settings.cube_host
opts[:port] = @settings.cube_port
end
end
end
rescue Exception => e
rescue StandardError => e
abort("EXITING: Cannot connect to triplestore and/or search server:\n #{e}\n#{e.backtrace.join("\n")}")
end
end
Expand All @@ -153,23 +150,48 @@ def goo_namespaces
conf.add_namespace(:omv, RDF::Vocabulary.new("http://omv.ontoware.org/2005/05/ontology#"))
conf.add_namespace(:skos, RDF::Vocabulary.new("http://www.w3.org/2004/02/skos/core#"))
conf.add_namespace(:owl, RDF::Vocabulary.new("http://www.w3.org/2002/07/owl#"))
conf.add_namespace(:rdf, RDF::Vocabulary.new("http://www.w3.org/1999/02/22-rdf-syntax-ns#"))
conf.add_namespace(:rdfs, RDF::Vocabulary.new("http://www.w3.org/2000/01/rdf-schema#"))
conf.add_namespace(:metadata,
RDF::Vocabulary.new("http://data.bioontology.org/metadata/"),
default = true)
conf.add_namespace(:metadata_def,
RDF::Vocabulary.new("http://data.bioontology.org/metadata/def/"))
conf.add_namespace(:metadata, RDF::Vocabulary.new("http://data.bioontology.org/metadata/"), default = true)
conf.add_namespace(:metadata_def, RDF::Vocabulary.new("http://data.bioontology.org/metadata/def/"))
conf.add_namespace(:dc, RDF::Vocabulary.new("http://purl.org/dc/elements/1.1/"))
conf.add_namespace(:xsd, RDF::Vocabulary.new("http://www.w3.org/2001/XMLSchema#"))
conf.add_namespace(:oboinowl_gen,
RDF::Vocabulary.new("http://www.geneontology.org/formats/oboInOwl#"))
conf.add_namespace(:oboinowl_gen, RDF::Vocabulary.new("http://www.geneontology.org/formats/oboInOwl#"))
conf.add_namespace(:obo_purl, RDF::Vocabulary.new("http://purl.obolibrary.org/obo/"))
conf.add_namespace(:umls,
RDF::Vocabulary.new("http://bioportal.bioontology.org/ontologies/umls/"))
conf.id_prefix = "http://data.bioontology.org/"
conf.add_namespace(:umls, RDF::Vocabulary.new("http://bioportal.bioontology.org/ontologies/umls/"))
conf.add_namespace(:door, RDF::Vocabulary.new("http://kannel.open.ac.uk/ontology#"))
conf.add_namespace(:dct, RDF::Vocabulary.new("http://purl.org/dc/terms/"))

conf.add_namespace(:void, RDF::Vocabulary.new("http://rdfs.org/ns/void#"))
conf.add_namespace(:foaf, RDF::Vocabulary.new("http://xmlns.com/foaf/0.1/"))
conf.add_namespace(:vann, RDF::Vocabulary.new("http://purl.org/vocab/vann/"))
conf.add_namespace(:adms, RDF::Vocabulary.new("http://www.w3.org/ns/adms#"))
conf.add_namespace(:voaf, RDF::Vocabulary.new("http://purl.org/vocommons/voaf#"))
conf.add_namespace(:dcat, RDF::Vocabulary.new("http://www.w3.org/ns/dcat#"))
conf.add_namespace(:mod, RDF::Vocabulary.new("http://www.isibang.ac.in/ns/mod#"))
conf.add_namespace(:prov, RDF::Vocabulary.new("http://www.w3.org/ns/prov#"))
conf.add_namespace(:cc, RDF::Vocabulary.new("http://creativecommons.org/ns#"))
conf.add_namespace(:schema, RDF::Vocabulary.new("http://schema.org/"))
conf.add_namespace(:doap, RDF::Vocabulary.new("http://usefulinc.com/ns/doap#"))
conf.add_namespace(:bibo, RDF::Vocabulary.new("http://purl.org/ontology/bibo/"))
conf.add_namespace(:wdrs, RDF::Vocabulary.new("http://www.w3.org/2007/05/powder-s#"))
conf.add_namespace(:cito, RDF::Vocabulary.new("http://purl.org/spar/cito/"))
conf.add_namespace(:pav, RDF::Vocabulary.new("http://purl.org/pav/"))
conf.add_namespace(:oboInOwl, RDF::Vocabulary.new("http://www.geneontology.org/formats/oboInOwl#"))
conf.add_namespace(:idot, RDF::Vocabulary.new("http://identifiers.org/idot/"))
conf.add_namespace(:sd, RDF::Vocabulary.new("http://www.w3.org/ns/sparql-service-description#"))
conf.add_namespace(:org, RDF::Vocabulary.new("http://www.w3.org/ns/org#"))
conf.add_namespace(:cclicense, RDF::Vocabulary.new("http://creativecommons.org/licenses/"))
conf.add_namespace(:nkos, RDF::Vocabulary.new("http://w3id.org/nkos#"))
conf.add_namespace(:skosxl, RDF::Vocabulary.new("http://www.w3.org/2008/05/skos-xl#"))
conf.add_namespace(:dcterms, RDF::Vocabulary.new("http://purl.org/dc/terms/"))
conf.add_namespace(:uneskos, RDF::Vocabulary.new("http://purl.org/umu/uneskos#"))


conf.id_prefix = 'http://data.bioontology.org/'
conf.pluralize_models(true)
end
end
self.goo_namespaces
goo_namespaces

end
4 changes: 2 additions & 2 deletions lib/ontologies_linked_data/diff/bubastis_diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class BubastisDiffCommand < DiffTool
# Loading one file locally and one from the web and outputting results to plain text:
# java -jar bubastis_1_2.jar -ontology1 "H://disease_ontology_version_1.owl" -ontology2 "http://www.disease.org/diseaseontology_latest.owl" -output "C://my_diff.txt"

def initialize(old_file_path, new_file_path)
def initialize(old_file_path, new_file_path, output_repo)
@bubastis_jar_path = LinkedData.bindir + "/bubastis.jar"
@input_fileOld = old_file_path
@input_fileNew = new_file_path
@output_repo = File.expand_path(@input_fileNew).gsub(File.basename(@input_fileNew),'')
@output_repo = output_repo
@file_diff_path = nil
@java_heap_size = LinkedData.settings.java_max_heap_size
end
Expand Down
22 changes: 11 additions & 11 deletions lib/ontologies_linked_data/models/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ def self.goo_attrs_to_load(attributes = [], level = 0)
raise ArgumentError, "`attributes` should be an array" unless attributes.is_a?(Array)

# Get attributes, either provided, all, or default
if !attributes.empty?
if attributes.first == :all
default_attrs = self.attributes
else
default_attrs = attributes
end
elsif self.hypermedia_settings[:serialize_default].empty?
default_attrs = self.attributes
else
default_attrs = self.hypermedia_settings[:serialize_default].dup
end
default_attrs = if !attributes.empty?
if attributes.first == :all
(self.attributes + self.hypermedia_settings[:serialize_default]).uniq
else
attributes
end
elsif self.hypermedia_settings[:serialize_default].empty?
self.attributes
else
self.hypermedia_settings[:serialize_default].dup
end

embed_attrs = {}
extra_attrs = []
Expand Down
Loading

0 comments on commit f339344

Please sign in to comment.