BMW US UCP rules
ucp_private_rules extracts rules from the original primary-data response into
the source-specific BmwUcpRuleEntity. Extraction emits one row per source
statement the model can satisfy.
A rule is identified by key_fields of model_code, model_year and code.
Statements repeating a rule number reach the transformed component as separate
rows, and its validity aggregation collects their intervals onto the one row
that key produces, in ascending order of valid_from. Statements that share the
key but disagree elsewhere are reported by the component's discrepancies
check. All source intervals are retained, including intervals outside the
model's configuration period.
rule_if and rule_then each contain ordered parts referencing source code
values. Codes can identify features or families. Every IF part must hold. UCP
inclusion requires at least one THEN code to be selected, and UCP exclusion
requires every THEN code to be absent. These meanings are fixed by the
standard rule contract.
Source polarity sets negated on each IF part. A positive term sets it to
false and a negative term sets it to true. Missing or unsupported polarity
fails extraction. A THEN part records the code and whether it names a family.
UCP also records a preferred inclusion choice on its THEN parts, which
extraction drops: a preference does not change whether a rule holds, and no
tier downstream reads it.
rule_type is required and maps explicitly to inclusion or exclusion.
Missing, null, and unsupported types fail extraction. Each part has a family
flag, set from the family codes the model's option catalog publishes, so a
reader can tell a family reference from an option reference without the feature
catalog. The extractor does not expand families or evaluate rules.
validity contains valid_from and valid_to dates, which UCP expresses as
effect dates. Omitted or empty validity normalizes to one slice with both bounds
null, representing all time. The open lower 0001-01-01 and 1900-01-01
sentinels and the upper 9999-12-31 sentinel become null canonical bounds.
Malformed dates and reversed bounds fail extraction.
BmwUcpRuleEntity holds the rule code, the vg_code it was captured under,
model_code and model_year, rule_type, rule_if, rule_then and
validity. The raw table holds the response bytes.
Codes the model does not publish
A primary-data response contains the model's own catalog. That catalog is its
options, the family code each option belongs to, and its packages together
with their component option codes. A code outside that catalog is not orderable
on the model. A large share of the statements UCP returns for a model name at
least one such code.
The catalog is the authority on what a model can be ordered with. A rule part naming a code the catalog omits therefore marks a rule that does not apply to this model. It is not a restriction on the model. UCP authors rules for a wider population than one model and serves them per model without filtering. Reading such a rule as a restriction would contradict the catalog it arrives with, because the rule would forbid options that the same response publishes as orderable.
Extraction decides per part. The outcome for a part naming an unorderable code depends on which clause that part sits in:
| Part naming an unorderable code | Outcome |
|---|---|
| Positive IF part | The rule is dropped |
| Negated IF part | The part is dropped and the rule is kept |
| THEN part, alongside orderable THEN parts | The part is dropped and the rule is kept |
| THEN part, with every other THEN part unorderable | The rule is dropped |
A dropped part leaves a rule whose remaining parts all name codes the model publishes. A dropped rule has no part left that this model can satisfy.
A model that publishes no catalog classifies nothing, so none of its parts are dropped.
The enriched rules asset expands family references into their member codes, and the consolidated tier resolves those codes against the feature catalog.