Opens a connection to a SemanticSQL SQLite database, either by supplying
a direct file path or by referencing a short ontology name that is
retrieved and cached via BiocFileCache.
Usage
semsql_connect(
db_path = NULL,
ontology_prefix = NULL,
ontology = NULL,
cache = BiocFileCache::BiocFileCache(),
...
)Arguments
- db_path
character(1) or NULL. Path to an existing SQLite database file. Either
db_pathorontologymust be supplied.- ontology_prefix
character(1) or NULL. Primary CURIE prefix for the ontology (e.g.
"CL"). If NULL andontologyis supplied, defaults totoupper(ontology); otherwise auto-detected from the database.- ontology
character(1) or NULL. Short name of an INCAtools ontology (e.g.
"cl","go"). If supplied,retrieve_semsql_connis called to locate or download the cached database.- cache
a
BiocFileCacheinstance used whenontologyis supplied. Defaults toBiocFileCache::BiocFileCache().- ...
passed to
retrieve_semsql_connand ultimately todownload.file.
Value
A SemsqlConn object.
Examples
# by ontology short name (downloads if not cached)
goref <- semsql_connect(ontology = "go")
#> Connected to SemanticSQL database: /home/vincent/.cache/R/BiocFileCache/b24227f056f7_go.db
#> Primary ontology prefix: GO
goref
#> <SemsqlConn> prefix: GO | labeled terms: 88,356
disconnect(goref)
#> Disconnected from 'b24227f056f7_go.db'