text-akoma-normalize/module.yaml
flemming-it b73b3e4b73 feat: initial text-akoma-normalize v0.1.0 (text.akoma_normalize@0.1.0)
First F∆I capability module that normalises heterogeneous legal
document sources to a structured representation aligned with
Akoma Ntoso 1.0 (OASIS LegalDocML).

v0.1.0 ships one adapter:

  - gesetze-im-internet (BMJ) XML — the BMJ XML schema with
    jurabk / enbez / titel / textdaten elements. Lossy but
    deterministic: SHA-256 of source + SHA-256 of canonicalised
    payload land in the output so the Hub audit log can verify
    that downstream evaluations were computed against the same
    bytes the auditor sees.

Reserved for next versions, without an interface break:

  - 0.2: landesrecht-berlin HTML adapter
  - 0.3: EUR-Lex FORMEX-4 adapter
  - 0.4+: emit akoma_xml (full Akoma Ntoso roundtrip)

ELI synthesis in 0.1 is a deterministic eli/bund/<jurabk>/<para>
fallback because Germany lacks an upstream Bund-level ELI
registrar. Replace once BMJ publishes ELI URIs upstream.

Pure in-WASM (quick-xml + sha2), zero filesystem, zero network —
the empty permissions list in module.yaml makes that explicit
and is enforced by the Hub.

Signed-off-by: flemming-it <sf@flemming.it>
2026-06-18 11:24:51 +02:00

90 lines
3.1 KiB
YAML

schema_version: 3
provider: chain
name: text-akoma-normalize
version: 0.1.0
# Capability provided by this module.
#
# Normalises heterogeneous legal-document sources (gesetze-im-internet
# XML, EUR-Lex FORMEX, landesrecht-berlin HTML) to a structured
# representation aligned with Akoma Ntoso 1.0 (OASIS LegalDocML).
#
# v0.1.0 ships the gesetze-im-internet (BMJ) XML adapter only.
# HTML and FORMEX adapters are planned for 0.2/0.3 without an
# interface break — the output schema is forward-compatible.
provides:
- capability: text.akoma_normalize
version: 0.1.0
inputs:
content:
type: bytes
description:
en: |
Source bytes of one legal-document file. Supported MIME types
in v0.1.0:
application/xml (gesetze-im-internet BMJ schema)
text/xml (alias)
Planned for 0.2+:
text/html (landesrecht-berlin)
application/x-formex+xml (EUR-Lex FORMEX-4)
de: |
Rohbytes einer Rechtsdokument-Datei. Unterstützte MIME-Typen
in v0.1.0:
application/xml (gesetze-im-internet BMJ-Schema)
text/xml (alias)
Geplant ab 0.2:
text/html (landesrecht-berlin)
application/x-formex+xml (EUR-Lex FORMEX-4)
mime:
type: text
optional: true
description:
en: |
Optional MIME type hint. If omitted, the module inspects
the leading bytes to choose an adapter. Pass explicitly
when the source content-type is known (e.g. from
http.request's `content_type` output).
de: |
Optionaler MIME-Typ-Hinweis. Ohne Hinweis erkennt das Modul
den Typ aus den Anfangsbytes. Explizit übergeben, wenn der
Quell-Content-Type bekannt ist (z.B. aus http.request's
Output `content_type`).
outputs:
norm:
type: json
description:
en: |
JSON-encoded NormalizedNorm:
{
schema_version: "0.1",
adapter: "gesetze-im-internet-xml",
adapter_version: "0.1.0",
eli: "eli/bund/<jurabk>/<paragraph>",
jurabk: "GewO",
paragraph: "§ 14",
title: "Anzeigepflicht",
paragraphs: [{ number, text }],
source_sha256: "...",
normalized_sha256: "...",
akoma_xml: "<akomaNtoso>...</akomaNtoso>" // v0.2+, omitted in 0.1
}
eli is synthetic in 0.1 — Germany lacks an official Bund-level
ELI registrar. Synthesis rule documented in MODULE.md.
de: |
JSON-codiertes NormalizedNorm (Felder s. EN).
eli ist in 0.1 synthetisch — Deutschland hat noch keinen offiziellen
ELI-Registrar auf Bundesebene. Syntheseregel in MODULE.md.
# Permissions required.
#
# Pure in-WASM normalisation: quick-xml + sha2. No filesystem,
# no network. The empty list makes this explicit; the hub enforces it.
permissions: []
# MIME-type allow-list for the `content` input. Studio reads this
# through ModuleInfoResponse.accepts_mime as the OS file-picker filter.
accepts_mime:
- application/xml
- text/xml