
Sdc Mapper
io.github.SemanticDataCharter由 GitHub 帳號 SemanticDataCharter 發布v4.3.2更新於 Oct 29, 2026
Map Governed Data Records to documented formats, reporting what happened to every value.
概覽
把受治理的資料記錄映射為 UBL、EDIFACT、OMOP、FHIR、HL7 v2 等有文件記載的目標格式,並回報每個值的處理結果。
- 可以做什麼
- 列出已安裝的目標映射器,並把記錄映射到指定目標格式,可搭配 YAML 映射檔
- 依例外值並排比較所有已安裝目標的保真度
- 驗證映射檔是否符合映射 schema
- 檢視雜湊鏈呼叫日誌:依天數彙總或驗證完整性
- 解析模型命名的代碼(LOINC、SNOMED CT、NCI 詞彙、代碼表),並回報每個值的去向
- 適用情境
- 當助理需要處理 Semantic Data Charter 的受治理資料記錄,並將其轉換為標準格式、同時保留每個值(包括缺漏、遮蔽或不可用值)的可稽核說明時適用。
- 執行需求
- 以 stdio 本機程序執行,從 PyPI 安裝並以 uvx 啟動。需要模型套件目錄或從 SDCStudio 主機取得的已發佈模型識別碼,因此可能需要網路存取。每種目標格式是獨立的套件,需另行安裝。未宣告驗證或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sdc Mapper,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
sdc-mapper
The shared core of the Semantic Data Charter's Governed Data Record mappers. It validates a record, reads the model the record names, resolves every value against what the model says about it, hands the result to a target mapper, and reports every value: how it reached the target, or that the target cannot hold it. Where the record says why a value is missing or unusable (an Exceptional Value, from the ISO 21090 null flavors), the report also says whether the target could say it too. Every call is appended to a hash-chained log that holds no values.
Each target format is its own package (sdc-gdr2ubl, sdc-gdr2edifact, sdc-gdr2omop, ...) registered under the
entry-point group sdc_mapper.targets. Outbound only. Apache 2.0.
Status: 4.3.2. Five target mappers are released: sdc-gdr2ubl (OASIS UBL 2.3), sdc-gdr2edifact (UN/EDIFACT
D.24A), sdc-gdr2omop (OMOP CDM 5.4), sdc-gdr2fhir (HL7 FHIR R4) and sdc-gdr2hl7v2 (HL7 v2.5.1).
Use
A model is a package directory (dm-<ct>.jsonld, dm-<ct>.xsd) or a published model's --ct-id, fetched from the
SDCStudio host; with neither, the record's own root names it. Exit status: 0 mapped, 1 refused, 2 error.
The three outcomes
- valid: mapped.
- valid with Exceptional Values: a value that failed its constraint is covered by an Exceptional Value (Invalid, with the constraint kept), and the rest of the record is mapped. Exceptional Values written at the source (a refusal, a masked field) are kept as written.
- refused: a broken structure, the wrong model, or an error no Exceptional Value covers. Nothing is written; the reasons are returned and logged.
Mapping files
YAML, validated against schemas/mapping.schema.json, bound to one model schema version and one target version.
Transforms: copy, code (a table), format, constant, binding (the code the model defines an enumerated value
by), link (the code of the concept the component links to), omit; clusters group or omit. binding and link
take a system (http://loinc.org, http://snomed.info/sct, a code list's IRI); their text is the model's, so a mapper
reports it as a lookup (LOOKUP_TRANSFORMS). Steps: .. up, . none, +name an element of the value's own, =name
the element of that name the parent already has. within: restricts a rule to a context. A value no rule reaches is
reported, never dropped. place(record, mapping) turns a record and its mapping into placements a mapper writes from.
Codes the model names
sdc_mapper.codes reads the IRIs the component libraries use for a concept as a code system and a code: LOINC codes
and answers, SNOMED CT, NCI Thesaurus, and any code list whose IRI ends in #code (UBL's, HL7's). A code system is
named by the IRI FHIR uses for it; a mapper turns that into its own name for the system (OMOP's vocabulary_id, HL7
v2's coding system). bound_code(value) is the code an enumerated value is defined by, linked_code(value) the code
of the concept its component links to (skos:exactMatch, then dcterms:subject), and model_codes(value) every code
the model names for it: a target code that is one of these came from the model.
Writing to a target
place() gives each value its target steps. Steps written =name join an element made by another value, so a writer
holds those writes back until every other value is written, then writes them shallowest first: sort them by
join_depth(steps). A row-oriented target (a set of tables, as OMOP's) can treat each step as a table or a column,
+TABLE as one new row per value, and keep the record's own row (its person, its document) under a name of its own;
sdc-gdr2omop does so with a RECORD table.
Writing a mapper
A mapper has name, target, target_version, package, version, an Exceptional Value table (ev_table: an
EVRule per ISO 21090 code: preserved, degraded, carried or lost) and map(record, mapping) -> MapResult. It returns
one ValueOutcome for every value it was given, never writes a rejected value as a value, and registers itself:
Tests
python -m pytest tests -q (offline). The fixture is a HalvorsenDemo Credit Note record and its model's package;
the reference mapper in tests/refmapper.py is a flat CSV used only to exercise the contract.
License
Apache 2.0. See NOTICE for the shipped SDC4 reference model schema and the fixture.
來源:README.md,提交 a13e162
工具
0版本歷史
3- v4.3.2最新Oct 29, 2026
- v4.3.1Oct 26, 2026
- v4.2.0Oct 25, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分