BPMN → L2-BPMN knowledge graph
Extract the interior of one BPMN file as the L2-BPMN subgraph (smart-base/L2-bpmn/schemas/extract-bpmn.ts, ported from WHO smart-kg tools/extract-bpmn.mjs): a bpmn-definitions node and its processes, participants, tasks, gateways, events, the flowsTo/messageTo/contains edges between them, and one performedBy edge from each pool to the persona its @name matches against the ActorDefinition titles under --personas. The output is a graph document whose @context is the l2-bpmn context and validates with the engine’s check().
| Tool | kg-extract-bpmn |
| IRI | http://smart.who.int/base/tools/kg-extract-bpmn.jsonld |
| part of | http://smart.who.int/base/smart-base.jsonld |
| type | https://litlfred.github.io/cat-harness/v0/ns/Tool |
| declared by | smart-base |
| invoked | shell |
| qa | qa-reports |
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
smart-base-tools
Source: smart-base/skills/content/authoring-who-smart-guidelines/smart-base-tools.md.
Also satisfied by: extract-dak, kg-extract-dak, bpmn-graphviz-layout, bpmn-to-fsh, bpmn-validate, kg-extract-citations, kg-extract-dmn, kg-extract-l3.
The skill declares no I/O contract (schemas/skills/smart-base-tools/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | bpmn | RepoPath | yes | The .bpmn file to read. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
| in | personas | RepoPath | A directory of ActorDefinition FSH; a pool’s @name is matched against their titles. When absent, every pool -> persona join is recorded unresolved. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| in | out | RepoPath | Where the graph document goes; stdout when absent. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| out | graph | RepoPath | The L2-BPMN graph document (nodes, edges, provenance). | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
Processes and tasks
Steps this Tool can carry out, because each names a skill it satisfies:
| process | step | lane | via skill |
|---|---|---|---|
| SMART Guideline end to end | 3 · Choose L2 dependencies (WHO / jurisdiction DAKs) | Authoring agent | smart-base-tools |
| SMART Guideline end to end | 4 · Create / adapt L2 DAK assets | Authoring agent | smart-base-tools |
| SMART Guideline end to end | 5 · Choose L3 dependencies (WHO / jurisdiction IGs) | Authoring agent | smart-base-tools |
| SMART Guideline end to end | 6 · Produce L3 assets | Authoring agent | smart-base-tools |
How it is deployed and reached
- Command line. From the repository root:
npx --prefix smart-base/L1/schemas tsx smart-base/L2-bpmn/schemas/extract-bpmn.ts. - GitHub Actions. No workflow in this checkout runs its command.
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | none |
| when to choose it | |
|---|---|
| when | A BPMN file’s interior is to be read into the knowledge graph as the L2-BPMN subgraph, with its pool -> persona joins recorded and their resolution status made queryable. |
| limits | Parses the OMG BPMN serialisation with regular expressions, as smart-kg did; it reads tasks, sub-processes, exclusive gateways, start/end events, sequence and message flows, and does not interpret diagram layout. A pool -> persona match is exact string equality on a display title, so it does not survive a rename. |
| cost | Seconds, no network. |
What it is made of
| role | file | |
|---|---|---|
| script | smart-base/L2-bpmn/schemas/extract-bpmn.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, http://smart.who.int/base/tools/kg-extract-bpmn.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "http://smart.who.int/base/smart-base.context.jsonld",
"@id": "http://smart.who.int/base/tools/kg-extract-bpmn.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "http://smart.who.int/base/smart-base.jsonld",
"name": "kg-extract-bpmn",
"title": "BPMN → L2-BPMN knowledge graph",
"description": "Extract the interior of one BPMN file as the L2-BPMN subgraph (`smart-base/L2-bpmn/schemas/extract-bpmn.ts`, ported from WHO smart-kg `tools/extract-bpmn.mjs`): a `bpmn-definitions` node and its processes, participants, tasks, gateways, events, the `flowsTo`/`messageTo`/`contains` edges between them, and one `performedBy` edge from each pool to the persona its @name matches against the ActorDefinition titles under `--personas`. The output is a graph document whose `@context` is the l2-bpmn context and validates with the engine's `check()`.",
"install": {
"none": true
},
"invoke": {
"shell": "npx --prefix smart-base/L1/schemas tsx smart-base/L2-bpmn/schemas/extract-bpmn.ts"
},
"io": {
"inputs": [
{
"name": "bpmn",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The .bpmn file to read.",
"required": true
},
{
"name": "personas",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "A directory of ActorDefinition FSH; a pool's @name is matched against their titles. When absent, every pool -> persona join is recorded unresolved.",
"required": false,
"arg": {
"flag": "--personas"
}
},
{
"name": "out",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Where the graph document goes; stdout when absent.",
"required": false,
"arg": {
"flag": "--out"
}
}
],
"outputs": [
{
"name": "graph",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The L2-BPMN graph document (nodes, edges, provenance)."
}
]
},
"satisfies": [
"smart-base-tools"
],
"selection": {
"when": "A BPMN file's interior is to be read into the knowledge graph as the L2-BPMN subgraph, with its pool -> persona joins recorded and their resolution status made queryable.",
"limits": "Parses the OMG BPMN serialisation with regular expressions, as smart-kg did; it reads tasks, sub-processes, exclusive gateways, start/end events, sequence and message flows, and does not interpret diagram layout. A pool -> persona match is exact string equality on a display title, so it does not survive a rename.",
"cost": "Seconds, no network."
}
}