forked from ontoportal/ontologies_linked_data
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
382,062 additions
and
293 deletions.
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
Binary file not shown.
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 |
---|---|---|
@@ -1 +1 @@ | ||
./owlapi-wrapper-1.4.1.jar | ||
./owlapi-wrapper-1.4.2.jar |
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.