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

Add a script to import an ontology and its latest_submission from another portal #57

Conversation

syphax-bouazzouni
Copy link

@syphax-bouazzouni syphax-bouazzouni commented Jul 21, 2022

Preamble

The is an update/replacement of this :
https://github.com/ncbo/virtual_appliance/blob/main/utils/bioportal_ontologies_import.rb

What

This PR adds a script ncbo_ontology_import to import an ontology and its latest_submission with all their data from another portal.

Why

I use it for my testing and debugging, typically when we have a bug in our production environment and we want to reproduce it in our stage/test/local environments

How to

Usage: ncbo_ontology_import [options]
    -o, --ontology ACRONYM           Ontologies acronyms which we want to import (separated by comma)
        --from url                   The ontoportal api url source of the ontology
        --from-api api               An apikey to access the ontoportal api
        --admin-user username        The target admin user that will submit the ontology
    -h, --help                       Display this screen

An example

bin/ncbo_ontology_import --from http://data.agroportal.lirmm.fr/ --from-api your_api_key -o SOSA --admin-user admin

@syphax-bouazzouni syphax-bouazzouni changed the title Add a script to import an ontology and its latest_submission from another portal Add a script to import an ontology and its latest_submission from another portal (in progress) Jul 21, 2022
@syphax-bouazzouni syphax-bouazzouni force-pushed the pr/feature/add-a-script-to-import-ontologies branch from c224b41 to 6b85d03 Compare July 21, 2022 12:18
@syphax-bouazzouni syphax-bouazzouni changed the title Add a script to import an ontology and its latest_submission from another portal (in progress) Add a script to import an ontology and its latest_submission from another portal Jul 21, 2022
@jvendetti
Copy link
Member

Hi @syphax-bouazzouni. Thank you very much for this contribution. @alexskr and I were discussing it today, and if possible we'd prefer not to commit code with API keys. Admittedly, BioPortal is not secure in the regard, e.g., hovering over ontology download links in the Rails application shows the API key. Nevertheless, it would be good to try and follow the best practice of not keeping sensitive data in repositories. We were wondering if you would consider taking out the ncbobioportal API key? A simple change might be to display an error if the end user doesn't provide an API key.

@syphax-bouazzouni
Copy link
Author

syphax-bouazzouni commented Jul 29, 2022

Hi @jvendetti , thank you for your fast reactivity.

I did what you suggested me (display an error if the end-user doesn't provide an API key) and did a new commit.

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.

3 participants