S1000D BREX (S1000D Stack)
v0.13.0Read S1000D BREX business rules and check data modules against them, layer by layer.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
explain_brex
List the rules of a BREX data module in readable form: for each rule, the target (XPath), whether it is forbidden / required / optional, the allowed values with their meanings, severity, and the schema context it applies to. Also returns the BREX header (DMC, parent BREX, commonInfo, counts). Use "kind" and "context" to narrow, "offset"/"limit" to page. The header carries the whole commonInfo text whatever "limit" is; pass includeCommonInfo: false to get its length instead.
| Parameter | Type | Description |
|---|---|---|
brex | string | Which BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to… |
context | string | Only rules that apply to this schema (file name such as "descript", "proced", "pm") plus the common rules. Omit for all contexts. |
csdbDirs | array | CSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a… |
includeCommonInfo | boolean | Return the commonInfo text of the BREX in the header (default true). Pass false to get "commonInfoLength" (number of characters) instead, for example when reading further pages of the same BREX. |
kind | string | Rule kind to list (default: all). |
limit | number | Maximum rules to return (default 50, max 500). |
offset | number | Index of the first rule to return (default 0). |
search | string | Case-insensitive text to find in objectPath, objectUse, rule id or value meanings. |
lookup_sns
Explain what a Standard Numbering System (SNS) code means in a BREX: pass a DMC (the system / subsystem / sub-subsystem / assembly codes are taken from it) or the codes directly. Returns the matched hierarchy with titles; "exact: false" means only a prefix matched.
| Parameter | Type | Description |
|---|---|---|
assyCode | string | Assembly code (2 or 4 characters). |
brex | string | Which BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to… |
csdbDirs | array | CSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a… |
dmc | string | A DMC whose SNS part should be looked up. |
subSubSystemCode | string | Sub-subsystem code (1 character). |
subSystemCode | string | Subsystem code (1 character). |
systemCode | string | System code (2-3 characters), when not passing dmc. |
lookup_value
Explain what a value of an element or attribute means in a BREX, or list the allowed values. Pass "target" as an attribute name (e.g. "securityClassification"), an element name, or an XPath fragment; optionally "value" to check one value. Returns the matching rules with allowed values and their meanings, and whether the value is allowed.
| Parameter | Type | Description |
|---|---|---|
target * | string | Attribute name ("infoCode", "@infoCode"), element name ("language"), or XPath fragment to match against objectPath. |
brex | string | Which BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to… |
context | string | Schema file name (e.g. "descript") to pick context-specific rules in addition to common ones. |
csdbDirs | array | CSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a… |
value | string | The value to check against the allowed values (optional). |
list_notations
List the illustration / multimedia notations (file formats) a BREX allows: the base set (common to all schemas) and the per-schema additions and exclusions. Pass "context" to get the effective rule for one schema: mode "closed" (only the listed notations may be used), "open" (only the excluded ones are forbidden; a BREX with exclusions only) or "unrestricted". Returns an empty base set when the BREX has no notation rules (then the BREX does not restrict notations).
| Parameter | Type | Description |
|---|---|---|
brex | string | Which BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to… |
context | string | Schema file name (e.g. "ipd", "proced") to compute the effective set for. |
csdbDirs | array | CSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a… |
check_against_brex
Check a data module against BREX rules and report violations with location (XPath + line), actual value, rule id, objectUse text and severity. Also accepts a publication module (pm) or a comment (the brexDmRef in pmStatus / commentStatus is followed). By default follows the document's brexDmRef chain (project BREX → … → the BREX that ends the chain by referring to itself: usually the S1000D default BREX found under S1000D_SPEC_DIR) and checks each layer separately; pass "brex" to check against one specific BREX instead or in addition. Does NOT validate against the XML schema (XSD): run s…
| Parameter | Type | Description |
|---|---|---|
brex | string | A specific BREX (file path or DMC) to check against. With followChain=false it is the only layer; otherwise it is added to the chain. |
csdbDirs | array | CSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a… |
followChain | boolean | Follow the brexDmRef chain of the data module (default true). |
includeManualChecks | boolean | Include nonContextRules as manualChecks in each layer (default true). |
maxViolationsPerLayer | number | Cap on violations returned per layer (default 200). The total count is always reported. |
path | string | File path of the data module to check. |
xml | string | The data module as an XML string (alternative to path; max 5 MB). |