Class: BioontologyResults

BioontologyResults()

A collection of items returned from the BioPortal API. So far this collection is capable of storing Bioontology Classes and Ontologies.

Constructor

new BioontologyResults()

Since:
  • 2.31.0
Source:

Extends

  • Backbone.Collection

Methods

cache()

Store the collection in the browser's storage
Source:

cacheWithRetry(cache)

If the cache is full, remove the oldest 100 items and try to cache again
Parameters:
Name Type Description
cache Array.<object> The cache to store
Source:

classes() → {Array.<BioontologyClass>}

Source:
Returns:
All BioontologyClass models in this collection
Type
Array.<BioontologyClass>

classesToAccordionItems(root) → {Array.<object>}

Convert all classes in the collection attributes to use in the Accordion model
Parameters:
Name Type Description
root string The root ontology or subtree
Source:
Returns:
The classes as Accordion items
Type
Array.<object>

clearCache()

Remove all items from the browser's storage
Source:

fetchOntologyDetails(ontologies, includeopt, includeViewsopt, displayContextopt, displayLinksopt)

Fetches information for all ontologies in the collection. params use the defaults in the BioontologyOntology model if not provided.
Parameters:
Name Type Attributes Description
ontologies Array.<string> The acronyms of the ontologies to fetch, otherwise all ontologies in the collection will be fetched.
include Array.<string> <optional>
The fields to include in the response.
includeViews boolean <optional>
Whether to include views
displayContext boolean <optional>
Whether to include context.
displayLinks boolean <optional>
Whether to include links.
Source:

fetchOntologyNames(checkCacheopt)

Fetches the names of all ontologies in the collection that do not have a name.
Parameters:
Name Type Attributes Description
checkCache boolean <optional>
Whether to check the browser's storage for the names of the ontologies before fetching them.
Source:

fetchOntologyNamesFromCache(acronyms) → {Array.<BioontologyOntology>}

Fetches the names of the ontologies from the browser's storage cache
Parameters:
Name Type Description
acronyms Array.<string> The acronyms of the ontologies to fetch
Source:
Returns:
The ontologies with names
Type
Array.<BioontologyOntology>

getItemsFromCache(ids) → {Array.<object>}

Retrieve classes & ontologies from the browser's storage, if available
Parameters:
Name Type Description
ids Array.<string> The unique identifiers of the items to get, otherwise all items available in the cache will be restored.
Source:
Returns:
The items from the cache
Type
Array.<object>

initialize(_attributes, options)

Parameters:
Name Type Description
_attributes object The attributes to initialize the collection with
options object The options to initialize the collection with
Properties
Name Type Attributes Description
autoCache boolean <optional>
Whether to automatically cache new items
Source:

model()

Source:

ontologies() → {Array.<BioontologyOntology>}

Source:
Returns:
All BioontologyOntology models in this collection
Type
Array.<BioontologyOntology>

restoreFromCache(ids, silent) → {Array.<BioontologyClass>}

Restore classes & ontologies from the browser's storage and adds them to the collection.
Parameters:
Name Type Description
ids Array.<string> The unique identifiers of the items to restore, otherwise all items available in the cache will be restored.
silent boolean Whether to suppress the "add" event
Source:
Returns:
The restored items
Type
Array.<BioontologyClass>