InfrastructureCoreOpenAPIModels
Domain-neutral transport types shared by every other package in the family: function data, value pairs, the association rows, and the UnitSystem enum. It also owns the pieces the rest of the API is built from — the APIModel supertypes, encode and decode, the model-type registry, and the unit vocabulary.
It carries no power-system concept and no Power* dependency by design.
InfrastructureCoreOpenAPIModels.SCHEMA_VERSION_FILE — Constant
The schema release this package was built from, copied from the repo-root .schema-version by make schema-version (the root file is outside the registered subpackage).
InfrastructureCoreOpenAPIModels.APIModel — Type
Supertype of every generated transport struct, restoring the marker OpenAPI.jl 0.2 provided as OpenAPI.APIModel. Lets a consumer hold a heterogeneous collection of components (APIModel[]) and constrain a type parameter (where {T <: APIModel}) instead of falling back to Any.
InfrastructureCoreOpenAPIModels.AbstractDocument — Type
Supertype of the serialized document containers: SystemDocument (PowerCoreOpenAPIModels) and PortfolioDocument (PowerInvestmentsOpenAPIModels).
A subtype carries the shared fields name, description, components, supplemental_attributes, supplemental_attribute_associations, time_series_associations, ext, time_series_storage_file, counter, component_types_by_id, and source_schema_version, and implements validate_document, document_tree, and _bundle_name.
InfrastructureCoreOpenAPIModels.ComplexNumber — Type
ComplexNumberA complex number, given as its real and imag parts.
InfrastructureCoreOpenAPIModels.DataSource — Type
DataSourceRecords data provenance for a component's field values: which organization or dataset the data came from, the URL it was retrieved from, and when it was retrieved. Mirrors the DataSource supplemental attribute from the upstream data layer, with two deliberate divergences: organization is optional here although it is required upstream, and extra is narrowed from an any-valued map to a string-valued one. Linked to the entity it describes through Core/Associations/SupplementalAttributeAssociation.json with attribute_type: "DataSource".
organization: Publishing organization, e.g. 'U.S. Energy Information Administration'.retrieved_at: When the data was obtained.dataset: Dataset identifier within the publishing organization, e.g. 'EIA-860 2023, Schedule 3'.url: URL the data was retrieved from.version: Data version or vintage, e.g. '2023 final'.license: License of the source data, if known: an SPDX identifier such as 'CC-BY-4.0', or a license name or URL.published_at: When the source published the data; null if unknown.confidence: Confidence qualifier, e.g. 'high', 'medium'.recorded_by: User or agent that recorded the value.fields: Names of the component fields this provenance record applies to.extra: Additional string-valued provenance metadata.
InfrastructureCoreOpenAPIModels.DataSourceExtra — Type
DataSourceExtraAdditional string-valued provenance metadata.
InfrastructureCoreOpenAPIModels.DocumentFormatError — Type
Raised for any malformed document: a missing required field, an unregistered type name, an unresolved reference, or a duplicate id.
InfrastructureCoreOpenAPIModels.EnumAPIModel — Type
Supertype of the generated enum wrapper structs, whose value field holds a validated string. Kept distinct from OneOfAPIModel because both shapes carry a value field, and a method meant to unwrap a discriminated union must not also catch an enum.
InfrastructureCoreOpenAPIModels.FromTo — Type
FromToA pair of values, one at the from end and one at the to end of a directed edge.
InfrastructureCoreOpenAPIModels.FromToToFrom — Type
FromToToFromA pair of values for a directed edge, one for each orientation: from_to and to_from. The two are carried separately because the quantity need not be equal in the two directions.
InfrastructureCoreOpenAPIModels.FunctionData — Type
FunctionDataRaw mathematical data defining a function f(x) — coefficients or point tables with no units or interpretation attached. function_type selects the shape: linear, quadratic, piecewise linear through (x, y) points, or piecewise constant between x endpoints. What x and y stand for is supplied by whatever wraps this, and the TIME_SERIES_* variants hold a reference to a stored series in place of the numbers.
InfrastructureCoreOpenAPIModels.GeographicInfo — Type
GeographicInfoSupplemental attribute carrying geographic information about a component as a GeoJSON object. An empty object is permitted and means no geographic information is recorded.
InfrastructureCoreOpenAPIModels.InOut — Type
InOutA pair of values, one for the inbound (in) and one for the outbound (out) direction of a quantity.
InfrastructureCoreOpenAPIModels.LinearFunctionData — Type
LinearFunctionDataData for a linear function f(x) = proportional_term * x + constant_term.
constant_term: Units: the wrapped function's output unit.proportional_term: Units: the wrapped function's output unit per unit of its input.
InfrastructureCoreOpenAPIModels.MinMax — Type
MinMaxA pair of values bounding a quantity from below (min) and from above (max).
InfrastructureCoreOpenAPIModels.OneOfAPIModel — Type
Supertype of the generated oneOf/anyOf wrapper structs, whose sole value field holds the variant the document's discriminator selected. Dispatching on this is how a consumer unwraps a wrapper without enumerating its members.
InfrastructureCoreOpenAPIModels.PiecewiseLinearData — Type
PiecewiseLinearDataData for a piecewise linear function defined by (x, y) points and interpolated linearly between consecutive ones. The y values are absolute values at each x, not per-segment slopes; use PiecewiseStepData when the data gives per-segment rates. Points run in ascending x order, and two of them define one segment.
InfrastructureCoreOpenAPIModels.PiecewiseStepData — Type
PiecewiseStepDataData for a step function, constant on each segment, defined by the x coordinates of the segment endpoints and one y value per segment. The y values are per-segment rates, not absolute values; use PiecewiseLinearData when the data gives a value at each point. x_coords ascends and holds at least two entries, and y_coords holds exactly one fewer.
InfrastructureCoreOpenAPIModels.QuadraticFunctionData — Type
QuadraticFunctionDataData for a quadratic function f(x) = quadratic_term * x^2 + proportional_term * x + constant_term. A non-negative quadratic_term makes the function convex.
constant_term: Units: the wrapped function's output unit.proportional_term: Units: the wrapped function's output unit per unit of its input.quadratic_term: Units: the wrapped function's output unit per unit of its input squared.
InfrastructureCoreOpenAPIModels.SchemaVersionError — Type
Raised when a document's schema_version makes it unreadable by this package.
outcome is one of :missing, :malformed, :incompatible, :newer; reader is this package's schema version and document the document's (JSON-encoded when malformed, empty when missing). message is the canonical text from the schema repository's versioning doc.
InfrastructureCoreOpenAPIModels.SupplementalAttributeAssociation — Type
SupplementalAttributeAssociationLinks a supplemental attribute to the component it describes — the JSON form of a row in the store's supplemental_attribute_associations catalog table, field-for-field. component_type and attribute_type are denormalized labels carried for filtering and reporting, not identity: identity is the (component_id, attribute_id) pair. Lives in Core because either side may be a Core or an Operations type. Unlike components, supplemental_attributes is a flat, untyped array, so attribute_type is this record's only per-row type discriminator.
component_id: ID of the component the attribute describes.component_type: Type name of the component the attribute describes. A denormalized label matching the relational mirror's column, used for filtering; not part of the row's identity, which is the(component_id, attribute_id)pair.attribute_id: ID of the supplemental attribute.attribute_type: Schema title of the referenced supplemental attribute (e.g. "EmissionsData", "GeographicInfo"). A free-form string, not an enum: new attribute types are added elsewhere in this repo continuously, and a closed enum here would go stale.
InfrastructureCoreOpenAPIModels.TimeSeriesLinearFunctionData — Type
TimeSeriesLinearFunctionDataTime-series-backed variant of LinearFunctionData. In place of inline coefficients it carries association_id, referencing a stored series that supplies them at each step; use it when the coefficients change over time.
association_id: Store-minted id of the time series association whose values supply this function data over time. Resolved against the accompanying time series store on read; minted by that store and meaningful only against it, never assigned by a document producer.
InfrastructureCoreOpenAPIModels.TimeSeriesPiecewiseLinearData — Type
TimeSeriesPiecewiseLinearDataTime-series-backed variant of PiecewiseLinearData. In place of an inline point table it carries association_id, referencing a stored series that supplies one at each step; use it when the points change over time.
association_id: Store-minted id of the time series association whose values supply this function data over time. Resolved against the accompanying time series store on read; minted by that store and meaningful only against it, never assigned by a document producer.
InfrastructureCoreOpenAPIModels.TimeSeriesPiecewiseStepData — Type
TimeSeriesPiecewiseStepDataTime-series-backed variant of PiecewiseStepData. In place of inline coordinate vectors it carries association_id, referencing a stored series that supplies them at each step; use it when the segments change over time.
association_id: Store-minted id of the time series association whose values supply this function data over time. Resolved against the accompanying time series store on read; minted by that store and meaningful only against it, never assigned by a document producer.
InfrastructureCoreOpenAPIModels.TimeSeriesQuadraticFunctionData — Type
TimeSeriesQuadraticFunctionDataTime-series-backed variant of QuadraticFunctionData. In place of inline coefficients it carries association_id, referencing a stored series that supplies them at each step; use it when the coefficients change over time.
association_id: Store-minted id of the time series association whose values supply this function data over time. Resolved against the accompanying time series store on read; minted by that store and meaningful only against it, never assigned by a document producer.
InfrastructureCoreOpenAPIModels.TwoDimensionalFunctionPoint — Type
TwoDimensionalFunctionPointA single point, given as its x and y coordinates.
x: Units: the wrapped function's input unit.y: Units: the wrapped function's output unit.
InfrastructureCoreOpenAPIModels.UnitSystem — Type
UnitSystemUnit basis a stored value is expressed in. COMPONENTBASE: per-unit against a base the component records itself. NATURALUNITS: the quantity's own physical unit. No system-wide option: a value per-unitized against a shared base records that base on the component and rides as COMPONENTBASE. Used in three scopes, each read against its own record rather than a document-wide table: a component's own `powerunits(against that component'sbasepower), a cost payload's ownpowerunits(e.g.CostCurve, against the owning component'sbasepower), and a time series association's ownunitsystem` (governing only that one series).
InfrastructureCoreOpenAPIModels.UpDown — Type
UpDownA pair of values, one for the upward (up) and one for the downward (down) direction of a quantity.
InfrastructureCoreOpenAPIModels._attribute_type_by_id — Method
Index attribute_id -> attribute_type from the association rows.
supplemental_attributes is flat and untyped, unlike components, so a row has no type of its own to read; SupplementalAttributeAssociation.attribute_type is the only discriminator.
InfrastructureCoreOpenAPIModels._bucket — Method
Function barrier: one specialization per concrete component vector, each row encoded to a plain JSON-safe object.
InfrastructureCoreOpenAPIModels._checked_schema_version — Method
The shared read-path gate: run on the raw parsed JSON before any decode. Returns the document's schema version, or throws SchemaVersionError.
InfrastructureCoreOpenAPIModels._component_ids — Method
Every component id in the document, erroring on a duplicate.
InfrastructureCoreOpenAPIModels._encode_row — Method
Encode one model row to a plain JSON-safe object.
The native (post-1.0) generator has no JSON.lower hook the way the old 0.2.x runtime did (where JSON.lower(::OpenAPI.APIModel) let JSON.print walk a raw model instance directly, skipping unset fields on its own); each generated module instead installs a method on the shared OpenAPI.Runtime._encode generic function, so encoding is explicit here.
Skips the schema check _encode runs. A row here was built from typed structs, so what the check adds is range and pattern constraints, and reading checks every row against the full schema anyway.
InfrastructureCoreOpenAPIModels._model_id — Method
The id of a model row.
Errors when it is unset: every component and supplemental attribute in a document is referenced by id, so a row without one cannot be linked to anything and is malformed input rather than an absence to tolerate.
InfrastructureCoreOpenAPIModels._row — Method
Deserialize one row into T.
InfrastructureCoreOpenAPIModels._rows — Method
Deserialize every row into T, across threads. Raises the error of the lowest-index bad row, so a failure reads the same on every run and thread count.
InfrastructureCoreOpenAPIModels._typed_attribute — Method
Deserialize one supplemental attribute row using its indexed attribute_type.
InfrastructureCoreOpenAPIModels.add_component! — Method
Add a component to its type's bucket.
Also records the component's id in component_types_by_id, the cache add_supplemental_attribute! reads instead of rescanning components.
InfrastructureCoreOpenAPIModels.add_supplemental_attribute! — Method
Record a supplemental attribute and the component it describes.
Attributes are held in one flat list rather than bucketed by type: nothing iterates them per type, and the association carries both the link and the attribute_type a reader needs to pick a converter. The row mirrors infrastore's supplemental_attribute_associations catalog row field-for-field, so it also carries the component's type name as a denormalized label — resolved from the document, which is why the component must be added before its attribute.
Plant-family groupings (shaft/penstock/PCC/exclusion-group) and combined-cycle HRSG assignments are recorded separately, via PowerCoreOpenAPIModels.add_plant_association! and add_combined_cycle_association!; service membership via add_service_association!. None of the three reuses this table.
InfrastructureCoreOpenAPIModels.add_time_series_association! — Method
Record one time series metadata row, an InfrastructureTimeSeriesOpenAPIModels TimeSeriesAssociation. The values themselves are the consumer's business.
Untyped because this package cannot depend on the TimeSeries one; the container's concrete Vector{TimeSeriesAssociation} field rejects any other row.
InfrastructureCoreOpenAPIModels.check_schema_version — Method
Classify raw's schema_version against this package's: :missing, :malformed, :incompatible, :newer, :upgradable, or :current.
Pure, and meant for the raw parsed JSON before any decode. Only :upgradable and :current are readable.
InfrastructureCoreOpenAPIModels.component_type_names — Method
Type names present, sorted, so serialized output is deterministic across builds.
InfrastructureCoreOpenAPIModels.decode — Method
decode(T, value[, validate])Build a T from parsed JSON data (a scalar, Vector, or AbstractDict), replacing OpenAPI.jl 0.2's OpenAPI.from_json. validate defaults to true, which checks the value against the schema the generated package embeds.
A thin public alias for the runtime's _decode: consumers need this entry point (to read a store's catalog rows, or to build a strictly-typed generated struct from hand-assembled keyword arguments), and without it every one of them reaches into an underscore-internal of another package.
InfrastructureCoreOpenAPIModels.document_tree — Function
The document as a tree of plain JSON-safe values, ready for a single JSON encoding pass.
InfrastructureCoreOpenAPIModels.encode — Method
encode(value)Reduce a generated model to JSON-ready data, replacing OpenAPI.jl 0.2's OpenAPI.to_json. The public alias for the runtime's _encode, for the same reason as decode.
InfrastructureCoreOpenAPIModels.get_components — Method
Components of one type, in the order they were added.
InfrastructureCoreOpenAPIModels.get_ext — Method
The extras recorded for component_id, or an empty dictionary if none were.
InfrastructureCoreOpenAPIModels.get_source_schema_version — Method
The schema version doc was read at, or this package's own for a document built here.
InfrastructureCoreOpenAPIModels.get_supplemental_attributes — Method
Supplemental attributes of one type, in the order they were added.
InfrastructureCoreOpenAPIModels.has_model_type — Method
Whether a model type is registered under name.
InfrastructureCoreOpenAPIModels.model_type — Method
The model type registered under name.
Errors naming the value rather than skipping it: a document that names a type this build has no model for cannot be read faithfully, and dropping the rows would lose data silently.
InfrastructureCoreOpenAPIModels.next_id! — Method
Allocate an id from the document-wide counter.
InfrastructureCoreOpenAPIModels.register_model_type! — Method
Register T under its bare type name so documents naming it can be deserialized.
Called from each domain package's generated register.jl, which registers every type the package emits except the enum wrappers.
Re-registering the same type is a no-op; two different types with one name is a build error, not something to resolve at read time.
InfrastructureCoreOpenAPIModels.reserve_ids! — Method
Note that ids 1:n are already in use, so next_id! does not reissue them.
For a writer that assigns ids itself (reproducing a document's original ids, say) rather than drawing every one from next_id!.
InfrastructureCoreOpenAPIModels.set_ext! — Method
Record source data that no schema field claims, against the component it came from.
This is recorded debt, not an extension point — every key here is a field the data model should eventually name. Empty extras are dropped rather than stored as an empty object.
InfrastructureCoreOpenAPIModels.validate_document — Function
Check that the document is internally consistent: ids unique, every reference resolvable.
InfrastructureCoreOpenAPIModels.write_document — Method
Write doc to path as JSON.
schema_version = :current (default) stamps this package's schema version. :source stamps the version the document was read at (get_source_schema_version): identical to :current when they match, otherwise the encoded document is validated against that version's strict bundle and the write fails listing every offending path, never dropping anything. That validation needs JSONSchema.jl loaded.
path names the JSON file only. The sidecar files named by time_series_storage_file (and base_system_file, for a portfolio) are not written here — this package handles neither base systems nor time series values — so the caller writes them and sets those basenames, which keeps the file layout the caller's choice.
Validates first: a document that fails validate_document must not reach disk.