% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gmql_union.R
\title{Method union}
\S4method{union}{GMQLDataset,GMQLDataset}(x, y)
\item{x}{GMQLDataset object}

\item{y}{GMQLDataset object}
GMQLDataset object. It contains the value to use as input 
for the subsequent GMQLDataset method
Wrapper to GMQL UNION operator

It is used to integrate samples of two homogeneous or 
heterogeneous datasets within a single dataset; for each sample of either 
input dataset, a result sample is created as follows:
\item {Metadata are the same as in the original sample.}
\item {Resulting schema is the schema of the left input dataset. }
\item {Regions are the same (in coordinates and attribute values) 
as in the original sample, if it is from the left input dataset; 
if it is from the right input dataset, its regions are the same in 
coordinates, but only region attributes identical (in name and type) to 
those of the left  input dataset are retained, with the same values.
Region attributes which are missing in an input dataset sample 
w.r.t. the merged schema are set to null.}

## 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 folders "DATASET" and "DATASET_GDM" in the subdirectory 
## "example" of the package "RGMQL" and opens such folders as a GMQL 
## datasets named "data1" and "data2", respectively, using CustomParser

test_path <- system.file("example", "DATASET", package = "RGMQL")
test_path2 <- system.file("example", "DATASET_GDM", package = "RGMQL")
data1 <- read_gmql(test_path)
data2 <- read_gmql(test_path2)

## This statement creates a dataset called 'full' which contains all samples 
## from the datasets 'data1' and 'data2'

res <- union(data1, data2)