Skip to content

Module: Database Manager

Importer

Create Importer module

Imports data using the dataset description files

Parameters:

Name Type Description Default
data_structures DatasetDescriptions

DatasetDescriptions object describing the different datasets

required
use_sample bool

boolean indicating whether a sample can be used

False
use_preprocessed_files bool

boolean indicating that preprocessed files can be used

False

Examples:

Example without sample and preprocessed files

>>> from promg.modules.data_importer import Importer
>>> # set dataset name
>>> dataset_name = 'BPIC17'
>>> # location of json file with dataset_description
>>> ds_path = Path(f'json_files/{dataset_name}_DS.json')
>>> dataset_descriptions = DatasetDescriptions(ds_path)
>>> importer = Importer(data_structures = dataset_descriptions)
The module to import data is returned.
The module won't use a sample, nor the preprocessed files

Example with sample and preprocessed files

>>> from promg.modules.data_importer import Importer
>>> # set dataset name
>>> dataset_name = 'BPIC17'
>>> # location of json file with dataset_description
>>> ds_path = Path(f'json_files/{dataset_name}_DS.json')
>>> dataset_descriptions = DatasetDescriptions(ds_path)
>>> importer = Importer(data_structures = dataset_descriptions,
>>>                     use_sample = True,
>>>                     use_preprocessed_files = True)
The module to import data is returned.
The module will use the sample and the preprocessed files
if they exist, in case they do not exist, they are created

import_data()

Method that imports the data records into the graph database as (:Record) nodes. The records contain the attributes as described in the dataset descriptions. Method also adds the specific record labels as specified by the semantic header.

Examples:

>>> importer.import_data()
The records of the dataset described in the dataset descriptions are imported as (:Record) nodes with
appropriate attributes and labels