Malli schemas for URPX v0.2.0 entities, describing the coerced shape.
Two-layer model (mirroring the clj-oa3 pattern):
Schemas carry :decode/urpx-jsonld decoders that turn the raw parser output
(strings) into the typed shape described here. The transformer is built and
applied in urpx.coerce. Reference resolution keeps :jsonld/id references
intact; consumers dereference via an entity index.
Schemas are bare def vars referenced by symbol — there is no central registry except inside ConditionExpression, where the recursive Comparison/Boolean operand tree uses a local Malli registry.
Malli schemas for URPX v0.2.0 entities, describing the coerced shape.
Two-layer model (mirroring the clj-oa3 pattern):
- urpx.core — raw parse: JSON-LD with namespaced keys, all string values.
- urpx.schema — coerced shape: typed Clojure values (BigDecimal, LocalDate,
LocalTime, LocalDateTime, Duration, integer month numbers).
Schemas carry `:decode/urpx-jsonld` decoders that turn the raw parser output
(strings) into the typed shape described here. The transformer is built and
applied in `urpx.coerce`. Reference resolution keeps :jsonld/id references
intact; consumers dereference via an entity index.
Schemas are bare def vars referenced by symbol — there is no central registry
except inside ConditionExpression, where the recursive Comparison/Boolean
operand tree uses a local Malli registry.One axis of a customer-profile choice — e.g. 'incomeTier' (with possible values CARE / FERA / Standard) or 'voltageLevel'.
One axis of a customer-profile choice — e.g. 'incomeTier' (with possible values CARE / FERA / Standard) or 'voltageLevel'.
Container for the AlternativeDimension(s) that span a ProfileAlternatives choice (typically a single dimension; multi-dimension matrices possible).
Container for the AlternativeDimension(s) that span a ProfileAlternatives choice (typically a single dimension; multi-dimension matrices possible).
Container for cross-cutting applicability conditions; carried on Price/PriceSet to express things like income-tier eligibility. Extra geographic/customer fields exist in v0.2.0 SHACL but most fixtures only carry name + hasConditionExpression.
Container for cross-cutting applicability conditions; carried on Price/PriceSet to express things like income-tier eligibility. Extra geographic/customer fields exist in v0.2.0 SHACL but most fixtures only carry name + hasConditionExpression.
v0.2.0: hasPriceDefinition is required (min 1) and lives at this level
(not inside Ledger). The v0.1.x BillingModel.hasServiceTier flat vector
is gone — block tiers now live under hasServiceTiers's nested
urpx:hasServiceTier field.
Both hasTOUSchedule and hasServiceTiers are vectors (sh:maxCount
unbounded per BillingModelShape). single-or-vec->vec keeps
single-container fixtures compatible without touching their JSON-LD:
v0.2.0: hasPriceDefinition is required (min 1) and lives at this level
(not inside Ledger). The v0.1.x BillingModel.hasServiceTier flat vector
is gone — block tiers now live under hasServiceTiers's nested
`urpx:hasServiceTier` field.
Both hasTOUSchedule and hasServiceTiers are vectors (sh:maxCount
unbounded per BillingModelShape). `single-or-vec->vec` keeps
single-container fixtures compatible without touching their JSON-LD:
- hasTOUSchedule is a vector for filings that TOU-zone multiple
metric inputs (CPAU E-4 TOU: separate energy + demand schedules,
URPX-qb5).
- hasServiceTiers is a vector for filings with a baseline-allowance
matrix — one ServiceTiers per (territory, code) cell — driven by
ProfileAlternatives selection (PG&E E-TOU-C baseline-tier modifier;
URPX-6hf, per upstream Una guidance on matrix handling).Recursive condition tree. Uses a local Malli registry to express the ComparisonNode / BooleanOperationNode mutual recursion.
Tree shape: ConditionExpression.rootNode → ComparisonNode | BooleanOperationNode ComparisonNode.{leftOperand,rightOperand} → any operand (recursively) BooleanOperationNode.operandNodes → vector of operands
Where 'operand' is one of: ObjectOperandNode, DatatypeOperandNode, CustomOperandNode, ComparisonNode, BooleanOperationNode.
Recursive condition tree. Uses a local Malli registry to express the
ComparisonNode / BooleanOperationNode mutual recursion.
Tree shape:
ConditionExpression.rootNode → ComparisonNode | BooleanOperationNode
ComparisonNode.{leftOperand,rightOperand} → any operand (recursively)
BooleanOperationNode.operandNodes → vector of operands
Where 'operand' is one of: ObjectOperandNode, DatatypeOperandNode,
CustomOperandNode, ComparisonNode, BooleanOperationNode.v0.2.0: greatly expanded; we list the few properties we currently consume plus hasCustomerKind which is the canonical test-case dispatch in the fixtures.
v0.2.0: greatly expanded; we list the few properties we currently consume plus hasCustomerKind which is the canonical test-case dispatch in the fixtures.
Like DatatypeOperandNode but with a free-form customConditionProperty
string in lieu of a Ref-valued conditionProperty. Useful when the
condition property isn't yet in the URPX vocabulary (e.g. PG&E's
departureVintage).
Like DatatypeOperandNode but with a free-form `customConditionProperty` string in lieu of a Ref-valued conditionProperty. Useful when the condition property isn't yet in the URPX vocabulary (e.g. PG&E's `departureVintage`).
v0.2.0: many new optional fields. mediaType is now Ref-only (no longer string); we list the most commonly populated fields.
v0.2.0: many new optional fields. mediaType is now Ref-only (no longer string); we list the most commonly populated fields.
Typed-literal operand. Carries optional conditionProperty (a Ref) and one typed value field. SHACL's sh:xone enforces 'exactly one value field'; the coercer simply decodes whichever is present.
Typed-literal operand. Carries optional conditionProperty (a Ref) and one typed value field. SHACL's sh:xone enforces 'exactly one value field'; the coercer simply decodes whichever is present.
v0.2.0: closed shape. hasCustomerProfile is gone (moved to Scenario). hasConditionExpression is the only required body field.
v0.2.0: closed shape. hasCustomerProfile is gone (moved to Scenario). hasConditionExpression is the only required body field.
v0.2.0: holidayName is required. Observance can be a literal date (urpx:holidayDate) or a free-form rule string (urpx:holidayRule); urpx:observanceRule (Ref) optionally shifts the date when it lands on a weekend.
v0.2.0: holidayName is required. Observance can be a literal date (urpx:holidayDate) or a free-form rule string (urpx:holidayRule); urpx:observanceRule (Ref) optionally shifts the date when it lands on a weekend.
An xsd:integer field — JSON parser may produce long already, but tolerate strings.
An xsd:integer field — JSON parser may produce long already, but tolerate strings.
v0.2.0: Ledger no longer carries hasPriceDefinition. PriceDefinitions live at BillingModel.hasPriceDefinition with PriceDefinition.referencesLedger pointing back to one of the BillingModel.hasLedger entries.
v0.2.0: Ledger no longer carries hasPriceDefinition. PriceDefinitions live at BillingModel.hasPriceDefinition with PriceDefinition.referencesLedger pointing back to one of the BillingModel.hasLedger entries.
Common JSON-LD identity fields present on most entities.
Common JSON-LD identity fields present on most entities.
Ref-valued operand. sh:xone in SHACL constrains exactly one of conditionProperty, referencesValue, or referencesMetricInput to be present; we don't enforce that here — let pyshacl be the strict validator.
Ref-valued operand. sh:xone in SHACL constrains exactly one of conditionProperty, referencesValue, or referencesMetricInput to be present; we don't enforce that here — let pyshacl be the strict validator.
v0.2.0: legalName is now optional; organizationType is required. urpx:eiaId is gone — utility identifiers now live under hasIdentity → urpx:OrganizationIdentity (not modeled here yet).
v0.2.0: legalName is now optional; organizationType is required. urpx:eiaId is gone — utility identifiers now live under hasIdentity → urpx:OrganizationIdentity (not modeled here yet).
v0.2.0: gains optional urpx:hasProfileAlternatives for declarative
customer-or-configuration choices (income tier, voltage configuration,
PCIA default tier, …). Each ProfileAlternatives is referenced by a
PriceSetAlternatives at Prices.hasPriceSetAlternatives — the per-customer
selection that determines which alternative's prices apply.
v0.2.0: gains optional `urpx:hasProfileAlternatives` for declarative customer-or-configuration choices (income tier, voltage configuration, PCIA default tier, …). Each ProfileAlternatives is referenced by a PriceSetAlternatives at Prices.hasPriceSetAlternatives — the per-customer selection that determines which alternative's prices apply.
v0.2.0: many new optional value fields (adder, amount, basePrice, basedOnPrice, currentPrice, multiplier) and metadata (hasApplicabilityGroup, hasRateCase, …). referencesPriceDefinition is sh:maxCount 1 (still required in practice for any per-energy price).
v0.2.0: many new optional value fields (adder, amount, basePrice, basedOnPrice, currentPrice, multiplier) and metadata (hasApplicabilityGroup, hasRateCase, …). referencesPriceDefinition is sh:maxCount 1 (still required in practice for any per-energy price).
v0.2.0: PriceDefinition gains required referencesLedger plus many properties that used to live on Price (priceCurrency, primaryChargeType, referencesServiceTier, referencesTouPeriod, serviceTierNumber, …). One PD can govern many Prices via Price.referencesPriceDefinition.
v0.2.0: PriceDefinition gains required referencesLedger plus many properties that used to live on Price (priceCurrency, primaryChargeType, referencesServiceTier, referencesTouPeriod, serviceTierNumber, …). One PD can govern many Prices via Price.referencesPriceDefinition.
v0.2.0: gains optional urpx:hasPriceSetAlternatives for customer-profile-
driven price selection. Each PriceSetAlternatives references a sibling
ProfileAlternatives (declared at PlanElements.hasProfileAlternatives) and
exposes one PriceSetAlternative per ProfileAlternative.
v0.2.0: gains optional `urpx:hasPriceSetAlternatives` for customer-profile- driven price selection. Each PriceSetAlternatives references a sibling ProfileAlternatives (declared at PlanElements.hasProfileAlternatives) and exposes one PriceSetAlternative per ProfileAlternative.
One Price-bearing alternative within a PriceSetAlternatives set.
Carries Price-like top-level fields (chargeType, billPortion, …) plus
the required referencesProfileAlternative Ref linking it to one of
the sibling ProfileAlternatives, plus hasPrice (1..*) for the actual
prices that apply when this alternative is selected.
One Price-bearing alternative within a PriceSetAlternatives set. Carries Price-like top-level fields (chargeType, billPortion, …) plus the required `referencesProfileAlternative` Ref linking it to one of the sibling ProfileAlternatives, plus `hasPrice` (1..*) for the actual prices that apply when this alternative is selected.
Top-level container for a customer-profile-driven price selection. Lives at Prices.hasPriceSetAlternatives. References one ProfileAlternatives (declared at PlanElements.hasProfileAlternatives) whose alternatives drive per-PriceSetAlternative choice.
Top-level container for a customer-profile-driven price selection. Lives at Prices.hasPriceSetAlternatives. References one ProfileAlternatives (declared at PlanElements.hasProfileAlternatives) whose alternatives drive per-PriceSetAlternative choice.
A single named alternative within a ProfileAlternatives set. The
hasConditionExpression says how to determine whether this alternative
applies to a given customer; defaultSelectionLogic is a free-form
tie-breaker / default note when conditions don't disambiguate.
A single named alternative within a ProfileAlternatives set. The `hasConditionExpression` says how to determine whether this alternative applies to a given customer; `defaultSelectionLogic` is a free-form tie-breaker / default note when conditions don't disambiguate.
Top-level declaration of a customer-profile-driven choice. Lives at PlanElements.hasProfileAlternatives. PriceSetAlternatives reference one ProfileAlternatives via urpx:referencesProfileAlternatives, and each PriceSetAlternative within the set selects ONE of its sibling ProfileAlternatives via urpx:referencesProfileAlternative.
Top-level declaration of a customer-profile-driven choice. Lives at PlanElements.hasProfileAlternatives. PriceSetAlternatives reference one ProfileAlternatives via urpx:referencesProfileAlternatives, and each PriceSetAlternative within the set selects ONE of its sibling ProfileAlternatives via urpx:referencesProfileAlternative.
v0.2.0: NEW. Identifies the regulatory proceeding that authorized a PriceDefinition / RatePlanVersion / Price / PriceSet.
v0.2.0: NEW. Identifies the regulatory proceeding that authorized a PriceDefinition / RatePlanVersion / Price / PriceSet.
v0.2.0: ratePlanUniqueIdentifier is required (replaces v0.1.x ratePlanIdentifier). RatePlan gains many optional date/metadata fields; we list the ones the tests / consumers care about.
v0.2.0: ratePlanUniqueIdentifier is required (replaces v0.1.x ratePlanIdentifier). RatePlan gains many optional date/metadata fields; we list the ones the tests / consumers care about.
v0.2.0: modifierUniqueIdentifier is required (was per-version in v0.1.x). urpx:isOptional is gone.
v0.2.0: modifierUniqueIdentifier is required (was per-version in v0.1.x). urpx:isOptional is gone.
v0.2.0: changeReason, serviceRole, publishedBy, modifierVersionNumber are now required. modifierIdentifier is gone — it moved to RatePlanModifier as modifierUniqueIdentifier.
v0.2.0: changeReason, serviceRole, publishedBy, modifierVersionNumber are now required. modifierIdentifier is gone — it moved to RatePlanModifier as modifierUniqueIdentifier.
v0.2.0: changeReason, serviceRole, publishedBy are now required; gains customerChoice, isDefault, hasModifierOptions, hasRateCase, supersedes, plus a set of date/dateTime metadata fields. We list the fields we currently consume plus the headline metadata.
v0.2.0: changeReason, serviceRole, publishedBy are now required; gains customerChoice, isDefault, hasModifierOptions, hasRateCase, supersedes, plus a set of date/dateTime metadata fields. We list the fields we currently consume plus the headline metadata.
A JSON-LD @id reference: {:jsonld/id "urpx:foo"}. Resolved against the entity index built from the parsed document.
A JSON-LD @id reference: {:jsonld/id "urpx:foo"}.
Resolved against the entity index built from the parsed document.v0.2.0: NEW. EligibilityRule.hasCustomerProfile moved here. SHACL's sh:or constraint requires either hasCustomerProfile xor hasServicePointProfile; we treat both as optional.
v0.2.0: NEW. EligibilityRule.hasCustomerProfile moved here. SHACL's sh:or constraint requires either hasCustomerProfile xor hasServicePointProfile; we treat both as optional.
v0.2.0: lowerBound, lowerBoundOperator, upperBound, upperBoundOperator, serviceTierNumber are all required (were optional in v0.1.x). ServiceTier no longer carries description, referencesMetricInput, or hasCalculationMethod — those moved to the parent ServiceTiers container.
v0.2.0: lowerBound, lowerBoundOperator, upperBound, upperBoundOperator, serviceTierNumber are all required (were optional in v0.1.x). ServiceTier no longer carries description, referencesMetricInput, or hasCalculationMethod — those moved to the parent ServiceTiers container.
v0.2.0: NEW container that holds the block-tier vector. Carries the referencesMetricInput pointer that used to live on individual ServiceTiers in v0.1.x.
v0.2.0: NEW container that holds the block-tier vector. Carries the referencesMetricInput pointer that used to live on individual ServiceTiers in v0.1.x.
URPX v0.2.0 Decision #103: every urpx:URPXDocument carries a required urpx:targetURPXVersion (xsd:anyURI) declaring the ontology version the document was authored against. URPXDocumentShape (SHACL) lists many optional metadata fields (dateCreated, version, hasRatePlan, hasRatePlanModifier, hasTariffPublication, …) — we model only the required field plus the headline payload pointers; additional metadata flows through unvalidated.
Documents that aren't URPXDocument-wrapped (raw RatePlan, raw
RatePlanModifier, or a JSON-LD @graph doc with no urpx:URPXDocument
@type) bypass this shape — its target is the v0.2.0 wrapper class
itself, not every URPX serialization.
URPX v0.2.0 Decision #103: every urpx:URPXDocument carries a required urpx:targetURPXVersion (xsd:anyURI) declaring the ontology version the document was authored against. URPXDocumentShape (SHACL) lists many optional metadata fields (dateCreated, version, hasRatePlan, hasRatePlanModifier, hasTariffPublication, …) — we model only the required field plus the headline payload pointers; additional metadata flows through unvalidated. Documents that aren't URPXDocument-wrapped (raw RatePlan, raw RatePlanModifier, or a JSON-LD `@graph` doc with no urpx:URPXDocument @type) bypass this shape — its target is the v0.2.0 wrapper class itself, not every URPX serialization.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |