DMN → L2-DMN knowledge graph

Extract the interior of one DMN decision table as the L2-DMN subgraph (smart-base/L2-dmn/schemas/extract-dmn.ts, ported from WHO smart-kg tools/extract-dmn.mjs): a dmn-definitions node and its decisions, decision tables, input and output clauses and rules, the reads edges to the data elements recovered from input expressions, the citesSource edges to the L1 citations each rule’s reference column names, and the invokedBy edge to the BPMN task the usingTask href names. Pass --bpmn to resolve that task by name instead of recording it unresolved.

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-bpmn, kg-extract-citations, 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.

porttyperequireddescriptionconstraint
indmnRepoPathyesThe .dmn file to read.string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments.
inbpmnRepoPathA BPMN file; the usingTask href fragment is matched against its task @name to resolve invokedBy.string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments.
inoutRepoPathWhere 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.
outgraphRepoPathThe L2-DMN graph document. Its citesSource edges reach L1 citations minted by kg-extract-citations from the same strings.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:

processsteplanevia skill
SMART Guideline end to end3 · Choose L2 dependencies (WHO / jurisdiction DAKs)Authoring agentsmart-base-tools
SMART Guideline end to end4 · Create / adapt L2 DAK assetsAuthoring agentsmart-base-tools
SMART Guideline end to end5 · Choose L3 dependencies (WHO / jurisdiction IGs)Authoring agentsmart-base-tools
SMART Guideline end to end6 · Produce L3 assetsAuthoring agentsmart-base-tools

How it is deployed and reached

  • Command line. From the repository root: npx --prefix smart-base/L1/schemas tsx smart-base/L2-dmn/schemas/extract-dmn.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.

installnone
when to choose it
whenA DMN decision table’s interior is to be read into the knowledge graph as the L2-DMN subgraph, joining its rules to the L1 sources they cite and to the BPMN task that invokes the decision.
limitsParses the DMN serialisation with regular expressions, as smart-kg did. A data element recovered from an input expression carries only the name that was referenced, never a definition, and is left unresolved. The reference column is found by its description, and the outputEntry/annotationEntry split is read from the first rule.
costSeconds, no network.

What it is made of

Linked data

The Tool is published as its own JSON-LD document at its IRI, http://smart.who.int/base/tools/kg-extract-dmn.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-dmn.jsonld",
  "@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
  "partOf": "http://smart.who.int/base/smart-base.jsonld",
  "name": "kg-extract-dmn",
  "title": "DMN → L2-DMN knowledge graph",
  "description": "Extract the interior of one DMN decision table as the L2-DMN subgraph (`smart-base/L2-dmn/schemas/extract-dmn.ts`, ported from WHO smart-kg `tools/extract-dmn.mjs`): a `dmn-definitions` node and its decisions, decision tables, input and output clauses and rules, the `reads` edges to the data elements recovered from input expressions, the `citesSource` edges to the L1 citations each rule's reference column names, and the `invokedBy` edge to the BPMN task the `usingTask` href names. Pass `--bpmn` to resolve that task by name instead of recording it unresolved.",
  "install": {
    "none": true
  },
  "invoke": {
    "shell": "npx --prefix smart-base/L1/schemas tsx smart-base/L2-dmn/schemas/extract-dmn.ts"
  },
  "io": {
    "inputs": [
      {
        "name": "dmn",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
        "description": "The .dmn file to read.",
        "required": true
      },
      {
        "name": "bpmn",
        "schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
        "description": "A BPMN file; the `usingTask` href fragment is matched against its task @name to resolve `invokedBy`.",
        "required": false,
        "arg": {
          "flag": "--bpmn"
        }
      },
      {
        "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-DMN graph document. Its `citesSource` edges reach L1 citations minted by kg-extract-citations from the same strings."
      }
    ]
  },
  "satisfies": [
    "smart-base-tools"
  ],
  "selection": {
    "when": "A DMN decision table's interior is to be read into the knowledge graph as the L2-DMN subgraph, joining its rules to the L1 sources they cite and to the BPMN task that invokes the decision.",
    "limits": "Parses the DMN serialisation with regular expressions, as smart-kg did. A data element recovered from an input expression carries only the name that was referenced, never a definition, and is left unresolved. The reference column is found by its description, and the outputEntry/annotationEntry split is read from the first rule.",
    "cost": "Seconds, no network."
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev