This release is a pre-release and may not be stable for production use.
CIM-Profiles
CIMTool workspaces for the CIM 16–18 profiles, and the cimprofiles Python package built from
them. These files originally shipped as part of cim-graph 0.1.x through 0.5.x.
cimprofiles ships the CIM profiles as Python dataclasses, together with the object model they
are built on (Identity, CIMUnit, profile merging). It depends only on pint, and it is
released separately from cim-graph. Profile updates
(new classes from EA tickets, new profiles) therefore don't wait for a cim-graph release.
pip install cimprofiles
import cimprofiles.cim18.cimhub_2026 as cim
line = cim.ACLineSegment(name='line_1')
cim-graph 0.6 and later depend on cimprofiles. The old cimgraph.data_profile.* import paths
still work there, with a DeprecationWarning.
Repository layout
| Path | Contents |
|---|---|
cim17v40/, cim18v15/ |
CIMTool workspaces. The Sparx EA .eap models are stored with Git LFS. |
CIMTool_plugin/ |
The cimantic-graphs XSLT builders and their documentation |
src/cimprofiles/ |
The Python package, with profiles grouped by CIM version (cim16/, cim17/, cim18/). See src/cimprofiles/README.md for the available profiles and how merging works. |
scripts/import_cimtool_output.sh |
Copies a profile generated by CIMTool into src/cimprofiles/ and rewrites its imports |
src/cimprofiles/jsonld/ |
JSON-LD contexts, QUDT unit vocabularies and their offline cache (see below) |
tests/ |
Tests for Identity, UUIDs, merging and the generated profiles |
Seeded UUIDs
Deterministic identifiers are what downstream converters (ArcGIS, OpenDSS, ...) rely on to give
the same equipment the same RDF ID on every run. Identity.identifier is a UUID (CIM 18):
either the one given, or a deterministic construct. There are two cases.
Read from a file: the rdf:ID/rdf:about is the UUID, in any serialization
(urn:uuid:…, #_…, _…, any case). The name is not used. An identifier that is not a UUID is
replaced, with a warning, by the UUID seeded from it (below), so reading the same file again
gives the same UUIDs. The original string is kept as the mRID, unless the file has an mRID.
Readers key their graphs with cimprofiles.identity.read_identifier, which gives the same UUID.
Built (converters, notebooks, .cimtbl): a new object, deterministic only for the same model
authority, model and class, plus one of two keys. A UUID given as the mRID is used directly.
- mRID route - with a (non-UUID) mRID, the mRID is the key and the name is not used, so a renamed object keeps its UUID. CIM 18 relaxes the mRID to a freeform string unique within the model, so this is the route for models keyed by mRID.
- Name route - with no mRID, the name is the key, so a renamed object (bus 300 to bus 301) is a different object and gets a different UUID.
The seeded UUID is version 5 (RFC 9562 §5.5):
namespace = uuid5(NAMESPACE_URL, model_authority)
uuid = uuid5(namespace, f'{model_name}+{ClassName}+{mRID}+{name}+{seed}')
model_authorityis a URI (CIMG_MODEL_AUTHORITY, defaulthttps://github.com/PNNL-CIM-Tools/CIM-Graph), as inmd:Model.modelingAuthoritySet. The namespace is also the identifier of thecim:ModelAuthorityobject cim-graph writes in file headers, so each authority's UUIDs live in its own namespace.model_namecomes fromCIMG_MODEL_NAME(default empty).mRIDis the object's mRID, or the non-UUIDrdf:ID/rdf:aboutof an object read from a file. It is normalized so every serialization of one object agrees: surrounding whitespace, aurn:uuid:prefix, everything up to the last#and one leading_are removed.rdf:ID="_LINE1",rdf:about="#_LINE1"andmRID="LINE1"give the same UUID. Case is kept.name(whitespace-trimmed) is used only when there is no mRID, so one of the two is always empty.seed(passed toobj.uuid(seed=...)) is optional.- Every component keeps its position even when empty, and
%and+inside a component are escaped as%25and%2B, so two different inputs never produce the same string. - No identifying input at all (or only empty/blank values) gives a random version 4 UUID.
obj.uri() returns the bare UUID: lowercase, or uppercase if it was read uppercase (CIMHub and
GridAPPS-D data), so writing a file back reproduces its identifiers. Underscores and
urn:uuid: prefixes belong to the serialization style and are added by cim-graph's writers
and queries (CIMG_IEC61970_552: 552-NEW, 552-LEGACY or CGMES).
cimprofiles.identity.seeded_uuid and model_authority_namespace implement the seeded UUID, and any
language with a UUID library can reproduce it from this description.
Updating a profile
- Regenerate it in CIMTool with the cimantic-graphs builders (
CIMTool_plugin/builder.md). - Import it. This rewrites the
cimgraph.data_profileimports emitted by CIMTool before 2.3.1:scripts/import_cimtool_output.sh cim17 <Profiles/name.py> <Profiles/name.__init__.py>
The first argument is the CIM version directory. A fourth argument names the package directory when it differs from the envelope name (gridappsd_rc4_2021forrc4_2021), or places a part of a merged profile (cim18v17/substation). - Remove duplicate field definitions, and rebuild the pre-baked merged profiles (cim18gmdm,
cgmes_3_0_0, cim18v17 and its distribution and transmission flavors) if it is one of their parts:
uv run python -m cimprofiles.dedupe_profile_fields uv run python -m cimprofiles.build_merged_profiles
- Rebuild its JSON-LD documents (below):
uv run python -m cimprofiles.jsonld.build <profile>. - Run the tests:
uv run pytest.
JSON-LD contexts and units
Each profile has a JSON-LD context and one or more unit vocabularies, published at
https://pnnl-cim-tools.github.io/CIM-Profiles/<profile>/<version>/ and shipped in the
package (src/cimprofiles/jsonld/cache) so they resolve offline. The version is a stable
cim-profiles release, in the URL as CGMES puts versions in its IRIs:
-
While a release is in alpha (
0.2.1a1,a2, ...), its directory (0.2.1/) is rebuilt in place as often as needed. Alpha documents resolve offline from the alpha wheel; Pages publishes stable releases only. -
Once the release is on PyPI its documents are frozen, since files written with it name them. Rebuilding changed documents for a released version fails and asks for the next release target in
pyproject.toml. -
A profile gets a new directory only when its documents change; otherwise it keeps naming the release that last changed them. Earlier directories stay published.
-
Context (
context.jsonld): prefixes, and each property's datatype ({"@type": "@id"}for references and enumerations,xsd:float,xsd:integer,xsd:boolean), plus thedcat:Datasetheader terms typed as in the Inst4CIM CGMES context (dct:conformsTo,dcat:isVersionOfas IRIs,dct:issuedasxsd:dateTime). Next to@context, the file records its@id(its URL) andowl:versionInfo(the full release, e.g.0.2.0); JSON-LD processors read only@contextfrom a remote context. A JSON-LD context cannot carry units. -
Unit vocabulary (
units-<convention>.jsonld):qudt:hasUnitper property, the CGMES way. A data file names the vocabulary its numbers use indct:conformsTo; the vocabulary'sowl:versionIRIis its URL.
Units are a publishing convention, set per profile in src/cimprofiles/jsonld/conventions/<profile>.yaml.
Each property's unit is its properties override, else its quantity_kinds default, else the
CIMUnit base unit (SI):
profile: cimhub_2023
default: si
conventions:
si: {}
distribution:
quantity_kinds: {ActivePower: kW, ReactivePower: kVAr, ApparentPower: kVA}
properties: {WireInfo.radius: mm}
cgmes_3_0_0 uses the published CGMES 3.0 context and vocabularies (MW, kV, km, ...) instead
(copies from Inst4CIM-KG, Apache-2.0).
uv run python -m cimprofiles.jsonld.build # rebuild every profile into the cache
uv run python -m cimprofiles.jsonld.build my-units.yaml --base-url https://example.org/cim/ --output site
The second form builds your own convention for hosting elsewhere. Readers resolve it from its URL
when fetching is allowed (cimprofiles.jsonld.load_document(iri, allow_fetch=True)); only the
shipped cache is used otherwise.
Development
uv sync
uv run pytest
License
BSD 3-Clause. See LICENSE.
Metadata
Release files for cim-profiles 0.2.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cim_profiles-0.2.0a4.tar.gz | 3.3 MB | With provenance | Details for cim_profiles-0.2.0a4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cim_profiles-0.2.0a4-py3-none-any.whl | Python 3 | none | any | Details for cim_profiles-0.2.0a4-py3-none-any.whl |
Total release size: 6.7 MB
Release files / cim_profiles-0.2.0a4.tar.gz
| Download URL | cim_profiles-0.2.0a4.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4392be9412e6874b433d7808d9e6c8e9320484bbb034ddc1e44ba35c74704cb
|
|
BLAKE2b-256 checksum How to use checksums |
06bed6a62f37d09c224779674d1a104e19f111c4fc9c29ba312530388c5994b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / cim_profiles-0.2.0a4-py3-none-any.whl
| Download URL | cim_profiles-0.2.0a4-py3-none-any.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
143b664b66eb3a5799eab531cc46a83227a9037019a79f607b06c7a5edf71ce9
|
|
BLAKE2b-256 checksum How to use checksums |
aedaa634f3c409092d7802aded523d72fb9fb7d3c322e286948a18c45d31ab36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for cim-profiles 0.2.0a4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cim_profiles-0.2.0a4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.