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 to master: Release 2.6.3 - Security fixes, XML diff parsing and portal configuration model #160

Merged
merged 8 commits into from
Oct 22, 2024
58 changes: 30 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,22 @@ GEM
bcrypt (3.1.20)
bigdecimal (3.1.8)
builder (3.3.0)
childprocess (5.1.0)
logger (~> 1.5)
coderay (1.1.3)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
cube-ruby (0.0.3)
daemons (1.4.1)
date (3.3.4)
docile (1.4.0)
docile (1.4.1)
domain_name (0.6.20240107)
email_spec (2.2.2)
email_spec (2.3.0)
htmlentities (~> 4.3.3)
launchy (~> 2.1)
launchy (>= 2.1, < 4.0)
mail (~> 2.7)
eventmachine (1.2.7)
faraday (1.10.3)
Expand All @@ -76,32 +78,33 @@ GEM
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ffi (1.16.3)
hashdiff (1.1.0)
hashdiff (1.1.1)
hashie (5.0.0)
htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.6)
http-cookie (1.0.7)
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
json-ld (3.0.2)
multi_json (~> 1.12)
rdf (>= 2.2.8, < 4.0)
jwt (2.8.2)
jwt (2.9.0)
base64
language_server-protocol (3.17.0.3)
launchy (2.5.2)
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
libxml-ruby (2.9.0)
link_header (0.0.8)
logger (1.6.0)
logger (1.6.1)
macaddr (1.7.2)
systemu (~> 2.6.5)
mail (2.8.1)
Expand All @@ -112,7 +115,7 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0604)
mime-types-data (3.2024.0903)
mini_mime (1.1.5)
minitest (4.7.5)
minitest-reporters (0.14.24)
Expand All @@ -122,9 +125,9 @@ GEM
powerbar
multi_json (1.15.0)
multipart-post (2.4.1)
net-http-persistent (4.0.2)
net-http-persistent (4.0.4)
connection_pool (~> 2.2)
net-imap (0.4.14)
net-imap (0.4.16)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -134,12 +137,14 @@ GEM
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
oj (3.16.4)
oj (3.16.6)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omni_logger (0.1.4)
logger
parallel (1.25.1)
parser (3.3.3.0)
ostruct (0.6.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pony (1.13.1)
Expand All @@ -150,7 +155,7 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.1.1)
racc (1.8.0)
racc (1.8.1)
rack (1.6.13)
rack-test (0.8.3)
rack (>= 1.0, < 3)
Expand All @@ -171,7 +176,7 @@ GEM
rdf-xsd (3.2.1)
rdf (~> 3.2)
rexml (~> 3.2)
redis (5.2.0)
redis (5.3.0)
redis-client (>= 0.22.0)
redis-client (0.22.2)
connection_pool
Expand All @@ -183,22 +188,20 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.3.1)
strscan
rexml (3.3.7)
rsolr (1.1.2)
builder (>= 2.1.2)
rubocop (1.64.1)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand All @@ -210,9 +213,8 @@ GEM
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
strscan (3.1.0)
systemu (2.6.5)
test-unit-minitest (0.9.1)
minitest (~> 4.7)
Expand All @@ -223,7 +225,7 @@ GEM
thread_safe (0.3.6)
timeout (0.4.1)
tzinfo (0.3.62)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
uuid (2.3.9)
macaddr (~> 1.0)
webmock (3.23.1)
Expand Down
32 changes: 32 additions & 0 deletions config/config.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,38 @@ begin
link: 'https://www.googleapis.com/oauth2/v3/userinfo'
}
}

config.ui_name = 'Bioportal'
config.title = 'NCBO BioPortal'
config.description = "The world's most comprehensive repository of biomedical ontologies"
config.color = '#234979'
config.logo = ''
config.fundedBy = [
{
img_src: 'https://identity.stanford.edu/wp-content/uploads/sites/3/2020/07/block-s-right.png',
url: 'https://www.stanford.edu',

},
{
img_src: 'https://ontoportal.org/images/logo.png',
url: 'https://ontoportal.org/',
}
]
config.federated_portals = {
'agroportal' => {
api: 'http://data.agroportal.lirmm.fr',
ui: 'http://agroportal.lirmm.fr',
apikey: '1cfae05f-9e67-486f-820b-b393dec5764b',
color: '#1e2251'
},
'bioportal' => {
api: 'http://data.bioontology.org',
ui: 'http://bioportal.bioontology.org',
apikey: '4a5011ea-75fa-4be6-8e89-f45c8c84844e',
color: '#234979'
},

}
end
rescue NameError => e
binding.pry
Expand Down
25 changes: 13 additions & 12 deletions config/schemes/ontology_submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ naturalLanguage:
"http://lexvo.org/id/iso639-1/nl": "Dutch",
"http://lexvo.org/id/iso639-1/fi": "Finnish",
"http://lexvo.org/id/iso639-1/el": "Greek",
"http://lexvo.org/id/iso639-1/ja": "Japanese"
"http://lexvo.org/id/iso639-1/ja": "Japanese",
"http://lexvo.org/id/iso639-1/pt-br": "Brazilian"
}
metadataMappings: [ "omv:naturalLanguage", "dc:language", "dcterms:language", "doap:language", "schema:inLanguage" ]

Expand Down Expand Up @@ -289,7 +290,7 @@ copyrightHolder:
description: [
"SCHEMA: The party holding the legal copyright to the CreativeWork.",
"DCTERMS: A person or organization owning or managing rights over the resource." ]
extractedMetadata: false
extractedMetadata: true

