Skip to content

quyen/bioportal

Repository files navigation

This is the Gem version of Bioportal Plugin

(More information please read Bioportal Plugin Documentation below)

Please add the following line into Gemfile:

gem 'bioportal', :git => 'git://github.com/quyen/bioportal.git'

A plugin that supports linking of Models within a RoR application to a Concept and Ontology within the BioPortal

Also includes a Mixin and a Helper to facilitate making use of the Rest API without linking to a Model.

More information about BioPortal, and its Rest API, may be found at:

bioportal.bioontology.org/ (main Portal)

www.bioontology.org/wiki/index.php/BioPortal_REST_services (Rest services).

Install the plugin from sysmo-db.googlecode.com/hg/vendor/plugins/bioportal

Since the rails plugin scripts don’t work happily with Mercurial, until we extract this plugin the simplest way of adding the plugin is as follows:

cd vendor/plugins
hg clone https://sysmo-db.googlecode.com/hg/vendor/plugins/bioportal bioportal
rm -rf bioportal/.hg/
cd -

Generate the database migration by running

./script/generate bioportal_migration

This generates a table that maps to the BioportalConcept entity, though you don’t need to know about this in your application.

To link to a model in your RoR application, add the following line to your Model class

class MyThing < ActiveRecord::Base
  linked_to_bioportal :email=>"fred.bloggs@email.com"
  ...
end

adding :email is optional, but recommended as you will be notified of changes to the REST API.

You can also use :base_url to indicate a different deployment of BioPortal than the default, which is rest.bioontology.org/bioportal/

This then provides your model with the attributes:

ontology_id ontology_version_id concept_uri

which once set allows you to call the method concept to retreive information about that concept, such as its synonyms, parents and children.

and you can also call the method ‘ontology’ to reteive information about the ontology.

More information about this can be found in the API documentation.

by adding the include

include BioPortal::RestAPI

you can find out more by reading BioPortal::RestAPI

Some view helpers are automatically injected into your application and you don’t need to do anything to use them.

You can find out more about these by reading about BioPortalHelper

About

Supports linking of Models within a RoR application to a Concept and Ontology within the BioPortal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages