Skip to content

ontoportal/ontologies_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6175af0 · Nov 26, 2024
Oct 1, 2024
May 6, 2024
Oct 2, 2024
Sep 27, 2024
May 6, 2024
Mar 3, 2014
Mar 28, 2017
Mar 26, 2013
Nov 22, 2024
Nov 28, 2012
Jul 3, 2024
May 5, 2023
Mar 21, 2024
Mar 11, 2024
Sep 24, 2024
Jan 12, 2022
Feb 1, 2022
Mar 11, 2024
Sep 24, 2024
Nov 22, 2024
Nov 22, 2024
Jan 12, 2022
Feb 3, 2022
Jul 20, 2022
Sep 15, 2016
May 6, 2024
Oct 3, 2012
Feb 18, 2023
Sep 24, 2024
Apr 29, 2013
Oct 9, 2013
Feb 12, 2023

Repository files navigation

ontologies_api

ontologies_api provides a RESTful interface for accessing BioPortal (an open repository of biomedical ontologies). Supported services include downloads, search, access to terms and concepts, text annotation, and much more.

Prerequisites

  • Ruby 2.x (most recent patch level)
  • rbenv and ruby-build (optional)
    • If you need to switch Ruby versions for other projects, you may want to install something like rbenv to manage your Ruby environment.
  • Git
  • Bundler
  • 4store
    • BioPortal relies on 4store as the main datastore
    • For starting, stopping, and restarting 4store easily, you can try setting up 4s-service
  • Redis
    • Used for caching (HTTP, query caching, Annotator cache)
  • Solr
    • BioPortal indexes ontology class and property content using Solr (a Lucene-based server)

Configuring Solr

To configure Solr for ontologies_api usage, modify the example project included with Solr by doing the following:

cd $SOLR_HOME
cp example ncbo
cd $SOLR_HOME/ncbo/solr
mv collection1 core1
cd $SOLR_HOME/ncbo/solr/core1/conf
# Copy NCBO-specific configuration files
cp `bundle show ontologies_linked_data`/config/solr/solrconfig.xml ./
cp `bundle show ontologies_linked_data`/config/solr/schema.xml ./
cd $SOLR_HOME/ncbo/solr
cp -R core1 core2
cp `bundle show ontologies_linked_data`/config/solr/solr.xml ./
# Edit $SOLR_HOME/ncbo/solr/solr.xml
# Find the following lines:
# <core name="NCBO1" config="solrconfig.xml" instanceDir="core1" schema="schema.xml" dataDir="data"/>
# <core name="NCBO2" config="solrconfig.xml" instanceDir="core2" schema="schema.xml" dataDir="data"/>
# Replace the value of `dataDir` in each line with: 
# /<your own path to data dir>/core1
# /<your own path to data dir>/core2
# Start solr
java -Dsolr.solr.home=solr -jar start.jar
# Edit the ontologieS_api/config/environments/{env}.rb file to point to your running instance:
# http://localhost:8983/solr/NCBO1

Installing

Clone the repository

$ git clone git@github.com:ncbo/ontologies_api.git
$ cd ontologies_api

Install the dependencies

$ bundle install

Create an environment configuration file

$ cp config/environments/config.rb.sample config/environments/development.rb

config.rb.sample can be copied and renamed to match whatever environment you're running, e.g.:

production.rb
development.rb
test.rb

Run the unit tests (optional)

Requires a configuration file for the test environment:

$ cp config/environments/config.rb.sample config/environments/test.rb

Execute the suite of tests from the command line:

$ bundle exec rake test 

Run the application

$ bundle exec rackup --port 9393 

Once started, the application will be available at localhost:9393.

Contributing

We encourage contributions! Please check out the contributing guide for guidelines on how to proceed.

Acknowledgements

The National Center for Biomedical Ontology is one of the National Centers for Biomedical Computing supported by the NHGRI, the NHLBI, and the NIH Common Fund under grant U54-HG004028.

License

LICENSE.md