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
Stringrequired
Stringrequired
import r4pm

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

process_mining/src/bindings/extraction_bindings.rs:299

extraction_validate

bindings::extraction_bindingsSource
Check blueprint against catalog for problems decidable from the schema alone, such as an
unknown source or table, a node graph cycle, or a type-rendering rule the blueprint's own
id_rendering setting cannot satisfy.
An empty result means blueprint is safe to pass to extraction_run,
extraction_run_to_duckdb or extraction_compile. All three call this internally and
refuse to run an invalid blueprint, so calling it first is for surfacing errors to a user
while they edit, not a required step before the others.
The two report a refusal differently, because they fail differently: the running bindings
return an error string, while extraction_compile always returns a CompiledOcel and
puts one entry per validation error in its errors array, with no relations emitted. This is
also the only place a blueprint's version is checked: the bindings deserialize a
Blueprint with plain serde, not Blueprint::from_json, so a blueprint from a newer model
version is caught here and nowhere else.
BlueprintrequiredA declarative mapping from relational rows to an OCEL.
ExtractionCatalogrequiredThe concrete, serializable [`Catalog`].
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_validate(blueprint, catalog)

process_mining/src/bindings/extraction_bindings.rs:58