BiodbRemotedbConn-class {biodb}R Documentation

The mother class of all remote database connectors.

Description

This is the super class of remote database connectors. It thus defines methods related to remote connection, like the definition of a token, and URL definitions. As with BiodbConn class, you won't need to use the constructor. Nevertheless we provide in the Fields section information about the constructor parameters, for eventual developers.

Methods

getEntryContentFromDb(entry.id)

:

Get the contents of entries directly from the database. A direct request or an access to the database will be made in order to retrieve the contents. No access to the biodb cache system will be made.

entry.id: A character vector with the IDs of entries to retrieve.

Returned value: A character vector, the same size of entry.id, with contents of the requested entries. An NA value will be set for the content of each entry for which the retrieval failed.

getEntryContentRequest(entry.id, concatenate = TRUE, max.length = 0)

:

Gets the URL to use in order to get the contents of the specified entries.

entry.id: A character vector with the IDs of entries to retrieve.

concatenate: If set to TRUE, then try to build as few URLs as possible, sending requests with several identifiers at once.

max.length: The maximum length of the URLs to return, in number of characters.

Returned value: A list of BiodbUrl objects.

getEntryImageUrl(entry.id)

:

Gets the URL to a picture of the entry (e.g.: a picture of the molecule in case of a compound entry).

entry.id: A character vector containing entry IDs.

Returned value: A character vector, the same length as 'entry.id', containing for each entry ID either a URL or NA if no URL exists.

getEntryPageUrl(entry.id)

:

Gets the URL to the page of the entry on the database web site.

entry.id: A character vector with the IDs of entries to retrieve.

Returned value: A list of BiodbUrl objects, the same length as 'entry.id'.

See Also

Super class BiodbConn and BiodbRequestScheduler.

Examples

# Create an instance with default settings:
mybiodb <- biodb::newInst()

# Define ChEBI connector example
defFile <- system.file("extdata", "chebi_ex.yml", package="biodb")
connFile <- system.file("extdata", "ChebiExConn.R", package="biodb")
entryFile <- system.file("extdata", "ChebiExEntry.R", package="biodb")
mybiodb$loadDefinitions(defFile)
source(connFile)
source(entryFile)

# Get connector
conn <- mybiodb$getFactory()$createConn('chebi.ex')

# Get the picture URL of an entry
picture.url <- conn$getEntryImageUrl('15440')

# Get the page URL of an entry
page.url <- conn$getEntryPageUrl('15440')

# Terminate instance.
mybiodb$terminate()


[Package biodb version 1.0.4 Index]