Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Dec 24, 2022
2 parents 23fe9b9 + 2ac6281 commit 2e437eb
Show file tree
Hide file tree
Showing 33 changed files with 382,062 additions and 293 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
backend: ['ruby'] # ruby runs tests with 4store backend and ruby-agraph runs with AllegroGraph backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up solr configsets
run: ./test/solr/generate_ncbo_configsets.sh
- name: create config.rb file
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

gem 'activesupport', '~> 4'
gem 'addressable', '= 2.3.5'
gem 'addressable', '~> 2.8'
gem 'bcrypt', '~> 3.0'
gem 'cube-ruby', require: 'cube'
gem 'faraday', '~> 1.9'
Expand Down
51 changes: 33 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 835aefa458186485eef60d3845315c478a95ff23
revision: 3d5bbe1db4a6aca2ff621ccfcdb85a32dbe9704e
branch: development
specs:
goo (0.0.2)
addressable (= 2.3.5)
addressable (~> 2.8)
pry
rdf (= 1.0.8)
redis
rest-client
rsolr
sparql-client
systemu
uuid

GIT
Expand All @@ -33,7 +32,8 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
ansi (1.5.0)
ast (2.4.2)
bcrypt (3.1.18)
Expand All @@ -43,6 +43,7 @@ GEM
connection_pool (2.3.0)
cube-ruby (0.0.3)
daemons (1.4.1)
date (3.3.2)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
Expand Down Expand Up @@ -82,16 +83,19 @@ GEM
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.6.2)
json_pure (2.6.2)
launchy (2.4.3)
addressable (~> 2.3)
json (2.6.3)
json_pure (2.6.3)
launchy (2.5.0)
addressable (~> 2.7)
libxml-ruby (2.9.0)
logger (1.5.1)
logger (1.5.3)
macaddr (1.7.2)
systemu (~> 2.6.5)
mail (2.7.1)
mail (2.8.0)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
Expand All @@ -106,12 +110,21 @@ GEM
multi_json (1.15.0)
multipart-post (2.2.3)
net-http-persistent (2.9.4)
net-imap (0.3.2)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-protocol
netrc (0.11.0)
oj (2.18.5)
omni_logger (0.1.4)
logger
parallel (1.22.1)
parser (3.1.2.1)
parser (3.1.3.0)
ast (~> 2.4.1)
pony (1.13.1)
mail (>= 2.0)
Expand All @@ -120,6 +133,7 @@ GEM
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.1)
rack (1.6.13)
rack-test (0.8.3)
rack (>= 1.0, < 3)
Expand All @@ -129,9 +143,9 @@ GEM
addressable (>= 2.2)
redis (5.0.5)
redis-client (>= 0.9.0)
redis-client (0.9.0)
redis-client (0.11.2)
connection_pool
regexp_parser (2.5.0)
regexp_parser (2.6.1)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
Expand All @@ -140,17 +154,17 @@ GEM
rexml (3.2.5)
rsolr (1.1.2)
builder (>= 2.1.2)
rubocop (1.36.0)
rubocop (1.40.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.20.1, < 2.0)
rubocop-ast (>= 1.23.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
rubocop-ast (1.24.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
Expand All @@ -172,6 +186,7 @@ GEM
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thread_safe (0.3.6)
timeout (0.3.1)
tzinfo (0.3.61)
unf (0.1.4)
unf_ext
Expand All @@ -185,7 +200,7 @@ PLATFORMS

DEPENDENCIES
activesupport (~> 4)
addressable (= 2.3.5)
addressable (~> 2.8)
bcrypt (~> 3.0)
cube-ruby
email_spec
Expand Down Expand Up @@ -214,4 +229,4 @@ DEPENDENCIES
thin

BUNDLED WITH
2.3.14
2.3.15
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/owlapi-wrapper.jar
3 changes: 3 additions & 0 deletions config/config.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ LinkedData.config do |config|
config.purl_password = ""
config.purl_maintainers = ""
config.purl_target_url_prefix = "http://bioportal.bioontology.org"
Goo.configure do |conf|
conf.main_languages = ['en']
end
end

#sometimes tmp by default cannot allocate large files
Expand Down
4 changes: 2 additions & 2 deletions config/config.test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
config.ontology_analytics_redis_port = REDIS_PORT.to_i
config.search_server_url = SOLR_TERM_SEARCH_URL.to_s
config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s
# config.enable_notifications = false
end
# config.enable_notifications = false
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module LinkedData
module Concerns
module Concept
module InCollection
def self.included(base)
base.serialize_methods :isInActiveCollection
end

def isInActiveCollection
@isInActiveCollection
end

def inCollection?(collection)
self.memberOf.include?(collection)
end

def load_is_in_collection(collections = [])
included = collections.select { |s| inCollection?(s) }
@isInActiveCollection = included
end

end
end
end
end
26 changes: 26 additions & 0 deletions lib/ontologies_linked_data/concerns/concepts/concept_in_scheme.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module LinkedData
module Concerns
module Concept
module InScheme
def self.included(base)
base.serialize_methods :isInActiveScheme
end

def isInActiveScheme
@isInActiveScheme
end

def inScheme?(scheme)
self.inScheme.include?(scheme)
end

def load_is_in_scheme(schemes = [])
included = schemes.select { |s| inScheme?(s) }
included = [self.submission.get_main_concept_scheme] if included.empty? && schemes&.empty?
@isInActiveScheme = included
end

end
end
end
end
55 changes: 55 additions & 0 deletions lib/ontologies_linked_data/concerns/concepts/concept_sort.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module LinkedData
module Concerns
module Concept
module Sort
module ClassMethods
def compare_classes(class_a, class_b)
label_a = ""
label_b = ""
class_a.bring(:prefLabel) if class_a.bring?(:prefLabel)
class_b.bring(:prefLabel) if class_b.bring?(:prefLabel)

begin
label_a = class_a.prefLabel unless (class_a.prefLabel.nil? || class_a.prefLabel.empty?)
rescue Goo::Base::AttributeNotLoaded
label_a = ""
end

begin
label_b = class_b.prefLabel unless (class_b.prefLabel.nil? || class_b.prefLabel.empty?)
rescue Goo::Base::AttributeNotLoaded
label_b = ""
end

label_a = class_a.id if label_a.empty?
label_b = class_b.id if label_b.empty?

[label_a.downcase] <=> [label_b.downcase]
end

def sort_classes(classes)
classes.sort { |class_a, class_b| compare_classes(class_a, class_b) }
end

def sort_tree_children(root_node)
sort_classes!(root_node.children)
root_node.children.each { |ch| sort_tree_children(ch) }
end

private



def sort_classes!(classes)
classes.sort! { |class_a, class_b| LinkedData::Models::Class.compare_classes(class_a, class_b) }
classes
end
end

def self.included(base)
base.extend(ClassMethods)
end
end
end
end
end
Loading

0 comments on commit 2e437eb

Please sign in to comment.