% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SemsqlConn-S7.R
\name{semsql_connect}
\alias{semsql_connect}
\title{Create a SemsqlConn connection}
\usage{
semsql_connect(
  db_path = NULL,
  ontology_prefix = NULL,
  ontology = NULL,
  cache = BiocFileCache::BiocFileCache(),
  validate = TRUE,
  ...
)
}
\arguments{
\item{db_path}{character(1) or NULL. Path to an existing SQLite database
file. Either \code{db_path} or \code{ontology} must be supplied.}

\item{ontology_prefix}{character(1) or NULL. Primary CURIE prefix for the
ontology (e.g. \code{"CL"}). If NULL and \code{ontology} is supplied,
defaults to \code{toupper(ontology)}; otherwise auto-detected from the
database.}

\item{ontology}{character(1) or NULL. Short name of an INCAtools ontology
(e.g. \code{"cl"}, \code{"go"}). If supplied,
\code{\link[=retrieve_semsql_conn]{retrieve_semsql_conn()}} is called to locate or download the
cached database.}

\item{cache}{a \code{BiocFileCache} instance used when \code{ontology} is
supplied. Defaults to \code{BiocFileCache::BiocFileCache()}.}

\item{validate}{logical(1) if TRUE (the default value) the ontology code
is checked against available Semantic SQL resources at INCAtools.  Set to
FALSE if using off line.}

\item{...}{passed to \code{\link[=retrieve_semsql_conn]{retrieve_semsql_conn()}} and ultimately
to \code{\link[utils:download.file]{utils::download.file()}}.}
}
\value{
A \code{\link[=SemsqlConn]{SemsqlConn()}} object.
}
\description{
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 \code{BiocFileCache}.
}
\note{
The connection has flag \code{SQLITE_RO} for read-only access.  There will
be an attempt to validate the \code{ontology} tag that is supplied, against all
available Semantic SQL resources available at INCAtools bucket.  Function fails
if a match cannot be made, which in general requires network access.
}
\examples{
# by ontology short name (downloads if not cached)
goref <- semsql_connect(ontology = "go")
goref
disconnect(goref)
}