### Description

Expand Down Expand Up @@ -503,7 +504,7 @@ hasCreator:
"DOAP: Maintainer of a project, a project leader.",
"SCHEMA:author: The author of this content or rating.",
"SCHEMA:creator: The creator/author of this CreativeWork." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "omv:hasCreator", "dc:creator", "dcterms:creator", "foaf:maker", "prov:wasAttributedTo", "doap:maintainer", "pav:authoredBy", "pav:createdBy", "schema:author", "schema:creator" ]

#Contributor
Expand All @@ -517,7 +518,7 @@ hasContributor:
"OMV: Contributors to the creation of the ontology.",
"PAV: The resource was contributed to by the given agent.",
"DOAP: Project contributor" ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "omv:hasContributor", "dc:contributor", "dcterms:contributor", "doap:helper", "schema:contributor", "pav:contributedBy" ]

#Curator
Expand All @@ -528,7 +529,7 @@ curatedBy:
description: [
"PAV: Specifies an agent specialist responsible for shaping the expression in an appropriate format. Often the primary agent responsible for ensuring the quality of the representation.",
"MOD: An ontology that is evaluated by an agent." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "mod:evaluatedBy", "pav:curatedBy" ]

#Translator
Expand All @@ -538,7 +539,7 @@ translator:
helpText: "Organization or person who adapts a creative work to different languages."
description: [
"SCHEMA: Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "schema:translator" ]

#Publisher
Expand All @@ -550,7 +551,7 @@ publisher:
"DCTERMS: An entity responsible for making the resource available.",
"SCHEMA: The publisher of creative work.",
"ADMS: The name of the agency that issued the identifier." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "dc:publisher", "dcterms:publisher", "schema:publisher", "adms:schemaAgency" ]

#Funded or sponsored by
Expand All @@ -562,7 +563,7 @@ fundedBy:
"MOD: An ontology that is sponsored by and developed under a project.",
"FOAF: An organization funding a project or person.",
"SCHEMA: The organization on whose behalf the creator was working." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "foaf:fundedBy", "mod:sponsoredBy", "schema:sourceOrganization" ]

#Endorsed by
Expand All @@ -573,7 +574,7 @@ endorsedBy:
description: [
"MOD: An ontology endorsed by an agent.",
"OMV: The parties that have expressed support or approval to this ontology." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "omv:endorsedBy", "mod:endorsedBy" ]

### Community
Expand Down Expand Up @@ -1429,7 +1430,7 @@ exampleIdentifier:
description: [
"VOID: Example resource of dataset.",
"IDOT: An example identifier used by one item (or record) from a dataset." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "void:exampleResource", "idot:exampleIdentifier" ]

#Key classes
Expand All @@ -1441,7 +1442,7 @@ keyClasses:
"OMV: Representative classes in the ontology.",
"FOAF: The primary topic of some page or document.",
"SCHEMA: Indicates the primary entity described in some page or other CreativeWork." ]
extractedMetadata: false
extractedMetadata: true
metadataMappings: [ "foaf:primaryTopic", "schema:mainEntity", "omv:keyClasses"]

#Metadata vocabulary used
Expand All @@ -1454,7 +1455,7 @@ metadataVoc:
"SCHEMA: Indicates (by URL or string) a particular version of a schema used in some CreativeWork.",
"ADMS: A schema according to which the Asset Repository can provide data about its content, e.g. ADMS.",
"MOD: A vocabulary(ies) that is used and/or referred to create the current ontology." ]
extractedMetadata: false
extractedMetadata: true
enforcedValues: {
"http://w3id.org/nkos/nkostype#classification_schema": "Classification scheme",
"http://www.w3.org/2000/01/rdf-schema#": "RDF Schema (RDFS)",
Expand Down
11 changes: 9 additions & 2 deletions lib/ontologies_linked_data/config/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ def config(&block)
# ###

@settings.ui_name ||= 'Bioportal'
@settings.title ||= ''
@settings.description ||= ''
@settings.color ||= ''
@settings.logo ||= ''
@settings.fundedBy ||= {}
@settings.federated_portals ||= {}

@settings.ui_host ||= 'bioportal.bioontology.org'
@settings.replace_url_prefix ||= false
@settings.id_url_prefix ||= DEFAULT_PREFIX
@settings.replace_url_prefix ||= false
@settings.id_url_prefix ||= DEFAULT_PREFIX
@settings.queries_debug ||= false
@settings.enable_monitoring ||= false
@settings.cube_host ||= 'localhost'
Expand Down
2 changes: 1 addition & 1 deletion lib/ontologies_linked_data/models/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.goo_attrs_to_load(attributes = [], level = 0)
if attributes.first == :all
(self.attributes + self.hypermedia_settings[:serialize_default]).uniq
else
attributes
attributes - self.hypermedia_settings[:serialize_never]
end
elsif self.hypermedia_settings[:serialize_default].empty?
self.attributes
Expand Down
4 changes: 2 additions & 2 deletions lib/ontologies_linked_data/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class Category < LinkedData::Models::Base
attribute :name, enforce: [:existence]
attribute :description
attribute :created, enforce: [:date_time], default: lambda { |record| DateTime.now }
attribute :parentCategory, enforce: [:category]
attribute :parentCategory, enforce: [:category, :list]
attribute :ontologies, inverse: { on: :ontology, attribute: :hasDomain }

cache_timeout 86400
end
end
end
end
Loading
Loading