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

feat: add NCBO BioPortal link #2654

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 16 additions & 13 deletions _layouts/ontology_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,34 @@ <h1>
<div class="card" style="margin-bottom: 1.5em;">
<div class="card-body">
<!-- TODO: each ontology should configure which browsers to be exposed in -->
<a href="https://ontobee.org/ontology/{{page.id}}" class="btn btn-outline-primary">
<a href="https://ontobee.org/ontology/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
OntoBee
</a>
{% if page.aberowl_id %}
<a href="http://aber-owl.net/ontology/{{page.aberowl_id | upcase}}" class="btn btn-outline-primary">
AberOWL
</a>
<a href="http://aber-owl.net/ontology/{{page.aberowl_id | upcase}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
AberOWL
</a>
{% else %}
<a href="http://aber-owl.net/ontology/{{page.id | upcase}}" class="btn btn-outline-primary">
AberOWL
</a>
<a href="http://aber-owl.net/ontology/{{page.id | upcase}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
AberOWL
</a>
{% endif %}
<a href="http://www.ebi.ac.uk/ols/ontologies/{{page.id}}" class="btn btn-outline-primary">
<a href="http://www.ebi.ac.uk/ols/ontologies/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
OLS
</a>
{% for b in page.browsers %}
<a href="{{b.url}}" class="btn btn-outline-primary">
{{b.label}}
<a href="https://bioportal.bioontology.org/ontologies/{{ page.id | make_bioportal_id }}" class="btn btn-outline-primary" target="_blank" rel="noopener">
BioPortal
</a>
{% for b in page.browsers %}
<a href="{{b.url}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
{{b.label}}
</a>
{% endfor %}
<a href="https://bioregistry.io/metaregistry/obofoundry/{{page.id}}" class="btn btn-outline-primary">
<a href="https://bioregistry.io/metaregistry/obofoundry/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
Bioregistry
</a>
{% if stripped_content_size > 0 %}
<p class="card-text">{{ content }}</p>
<p class="card-text">{{ content }}</p>
{% endif %}
</div>
</div>
Expand Down
28 changes: 28 additions & 0 deletions _plugins/bioportal_identifier.rb
Copy link
Contributor

Choose a reason for hiding this comment

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

Boom.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module CustomFilter
def make_bioportal_id(obo_id)
return obo_id unless obo_id.is_a?(String)

# ID requirements should be locked down moving forward, so additions to this table
# should be rare
special_cases = {
'fbbt' => 'FB-BT',
'ro' => 'OBOREL',
'apollo_sv' => 'APOLLO-SV',
'trans' => 'PTRANS',
'wbls' => 'WB-LS',
'fbdv' => 'FB-DV',
'wbbt' => 'WB-BT',
'wbphenotype' => 'WB-PHENOTYPE',
'to' => 'PTO',
'fbcv' => 'FB-CV',
'mod' => 'PSIMOD',
'pso' => 'PLANTSO'
}

return special_cases[obo_id] if special_cases.key? obo_id

obo_id == obo_id.downcase ? obo_id.upcase : obo_id
end
end

Liquid::Template.register_filter(CustomFilter)
Loading