URPX rate plan loading and price resolution.
Parses URPX JSON-LD rate plan documents into Clojure data structures and resolves prices for any given timestamp and timezone.
URPX rate plan loading and price resolution. Parses URPX JSON-LD rate plan documents into Clojure data structures and resolves prices for any given timestamp and timezone.
(load-graph path)Load a URPX JSON-LD document from a file path. See parse-graph.
Load a URPX JSON-LD document from a file path. See `parse-graph`.
(load-rate-plan path)Load a URPX rate plan from a file path. The document may contain either a
single top-level urpx:RatePlan or a @graph array bundling the plan with
sibling entities (RatePlanModifier, ProgramEnrollment, etc.). In the
@graph case the unique urpx:RatePlan is returned; zero or more than one
urpx:RatePlan in a single document is an error — use load-graph to
inspect such documents directly.
Load a URPX rate plan from a file path. The document may contain either a single top-level urpx:RatePlan or a `@graph` array bundling the plan with sibling entities (RatePlanModifier, ProgramEnrollment, etc.). In the `@graph` case the unique urpx:RatePlan is returned; zero or more than one urpx:RatePlan in a single document is an error — use `load-graph` to inspect such documents directly.
(parse-graph src)Parse a URPX JSON-LD document and return a vector of every top-level entity.
@graph yield the graph contents (a vector
of entity maps), e.g. a base RatePlan + its sibling RatePlanModifier
bundled together.Always returns a vector so callers can use the same code path for both
shapes; dispatch on each entity's :jsonld/type to decide what to do
with it (e.g. via urpx.coerce/coerce-doc).
Parse a URPX JSON-LD document and return a vector of every top-level entity. - Documents with a top-level `@graph` yield the graph contents (a vector of entity maps), e.g. a base RatePlan + its sibling RatePlanModifier bundled together. - Single-entity documents yield a one-element vector containing the entity itself. Always returns a vector so callers can use the same code path for both shapes; dispatch on each entity's `:jsonld/type` to decide what to do with it (e.g. via `urpx.coerce/coerce-doc`).
(parse-rate-plan src)Parse a URPX JSON-LD rate plan document from src (anything io/reader can handle:
File, URL, Reader, InputStream, or path string).
Returns a Clojure map with keys converted to namespaced keywords: prefixed CURIEs (e.g. 'urpx:name') become :urpx/name; JSON-LD reserved keys ('@id', '@type', '@context') become :jsonld/id, :jsonld/type, :jsonld/context. String values (including CURIE references) are left unchanged.
This is a raw parser — it does not unwrap a top-level @graph container. Use
parse-graph / load-graph for documents that bundle multiple entities.
Parse a URPX JSON-LD rate plan document from `src` (anything io/reader can handle:
File, URL, Reader, InputStream, or path string).
Returns a Clojure map with keys converted to namespaced keywords:
prefixed CURIEs (e.g. 'urpx:name') become :urpx/name; JSON-LD reserved keys
('@id', '@type', '@context') become :jsonld/id, :jsonld/type, :jsonld/context.
String values (including CURIE references) are left unchanged.
This is a raw parser — it does not unwrap a top-level @graph container. Use
`parse-graph` / `load-graph` for documents that bundle multiple entities.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 |