A CIM model you can write in Notepad¶
.cimtbl is a plain-text table format for IEC CIM power-system models. Every table is a
CIM class, every column a CIM attribute, every row one CIM object. cimtables loads it into
cim-graph, ready to save as CIM RDF/XML or JSON-LD.
Profile = cim18v17
Authority = https://example.com/models
Model = tiny_feeder
Object BasePower: mRID=sbase, basePower (MVA)=100
Object Substation: mRID=sub
Object Feeder: mRID=fdr, NormalEnergizingSubstation=sub
Table BaseVoltage: mRID, nominalVoltage (kV)
bv_12kv, 12.47
Object EnergySource: mRID=source, node=sourcebus, phases=ABC, nominalVoltage (kV)=12.47, BaseVoltage=bv_12kv, EquipmentContainer=fdr
Table ACLineSegment: mRID, node1, node2, phases, length (ft), r (ohm), x (ohm), BaseVoltage, EquipmentContainer=fdr
ln_trunk, sourcebus, n1, ABC, 2000, 0.38, 0.75, bv_12kv
ln_branch, n1, n2, C, 500, 0.12, 0.20, bv_12kv
Table EnergyConsumer: mRID, node, phases, p (kW), q (kVAr), BaseVoltage, EquipmentContainer=fdr
ld_n1, n1, ABC, 1155, 660, bv_12kv
ld_n2, n2, C, 170, 80, bv_12kv
import cimtables
from cimgraph.utils import write_xml
network = cimtables.load_model('tiny_feeder.cimtbl') # a cim-graph FeederModel
write_xml(network, 'tiny_feeder.xml') # standard CIM RDF/XML
The loader makes what CIM requires but nobody wants to type: the Terminals, the ConnectivityNodes they
meet at, each line's and load's per-phase objects and every Terminal's PhaseCode. You wrote feet and
kilowatts; the model holds SI, as CIM does.
-
The profile is the schema
No list of supported classes. Any class, attribute or enumeration in the CIM profile can be written, and nothing else gets in.
-
Shorthand that expands to normative CIM
node1,node2andphasescolumns generate Terminals, nodes and per-phase objects by the CIM rules, delta loads included. -
Units on the header
length (ft),p (kW),x (pu). Values are converted once, to CIM's SI types;puandpercentuse the equipment's own rating or the model'sBasePower. -
Errors at the line
Each row is checked against the profile before it touches the model. Every error names the file and line, and nothing is skipped or guessed.
-
Both directions
to_documentswrites any cim-graph model, one read from CIM XML for example, back out as.cimtblthat loads into an equal model. -
Built for review
Read it top to bottom, diff it in git, review it in a pull request, ask an LLM to edit it. The same text always gives the same model, UUIDs included.
Where it fits¶
flowchart LR
profiles["<b>cim-profiles</b><br/>CIM classes and units"] --> cimgraph["<b>cim-graph</b><br/>the model in memory,<br/>CIM XML and JSON-LD"]
cimgraph --> tables["<b>cimtables</b><br/>.cimtbl in and out"]
tables --> builder["<b>CIM-Builder</b><br/>model builders"]
tables --> hub["<b>CIMHub</b><br/>format converters"]
models[("<b>CIMTBL-Models</b><br/>grid models<br/>in .cimtbl")] -.-> tables
Larger examples, including several versions of the IEEE 13-bus feeder, are in CIMTBL-Models.