Class: OpenBEL::Routes::Namespaces

Inherits:
Base
  • Object
show all
Defined in:
app/openbel/api/routes/namespaces.rb

Overview

REST API for retrieving namespaces and values. Provides the following capabilities:

  • Retrieve namespaces.

  • Retrieve values for a namespace using the identifier, preferred name, or title.

  • Retrieve equivalences for one or more values.

  • Retrieve equivalences in a target namespace for one or more values.

  • Retrieve orthologs for one or more values.

  • Retrieve orthologs in a target namespace for one or more values.

Constant Summary collapse

RESULT_TYPES =
{
  :resource => :all,
  :name => :pref_label,
  :identifier => :identifier,
  :title => :title
}

Constants inherited from Base

Base::DEFAULT_CONTENT_TYPE, Base::DEFAULT_CONTENT_TYPE_ID, Base::RESOURCE_SERIALIZERS, Base::SCHEMA_BASE_URL, Base::SPOKEN_CONTENT_TYPES

Constants included from Schemas

Schemas::COMPILED_SCHEMAS, Schemas::SCHEMA_DIR, Schemas::SUFFIX

Constants included from OpenBEL::Resource::Namespaces

OpenBEL::Resource::Namespaces::VOCABULARY_RDF

Constants included from OpenBEL::Resource::Annotations

OpenBEL::Resource::Annotations::VOCABULARY_RDF

Instance Method Summary collapse

Methods included from Schemas

#validate

Constructor Details

#initialize(app) ⇒ Namespaces

Returns a new instance of Namespaces.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/openbel/api/routes/namespaces.rb', line 26

def initialize(app)
  super

  # RdfRepository using Jena.
  @rr = BEL::RdfRepository.plugins[:jena].create_repository(
    :tdb_directory => OpenBEL::Settings[:resource_rdf][:jena][:tdb_directory]
  )

  # Namespaces using RdfRepository
  @namespaces = BEL::Resource::Namespaces.new(@rr)

  # Resource Search using SQLite.
  @search = BEL::Resource::Search.plugins[:sqlite].create_search(
    :database_file => OpenBEL::Settings[:resource_search][:sqlite][:database_file]
  )
end