Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge SKOS features and upstream #58

Merged
merged 95 commits into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
0b1914b
add skos? method to ontology_submission.rb
syphax-bouazzouni Oct 16, 2022
77d12f6
refactor skos_roots to be more clear
syphax-bouazzouni Oct 16, 2022
4bef949
make the root filter use only the main_concept_scheme
syphax-bouazzouni Oct 16, 2022
d8e46f0
add :inScheme and :isInScheme attributes
syphax-bouazzouni Oct 16, 2022
057bfe0
bring :InScheme in partially_load_children and traverse_path_to_root
syphax-bouazzouni Oct 16, 2022
38277e7
load isInScheme for the submission roots
syphax-bouazzouni Oct 16, 2022
138010f
move tree methods to the Concept::Tree module
syphax-bouazzouni Oct 16, 2022
52432b0
more class sort methods to the Concept::Sort module
syphax-bouazzouni Oct 16, 2022
c573244
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 16, 2022
65c48e5
fix the skos concepts tests
syphax-bouazzouni Oct 16, 2022
beb7163
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 16, 2022
3fab08c
filter roots by concept_schemes
syphax-bouazzouni Oct 16, 2022
fb711ac
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 16, 2022
9028d61
update traverse_path_to_root to use custom_roots
syphax-bouazzouni Oct 17, 2022
fa45dba
update tree to use custom roots
syphax-bouazzouni Oct 17, 2022
1791efa
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 17, 2022
0b56a04
improved exception handling for datatype mismatch errors
mdorf Oct 17, 2022
9358ab4
fixed a case described in ncbo/bioportal-project#251
mdorf Oct 17, 2022
89c4bbe
rename scheme file from 'sceme' to 'scheme'
syphax-bouazzouni Oct 18, 2022
48358f7
move skos roots and schemes to the concerns folder
syphax-bouazzouni Oct 18, 2022
10d864d
add skos Collection model
syphax-bouazzouni Oct 18, 2022
57ca5fa
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 18, 2022
b41d1b2
fix tree_root? when roots are nil
syphax-bouazzouni Oct 18, 2022
0af58ad
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 18, 2022
5922343
another fix to ncbo/bioportal-project#251
mdorf Oct 18, 2022
da86700
change classes attribute :isInScheme to :isInActiveScheme
syphax-bouazzouni Oct 19, 2022
9a18790
set isInActiveScheme equal to main_scheme if no concept_scheme is given
syphax-bouazzouni Oct 19, 2022
2bc1181
extract the inScheme methods of classes into a module
syphax-bouazzouni Oct 20, 2022
72fa83c
add :inCollection and :isInCollection to classes
syphax-bouazzouni Oct 20, 2022
1e62ac3
filter roots and children by collections
syphax-bouazzouni Oct 20, 2022
13b3811
update concepts tree to be filtered by collections
syphax-bouazzouni Oct 20, 2022
79b89db
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Oct 20, 2022
296be06
fix load_is_in_scheme if schemes equal nil
syphax-bouazzouni Oct 28, 2022
734a956
add skosxl:Label model
syphax-bouazzouni Oct 28, 2022
aa21248
add sksoxl namespace to configuration
syphax-bouazzouni Oct 28, 2022
8fd8804
add skosxl properties to class model
syphax-bouazzouni Oct 28, 2022
617d613
Merge branch 'features/add-skosxl' into development
syphax-bouazzouni Oct 28, 2022
4b0a6a4
add get roots by topConcept is no hasTopConcept found
syphax-bouazzouni Oct 29, 2022
6906cda
Merge branch 'features/main-concept-scheme-skos-roots' into features/…
syphax-bouazzouni Oct 29, 2022
fde60e5
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Oct 29, 2022
8859e26
add dcterms namespace
syphax-bouazzouni Nov 3, 2022
f058cb2
add the attributes dcterms:created and dcterms:modified to classes model
syphax-bouazzouni Nov 3, 2022
e811221
Merge branch 'pr/feautre/add-date-infos-to-classes' into features/add…
syphax-bouazzouni Nov 3, 2022
2a4a3ca
add dcterms namespace
syphax-bouazzouni Nov 3, 2022
f4df352
add the attributes dcterms:created and dcterms:modified to classes model
syphax-bouazzouni Nov 3, 2022
29d8834
Merge branch 'pr/feautre/add-date-infos-to-classes' into development
syphax-bouazzouni Nov 3, 2022
a00dac9
a partial fix to ncbo/bioportal-project#251
mdorf Nov 3, 2022
6080753
Gemfile.lock update
mdorf Nov 3, 2022
b0f56d5
add collection, scheme and xl_labels links to ontology
syphax-bouazzouni Nov 15, 2022
0c82502
add self link to skosxl:label model
syphax-bouazzouni Nov 15, 2022
3da053d
Merge branch 'features/skos-add-links' into development
syphax-bouazzouni Nov 15, 2022
bfbaa07
fix a typo in load_is_in_collection
syphax-bouazzouni Nov 15, 2022
cf343ce
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 15, 2022
323696d
Bump up version of actions/checkout
alexskr Nov 17, 2022
81c7977
get the correct type by passing the object collection as argument
syphax-bouazzouni Nov 17, 2022
1d28ce9
Merge branch 'pr/fix/set-correct-type-for-skos-concept' into development
syphax-bouazzouni Nov 17, 2022
0545150
extract if hash["@id"] condition
syphax-bouazzouni Nov 17, 2022
4c2f446
Merge branch 'pr/fix/set-correct-type-for-skos-concept' into development
syphax-bouazzouni Nov 17, 2022
39364c0
remove unused argument
syphax-bouazzouni Nov 17, 2022
ba7a7f8
test if hashed_obj.respond_to?(:collection) before calling it
syphax-bouazzouni Nov 17, 2022
cfe3342
Merge branch 'pr/fix/set-correct-type-for-skos-concept' into development
syphax-bouazzouni Nov 17, 2022
a9a28f4
Remove duplicate file
alexskr Nov 17, 2022
8628abe
New version of the owlapi-wrapper JAR (v 1.4.1)
jvendetti Nov 17, 2022
4f9139d
Merge branch 'develop'
alexskr Nov 17, 2022
79ebda5
use uneskos:memberOf instead of inCollection
syphax-bouazzouni Nov 21, 2022
6af9e7c
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 21, 2022
0615583
add skos concept schemes tests
syphax-bouazzouni Nov 25, 2022
6b91724
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Nov 25, 2022
9aeda3a
add skos collections tests
syphax-bouazzouni Nov 25, 2022
5dde056
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 25, 2022
0adc556
add skos xl label tests
syphax-bouazzouni Nov 25, 2022
79c9cd4
Merge branch 'features/add-skosxl' into development
syphax-bouazzouni Nov 25, 2022
00af00a
update skos submission roots tests
syphax-bouazzouni Nov 25, 2022
f5b9f00
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni Nov 25, 2022
62a286f
add skos submission roots collections filter tests
syphax-bouazzouni Nov 25, 2022
e3b64b4
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 25, 2022
5063e5a
use memberOf instead of inCollection in InCollection module
syphax-bouazzouni Nov 25, 2022
013bc04
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 25, 2022
b6c1ca3
handle nil to_load
syphax-bouazzouni Nov 25, 2022
7eb2449
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 25, 2022
daf312a
update config.rb.sample to add main_languages
syphax-bouazzouni Nov 25, 2022
63da777
fix main_languages configuration tests
syphax-bouazzouni Nov 28, 2022
87faf4c
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Nov 28, 2022
0e96a3b
remove SAME_URI filter exception
syphax-bouazzouni Nov 29, 2022
b0c2c65
fix rest mappings tests
syphax-bouazzouni Nov 29, 2022
b567855
Merge branch 'feature/extract-internal-mappings' into development
syphax-bouazzouni Nov 29, 2022
0f7b7c7
never serialize member attribute, to not be fetch with display=all
syphax-bouazzouni Dec 13, 2022
2369fc6
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Dec 13, 2022
9a692f8
set :memberOf, :inScheme as serialize_default for concepts
syphax-bouazzouni Dec 13, 2022
b410981
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni Dec 13, 2022
be787b5
Merge branch 'master' into development
syphax-bouazzouni Dec 17, 2022
168eccf
Merge remote-tracking branch 'upstream/master' into upstream
syphax-bouazzouni Dec 17, 2022
ba0b72b
Merge branch 'upstream v5.23.1' into development
syphax-bouazzouni Dec 17, 2022
d43c850
Revert "Merge branch 'features/add-skosxl' into development"
syphax-bouazzouni Dec 17, 2022
5422b84
fix skos test data conflict after merge
syphax-bouazzouni Dec 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TDOD: do a pull request for this refactored module

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