forked from ontoportal/ontologies_linked_data
-
Notifications
You must be signed in to change notification settings - Fork 6
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
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 77d12f6
refactor skos_roots to be more clear
syphax-bouazzouni 4bef949
make the root filter use only the main_concept_scheme
syphax-bouazzouni d8e46f0
add :inScheme and :isInScheme attributes
syphax-bouazzouni 057bfe0
bring :InScheme in partially_load_children and traverse_path_to_root
syphax-bouazzouni 38277e7
load isInScheme for the submission roots
syphax-bouazzouni 138010f
move tree methods to the Concept::Tree module
syphax-bouazzouni 52432b0
more class sort methods to the Concept::Sort module
syphax-bouazzouni c573244
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 65c48e5
fix the skos concepts tests
syphax-bouazzouni beb7163
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 3fab08c
filter roots by concept_schemes
syphax-bouazzouni fb711ac
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 9028d61
update traverse_path_to_root to use custom_roots
syphax-bouazzouni fa45dba
update tree to use custom roots
syphax-bouazzouni 1791efa
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 0b56a04
improved exception handling for datatype mismatch errors
mdorf 9358ab4
fixed a case described in ncbo/bioportal-project#251
mdorf 89c4bbe
rename scheme file from 'sceme' to 'scheme'
syphax-bouazzouni 48358f7
move skos roots and schemes to the concerns folder
syphax-bouazzouni 10d864d
add skos Collection model
syphax-bouazzouni 57ca5fa
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni b41d1b2
fix tree_root? when roots are nil
syphax-bouazzouni 0af58ad
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 5922343
another fix to ncbo/bioportal-project#251
mdorf da86700
change classes attribute :isInScheme to :isInActiveScheme
syphax-bouazzouni 9a18790
set isInActiveScheme equal to main_scheme if no concept_scheme is given
syphax-bouazzouni 2bc1181
extract the inScheme methods of classes into a module
syphax-bouazzouni 72fa83c
add :inCollection and :isInCollection to classes
syphax-bouazzouni 1e62ac3
filter roots and children by collections
syphax-bouazzouni 13b3811
update concepts tree to be filtered by collections
syphax-bouazzouni 79b89db
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 296be06
fix load_is_in_scheme if schemes equal nil
syphax-bouazzouni 734a956
add skosxl:Label model
syphax-bouazzouni aa21248
add sksoxl namespace to configuration
syphax-bouazzouni 8fd8804
add skosxl properties to class model
syphax-bouazzouni 617d613
Merge branch 'features/add-skosxl' into development
syphax-bouazzouni 4b0a6a4
add get roots by topConcept is no hasTopConcept found
syphax-bouazzouni 6906cda
Merge branch 'features/main-concept-scheme-skos-roots' into features/…
syphax-bouazzouni fde60e5
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 8859e26
add dcterms namespace
syphax-bouazzouni f058cb2
add the attributes dcterms:created and dcterms:modified to classes model
syphax-bouazzouni e811221
Merge branch 'pr/feautre/add-date-infos-to-classes' into features/add…
syphax-bouazzouni 2a4a3ca
add dcterms namespace
syphax-bouazzouni f4df352
add the attributes dcterms:created and dcterms:modified to classes model
syphax-bouazzouni 29d8834
Merge branch 'pr/feautre/add-date-infos-to-classes' into development
syphax-bouazzouni a00dac9
a partial fix to ncbo/bioportal-project#251
mdorf 6080753
Gemfile.lock update
mdorf b0f56d5
add collection, scheme and xl_labels links to ontology
syphax-bouazzouni 0c82502
add self link to skosxl:label model
syphax-bouazzouni 3da053d
Merge branch 'features/skos-add-links' into development
syphax-bouazzouni bfbaa07
fix a typo in load_is_in_collection
syphax-bouazzouni cf343ce
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 323696d
Bump up version of actions/checkout
alexskr 81c7977
get the correct type by passing the object collection as argument
syphax-bouazzouni 1d28ce9
Merge branch 'pr/fix/set-correct-type-for-skos-concept' into development
syphax-bouazzouni 0545150
extract if hash["@id"] condition
syphax-bouazzouni 4c2f446
Merge branch 'pr/fix/set-correct-type-for-skos-concept' into development
syphax-bouazzouni 39364c0
remove unused argument
syphax-bouazzouni ba7a7f8
test if hashed_obj.respond_to?(:collection) before calling it
syphax-bouazzouni cfe3342
Merge branch 'pr/fix/set-correct-type-for-skos-concept' into development
syphax-bouazzouni a9a28f4
Remove duplicate file
alexskr 8628abe
New version of the owlapi-wrapper JAR (v 1.4.1)
jvendetti 4f9139d
Merge branch 'develop'
alexskr 79ebda5
use uneskos:memberOf instead of inCollection
syphax-bouazzouni 6af9e7c
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 0615583
add skos concept schemes tests
syphax-bouazzouni 6b91724
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 9aeda3a
add skos collections tests
syphax-bouazzouni 5dde056
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 0adc556
add skos xl label tests
syphax-bouazzouni 79c9cd4
Merge branch 'features/add-skosxl' into development
syphax-bouazzouni 00af00a
update skos submission roots tests
syphax-bouazzouni f5b9f00
Merge branch 'features/main-concept-scheme-skos-roots' into development
syphax-bouazzouni 62a286f
add skos submission roots collections filter tests
syphax-bouazzouni e3b64b4
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 5063e5a
use memberOf instead of inCollection in InCollection module
syphax-bouazzouni 013bc04
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni b6c1ca3
handle nil to_load
syphax-bouazzouni 7eb2449
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni daf312a
update config.rb.sample to add main_languages
syphax-bouazzouni 63da777
fix main_languages configuration tests
syphax-bouazzouni 87faf4c
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 0e96a3b
remove SAME_URI filter exception
syphax-bouazzouni b0c2c65
fix rest mappings tests
syphax-bouazzouni b567855
Merge branch 'feature/extract-internal-mappings' into development
syphax-bouazzouni 0f7b7c7
never serialize member attribute, to not be fetch with display=all
syphax-bouazzouni 2369fc6
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni 9a692f8
set :memberOf, :inScheme as serialize_default for concepts
syphax-bouazzouni b410981
Merge branch 'features/add-skos-collection-filter' into development
syphax-bouazzouni be787b5
Merge branch 'master' into development
syphax-bouazzouni 168eccf
Merge remote-tracking branch 'upstream/master' into upstream
syphax-bouazzouni ba0b72b
Merge branch 'upstream v5.23.1' into development
syphax-bouazzouni d43c850
Revert "Merge branch 'features/add-skosxl' into development"
syphax-bouazzouni 5422b84
fix skos test data conflict after merge
syphax-bouazzouni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
lib/ontologies_linked_data/concerns/concepts/concept_in_collection.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
lib/ontologies_linked_data/concerns/concepts/concept_in_scheme.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
55
lib/ontologies_linked_data/concerns/concepts/concept_sort.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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