Skip to main content
Rust4PM

extraction_dbcon_bindings

process_mining::bindings::extraction_dbcon_bindings

Functions in this Module(6)

extraction_column_domain

bindings::extraction_dbcon_bindingsSource
The distinct values table.column holds in the source named source_id, for compiling a
dynamic type name (one read from a column rather than written in the blueprint) to SQL. See
ExtractionCatalog::with_domain.
connections must contain an entry for source_id. Every other entry is ignored.
Map_of_stringrequired
Stringrequired
Stringrequired
Stringrequired
import r4pm

res = r4pm.bindings.extraction_column_domain(
    {"something": 'example'},
    'example',
    'example',
    'example',
)

process_mining/src/bindings/extraction_dbcon_bindings.rs:181

extraction_connection_kinds

bindings::extraction_dbcon_bindingsSource
The source kinds this build's connector can open, as dbcon backend ids ("csv",
"parquet", "xlsx", "sqlite", "duckdb", "postgres"). Lets a UI offer exactly the
kinds the running binary supports instead of hardcoding a per-build list.
Asked of dbcon itself rather than derived from this crate's extraction-dbcon* features:
under Cargo feature unification another crate in the graph can enable a dbcon backend
those features do not name.
import r4pm

res = r4pm.bindings.extraction_connection_kinds()

process_mining/src/bindings/extraction_dbcon_bindings.rs:154

extraction_discover_catalog

bindings::extraction_dbcon_bindingsSource
Connect to every source in connections and discover its schema, returning one merged
ExtractionCatalog a caller can extraction_validate or extraction_compile a blueprint
against, or edit further with ExtractionCatalog::with_domain entries from
extraction_column_domain.
connections maps each source id a blueprint's nodes name to a dbcon connection string
(postgres://..., postgresql://..., sqlite:..., or a bare path ending in .csv).
Map_of_stringrequired
import r4pm

res = r4pm.bindings.extraction_discover_catalog({"something": 'example'})

process_mining/src/bindings/extraction_dbcon_bindings.rs:169

extraction_run

bindings::extraction_dbcon_bindingsSource
Run blueprint against connections, storing the extracted log under output_id and
returning the ExtractionReport.
An item already stored under output_id is replaced. connections maps each source id
blueprint's nodes name to a dbcon connection string. The blueprint itself carries no
connection details, so the same blueprint can run against different connections (a staging
database, then production) with no edit.
BlueprintrequiredA declarative mapping from relational rows to an OCEL.
Map_of_stringrequired
StringrequiredStore the produced item under this id, replacing any item already stored there.
import r4pm

blueprint = {
    "mappings": [{"type": 'single'}],
    "nodes": [
        {
            "id": '893f8ab9',
            "op": {
                "source_id": 'example',
                "table": 'example',
                "type": 'source',
            },
        },
    ],
    "version": 1,
}
res = r4pm.bindings.extraction_run(
    blueprint,
    {"something": 'example'},
    output_id='example',
)

process_mining/src/bindings/extraction_dbcon_bindings.rs:238

extraction_run_to_duckdb

bindings::extraction_dbcon_bindingsSource
Run blueprint against connections, streaming straight to a new DuckDB file at
db_path instead of holding the log in memory.
options apply as in write_ocel_to_duckdb: without overwrite, an existing db_path is
an error, and a failed run removes the new file again.
The right choice for a source too large to fit in RAM. See extraction_run for a log kept
as an in-process handle instead. Read the written file back by importing its .duckdb path
as an OCEL or SlimLinkedOCEL (Importable, or the registry).
write_ocel_to_duckdb: crate::core::event_data::object_centric::ocel_sql::write_ocel_to_duckdb
BlueprintrequiredA declarative mapping from relational rows to an OCEL.
Map_of_stringrequired
Stringrequired
DuckDbWriteOptionsOptions controlling how an OCEL is written into a `DuckDB` database.
import r4pm

blueprint = {
    "mappings": [{"type": 'single'}],
    "nodes": [
        {
            "id": '893f8ab9',
            "op": {
                "source_id": 'example',
                "table": 'example',
                "type": 'source',
            },
        },
    ],
    "version": 1,
}
res = r4pm.bindings.extraction_run_to_duckdb(
    blueprint,
    {"something": 'example'},
    'example',
)

process_mining/src/bindings/extraction_dbcon_bindings.rs:261

extraction_table_preview

bindings::extraction_dbcon_bindingsSource
The first limit rows of table in the source named source_id, for showing a person what
the data looks like while they build a blueprint against it.
Not a substitute for extraction_column_domain: a preview is incomplete, so it must never
be used where the compiler needs a column's full domain.
connections must contain an entry for source_id. Every other entry is ignored.
Map_of_stringrequired
Stringrequired
Stringrequired
import r4pm

res = r4pm.bindings.extraction_table_preview(
    {"something": 'example'},
    'example',
    'example',
)

process_mining/src/bindings/extraction_dbcon_bindings.rs:202