FHIR IG → L3 knowledge graph
Extract the L3 index from a SMART Guidelines IG’s source tree (smart-base/L3/schemas/extract-l3.ts, ported from WHO smart-kg tools/extract-l3.mjs): one thin node per FHIR artefact (PlanDefinition, ActivityDefinition, Library, Measure, Questionnaire, StructureMap/Definition, ValueSet, CodeSystem, ConceptMap, ActorDefinition, Requirements, CQL) read from FSH, FML and JSON with RuleSets expanded, the real uses and citesSource canonical references, and the implementedBy edges that tie each artefact to the L2 component its Title names by the SOP’s id convention. Coverage is reported across every artefact type.
| Tool | kg-extract-l3 |
| IRI | http://smart.who.int/base/tools/kg-extract-l3.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-bpmn, kg-extract-citations, kg-extract-dmn.
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 | ig | RepoPath | yes | The IG root (holds sushi-config.yaml and input/). | 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 L3 graph document; each node carries the SHA-256 of the file it came from. | 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/L3/schemas/extract-l3.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 built or source IG’s FHIR artefacts are to be indexed as the L3 subgraph and tied back to the L2 components and L1 recommendations they implement. |
| limits | Reads the FSH/FML/JSON source, not a built package; the L2 joins are the SOP’s Title-and-id conventions (no back-pointer extension exists), so they are recorded unresolved with the rule that matched them. Only artefact types with committed instances are modelled; ExampleScenario, TestPlan and TestScript are reported absent. |
| cost | Seconds, no network. |
What it is made of
| role | file | |
|---|---|---|
| script | smart-base/L3/schemas/extract-l3.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, http://smart.who.int/base/tools/kg-extract-l3.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-l3.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "http://smart.who.int/base/smart-base.jsonld",
"name": "kg-extract-l3",
"title": "FHIR IG → L3 knowledge graph",
"description": "Extract the L3 index from a SMART Guidelines IG's source tree (`smart-base/L3/schemas/extract-l3.ts`, ported from WHO smart-kg `tools/extract-l3.mjs`): one thin node per FHIR artefact (PlanDefinition, ActivityDefinition, Library, Measure, Questionnaire, StructureMap/Definition, ValueSet, CodeSystem, ConceptMap, ActorDefinition, Requirements, CQL) read from FSH, FML and JSON with RuleSets expanded, the real `uses` and `citesSource` canonical references, and the `implementedBy` edges that tie each artefact to the L2 component its Title names by the SOP's id convention. Coverage is reported across every artefact type.",
"install": {
"none": true
},
"invoke": {
"shell": "npx --prefix smart-base/L1/schemas tsx smart-base/L3/schemas/extract-l3.ts"
},
"io": {
"inputs": [
{
"name": "ig",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The IG root (holds `sushi-config.yaml` and `input/`).",
"required": true,
"arg": {
"flag": "--ig"
}
},
{
"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 L3 graph document; each node carries the SHA-256 of the file it came from."
}
]
},
"satisfies": [
"smart-base-tools"
],
"selection": {
"when": "A built or source IG's FHIR artefacts are to be indexed as the L3 subgraph and tied back to the L2 components and L1 recommendations they implement.",
"limits": "Reads the FSH/FML/JSON source, not a built package; the L2 joins are the SOP's Title-and-id conventions (no back-pointer extension exists), so they are recorded unresolved with the rule that matched them. Only artefact types with committed instances are modelled; ExampleScenario, TestPlan and TestScript are reported absent.",
"cost": "Seconds, no network."
}
}