Liking cljdoc? Tell your friends :D

urpx.schema

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.

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.
raw docstring

AlternativeDimensionclj

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'.
raw docstring

AlternativeDimensionsclj

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).
raw docstring

ApplicabilityGroupclj

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.
raw docstring

ApplicabilityRuleclj


BillingModelclj

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).
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).
raw docstring

CalculationMethodclj


ConditionExpressionclj

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.
raw docstring

CustomerProfileclj

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.
raw docstring

CustomOperandNodeclj

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`).
raw docstring

DataSourceReferenceclj

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.
raw docstring

DatatypeOperandNodeclj

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.
raw docstring

Dateclj


DateTimeclj


Decimalclj


EligibilityRuleclj

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.
raw docstring

Holidayclj

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.
raw docstring

HolidayCalendarclj


Intclj

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.
raw docstring

IsoDurationclj


Ledgerclj

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.
raw docstring

MetricInputclj


MetricSpecificationclj


MonthNumberclj


NodeIdentityclj

Common JSON-LD identity fields present on most entities.

Common JSON-LD identity fields present on most entities.
raw docstring

ObjectOperandNodeclj

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.
raw docstring

Organizationclj

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).
raw docstring

PlanElementsclj

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.
raw docstring

Priceclj

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).
raw docstring

PriceDefinitionclj

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.
raw docstring

Pricesclj

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.
raw docstring

PriceSetclj


PriceSetAlternativeclj

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.
raw docstring

PriceSetAlternativesclj

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.
raw docstring

ProfileAlternativeclj

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.
raw docstring

ProfileAlternativesclj

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.
raw docstring

RateCaseclj

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.
raw docstring

RatePlanclj

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.
raw docstring

RatePlanModifierclj

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.
raw docstring

RatePlanModifierVersionclj

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.
raw docstring

RatePlanVersionclj

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.
raw docstring

Refclj

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.
raw docstring

Scenarioclj

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.
raw docstring

Seasonclj


ServiceTierclj

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.
raw docstring

ServiceTiersclj

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.
raw docstring

TariffBookReferenceclj


Timeclj


TimeBracketclj


TOUPeriodclj


TOUScheduleclj


TOUTierclj


URPXDocumentclj

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.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close