% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gmql_materialize.R
\name{collect}
\alias{collect}
\alias{collect,GMQLDataset-method}
\alias{collect-method}
\title{Method collect}
\usage{
\S4method{collect}{GMQLDataset}(x, dir_out = getwd(), name = "ds1")
}
\arguments{
\item{x}{GMQLDataset class object}

\item{dir_out}{destination folder path. By default it is the current 
working directory of the R process}

\item{name}{name of the result dataset. By default it is the string "ds1"}
}
\value{
None
}
\description{
Wrapper to GMQL MATERIALIZE operator

It saves the content of a dataset that contains samples 
metadata and regions. It is normally used to persist the content of any 
dataset generated during a GMQL query.
Any dataset can be materialized, but the operation can be time-consuming.
For best performance, materialize the relevant data only.
}
\details{
An error occures if the directory already exist at the destination
folder path
}
\examples{

## This statement initializes and runs the GMQL server for local execution 
## and creation of results on disk. Then, with system.file() it defines 
## the path to the folder "DATASET" in the subdirectory "example"
## of the package "RGMQL" and opens such file as a GMQL dataset named 
## "data" using CustomParser

init_gmql()
test_path <- system.file("example", "DATASET", package = "RGMQL")
data = read_gmql(test_path)

## The following statement materializes the dataset 'data', previoulsy read, 
## at the specific destination test_path into local folder "ds1" opportunely 
## created

collect(data, dir_out = test_path)

}