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

fix: fix bioportal link generation and remove redundant links #2655

Merged
merged 6 commits into from
Nov 25, 2024

Conversation

jsstevenson
Copy link
Contributor

@jsstevenson jsstevenson commented Nov 25, 2024

Two issues

  • many Jekyll deployment tools don't support custom filters. This is unfortunate because direct Liquid templating can otherwise get ugly fast -- but in our case it's fine, we only have a handful of exceptions and that list shouldn't get bigger
  • several ontologies provided their own BioPortal links (oops, thanks @nataled )

This PR removes redundant metadata from the latter and performs a basic if/else "mapping" for edge cases directly in the layout rather than shipping it out to a custom filter.

…tal browser links
@jsstevenson jsstevenson requested a review from matentzn November 25, 2024 16:23
@jsstevenson jsstevenson marked this pull request as ready for review November 25, 2024 16:23
@jsstevenson
Copy link
Contributor Author

Two other notes

  • If there's a notion of wanting to let the ontology submitters control their own metadata files (which makes sense to me), I could also undo the edits made to those files in this PR and have the template supply a BioPortal link only if the ontology page doesn't provide it already. I edited them directly to delete those links for the sake of removing redundancy, but I'd be happy to restore those changes if necessary.
  • Some ontologies also provide BioPortal links in their free text descriptions. I felt a little less okay about altering those, so I left them as-is.

Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

I think its ok, but maybe better to not make edits to the specific metadata files without debate, as this decreases trust.

I will wave this through immediately with you just drop the md file changes..

@matentzn
Copy link
Contributor

Is there a way to avoid changes to the metadata, but instead removing the code that parses the button from the md file?

@jsstevenson
Copy link
Contributor Author

jsstevenson commented Nov 25, 2024

Is there a way to avoid changes to the metadata, but instead removing the code that parses the button from the md file?

Sure thing. Made this change here:

{% assign skip_bioportal = false %}
{% for browser in page.browsers %}
{% if browser.label == "BioPortal" %}
{% assign skip_bioportal = true %}
{% endif %}
{% endfor %}
. This is assumptive of a label "BioPortal" not "NCBO Bioportal" or something like that. Obviously this is a little less elegant but it's totally reasonable to avoid editing submitted information.

@jsstevenson jsstevenson requested a review from matentzn November 25, 2024 18:15
<a href="https://bioportal.bioontology.org/ontologies/{{ bioportal_id }}" class="btn btn-outline-primary" target="_blank" rel="noopener">
BioPortal
</a>
{% endunless %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait the way you do it, if a bioportal link is manually set, wont they now see no button at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't believe so --

Lines 73 through 78 set a local skip_bioportal variable. If it's false, then lines 80-110 render a BioPortal button, but if it's true, then that's skipped. Regardless, 111-115 render custom buttons for each set of values defined in the ontology's front matter.

{% for b in page.browsers %}
<a href="{{b.url}}" class="btn btn-outline-primary" target="_blank" rel="noopener">
{{b.label}}
</a>
{% endfor %}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

eg here's my local render of PRO

Screenshot 2024-11-25 at 1 22 17 PM

Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

Nice! Thanks @jsstevenson!

@jsstevenson jsstevenson merged commit 13620af into master Nov 25, 2024
5 checks passed
@jsstevenson jsstevenson deleted the jss/bioportal-fix branch November 25, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants