Skip to content

Commit 58722f7

Browse files
committed
feat: add NCBO BioPortal link
1 parent bb3a3ca commit 58722f7

File tree

2 files changed

+44
-13
lines changed

2 files changed

+44
-13
lines changed

_layouts/ontology_detail.html

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,34 @@ <h1>
5555
<div class="card" style="margin-bottom: 1.5em;">
5656
<div class="card-body">
5757
<!-- TODO: each ontology should configure which browsers to be exposed in -->
58-
<a href="https://ontobee.org/ontology/{{page.id}}" class="btn btn-outline-primary">
58+
<a href="https://ontobee.org/ontology/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
5959
OntoBee
6060
</a>
6161
{% if page.aberowl_id %}
62-
<a href="http://aber-owl.net/ontology/{{page.aberowl_id | upcase}}" class="btn btn-outline-primary">
63-
AberOWL
64-
</a>
62+
<a href="http://aber-owl.net/ontology/{{page.aberowl_id | upcase}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
63+
AberOWL
64+
</a>
6565
{% else %}
66-
<a href="http://aber-owl.net/ontology/{{page.id | upcase}}" class="btn btn-outline-primary">
67-
AberOWL
68-
</a>
66+
<a href="http://aber-owl.net/ontology/{{page.id | upcase}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
67+
AberOWL
68+
</a>
6969
{% endif %}
70-
<a href="http://www.ebi.ac.uk/ols/ontologies/{{page.id}}" class="btn btn-outline-primary">
70+
<a href="http://www.ebi.ac.uk/ols/ontologies/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
7171
OLS
7272
</a>
73-
{% for b in page.browsers %}
74-
<a href="{{b.url}}" class="btn btn-outline-primary">
75-
{{b.label}}
73+
<a href="https://bioportal.bioontology.org/ontologies/{{ page.id | make_bioportal_id }}" class="btn btn-outline-primary" target="_blank" rel="noopener">
74+
BioPortal
7675
</a>
76+
{% for b in page.browsers %}
77+
<a href="{{b.url}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
78+
{{b.label}}
79+
</a>
7780
{% endfor %}
78-
<a href="https://bioregistry.io/metaregistry/obofoundry/{{page.id}}" class="btn btn-outline-primary">
81+
<a href="https://bioregistry.io/metaregistry/obofoundry/{{page.id}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
7982
Bioregistry
8083
</a>
8184
{% if stripped_content_size > 0 %}
82-
<p class="card-text">{{ content }}</p>
85+
<p class="card-text">{{ content }}</p>
8386
{% endif %}
8487
</div>
8588
</div>

_plugins/bioportal_identifier.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module CustomFilter
2+
def make_bioportal_id(obo_id)
3+
return obo_id unless obo_id.is_a?(String)
4+
5+
# ID requirements should be locked down moving forward, so additions to this table
6+
# should be rare
7+
special_cases = {
8+
'fbbt' => 'FB-BT',
9+
'ro' => 'OBOREL',
10+
'apollo_sv' => 'APOLLO-SV',
11+
'trans' => 'PTRANS',
12+
'wbls' => 'WB-LS',
13+
'fbdv' => 'FB-DV',
14+
'wbbt' => 'WB-BT',
15+
'wbphenotype' => 'WB-PHENOTYPE',
16+
'to' => 'PTO',
17+
'fbcv' => 'FB-CV',
18+
'mod' => 'PSIMOD',
19+
'pso' => 'PLANTSO'
20+
}
21+
22+
return special_cases[obo_id] if special_cases.key? obo_id
23+
24+
obo_id == obo_id.downcase ? obo_id.upcase : obo_id
25+
end
26+
end
27+
28+
Liquid::Template.register_filter(CustomFilter)

0 commit comments

Comments
 (0)