Skip to content

Id Regulation Constants

Shared constants for Indonesian regulation document processing.

Centralises all regex patterns, lookup tables, and enum types used by both the IDRegulationParser and the IDRegulationChunker so neither stage needs to import from the other. IDRegulationParser annotates each parsed element with structure metadata; IDRegulationChunker groups those pre-tagged elements into per-article output chunks.

AmendmentGroupLevel

Bases: StrEnum

Structural level of a BAB/Bagian/Paragraf/Subparagraf group an amendment item targets.

Distinguishes a targeted group's own hierarchy level (see IDRegulationParser's regulation_amendment_group_level metadata field) from the article-level AmendmentOperation -- a single INSERT item can introduce a whole new chapter/part/paragraph, and this is the vocabulary for which level it is.

Members are declared outermost-first; GROUP_LEVEL_DEPTH below reads that nesting order.

AmendmentOperation

Bases: StrEnum

Amendment operation types for Indonesian regulations.

CitationType

Bases: StrEnum

Citation types for regulation cross-references.

NodeLabel

Bases: StrEnum

Neo4j node labels for the Indonesian regulation graph. See ONTOLOGY.md.

RegulationParserMetadataKey

Bases: StrEnum

Keys IDRegulationParser writes into each element's metadata dict.

structural_keys() returns members after STRUCTURE and before TITLE. TITLE through VERSION_TAG are document-level identity keys. AMENDS_REGULATION is the legacy singular key kept for older persisted metadata.

structural_keys() classmethod

Per-element structural keys: every member after STRUCTURE and before TITLE.

STRUCTURE is written separately by each tagger. Document-level identity keys (TITLE through VERSION_TAG) are stamped identically on every element and are not cleared with the per-element structural fields.

Returns:

Type Description
tuple[RegulationParserMetadataKey, ...]

tuple[RegulationParserMetadataKey, ...]: The structural metadata keys, in enum order.

RegulationStructure

Bases: StrEnum

Structural element types within an Indonesian regulation document.

Used to tag each parsed element with its role in the document hierarchy, from front matter through chapters, parts, paragraphs, articles, body text, amendment directives, explanations, and the enactment tail.

RelationType

Bases: StrEnum

Neo4j relationship (edge) types for the Indonesian regulation graph. See ONTOLOGY.md.

VersionType

Bases: StrEnum

Article version types for Indonesian regulation graph nodes.