Skip to main content
Rust4PM

extraction_bindings

process_mining::bindings::extraction_bindings

Functions in this Module(6)

extraction_column_domain_items

bindings::extraction_bindingsSource
Every distinct value of table.column in a source held in the registry.
The registry counterpart of extraction_column_domain: same answer, for a source whose bytes
the host already holds rather than one reachable by connection string. Without it a dropped
file could be extracted from but never inspected, so the editor could not offer the example
values a dynamic type name needs, and on wasm, where every source is byte-held, not at all.
sources maps source id to registry item id. Every entry other than source_id is ignored.
Map_of_stringrequired
Stringrequired
Stringrequired
Stringrequired
import r4pm

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

process_mining/src/bindings/extraction_bindings.rs:277

extraction_compile

bindings::extraction_bindingsSource
Compile blueprint into SQL views presenting the OCEL 2.0 surface over catalog's tables,
with no connection opened and no row read.
shape picks the emitted layout: EmissionShape::PerType (one view per declared event/
object type, the layout external OCEL 2.0 tooling reads) or EmissionShape::Consolidated
(a single wide events/objects/... layout with the type as a column value). A mapping the
emitter cannot reproduce exactly is skipped and recorded in the result rather than failing the
whole compile.
BlueprintrequiredA declarative mapping from relational rows to an OCEL.
ExtractionCatalogrequiredThe concrete, serializable [`Catalog`].
EmissionShaperequiredWhich OCEL surface the compiler emits.
SqlDialectWhich SQL engine the emitted statements target.
import r4pm

blueprint = {
    "mappings": [{"type": 'single'}],
    "nodes": [
        {
            "id": '893f8ab9',
            "op": {
                "source_id": 'example',
                "table": 'example',
                "type": 'source',
            },
        },
    ],
    "version": 1,
}
catalog = {
    "domains": {"something": {"something": {"something": ['example']}}},
    "tables": {
        "something": {
            "something": {
                "columns": {
                    "something": {
                        "col_type": 'example',
                        "name": 'example',
                        "nullable": False,
                    },
                },
                "name": 'example',
            },
        },
    },
}
res = r4pm.bindings.extraction_compile(blueprint, catalog, 'PerType')

process_mining/src/bindings/extraction_bindings.rs:71

extraction_discover_catalog_items

bindings::extraction_bindingsSource
Discover the schema of every source in sources, merged into one ExtractionCatalog.
The in-memory counterpart of extraction_discover_catalog: that one takes connection strings
and needs a database connector, this one reads files already in the registry and needs only
ocel-sqlite or extraction-dbcon. sources maps each source_id a blueprint names to the
registry id of an imported source file.
Map_of_stringrequired
import r4pm

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

process_mining/src/bindings/extraction_bindings.rs:260

extraction_run_items

bindings::extraction_bindingsSource
Run blueprint against sources held in the registry, returning the resulting log.
The ExtractionReport (drop reasons, per-mapping counts) is not returned. A run whose report
carries errors fails with them rather than handing back a log that silently lost rows. Validate
first with extraction_validate to catch what a report would otherwise tell you.
BlueprintrequiredA declarative mapping from relational rows to an OCEL.
Map_of_stringrequired
Option<String>Store the result under this id instead of a generated one.
import r4pm

blueprint = {
    "mappings": [{"type": 'single'}],
    "nodes": [
        {
            "id": '893f8ab9',
            "op": {
                "source_id": 'example',
                "table": 'example',
                "type": 'source',
            },
        },
    ],
    "version": 1,
}
ocel = r4pm.bindings.extraction_run_items(blueprint, {"something": 'example'})
# Also: .json, .json.gz, .xml.gz, .ocel.csv, .ocel.csv.gz, ...
r4pm.export_item(ocel, 'ocel.xml')

process_mining/src/bindings/extraction_bindings.rs:328

extraction_table_preview_items

bindings::extraction_bindingsSource
The first limit rows of table in a source held in the registry.
See extraction_column_domain_items for why this exists separately from the connection-string
route. Not a substitute for a domain: a preview is incomplete, so it must never be used where
the compiler needs a column's full set of values.
sources maps source id to registry item id. Every entry other than source_id is ignored.
Map_of_stringrequired