Skip to main content

Module edit

Module edit 

Source
Expand description

Edits across a model set, as text edits for whoever holds the files to apply: renaming an mRID, deleting objects and adding a field a finding says is missing; and the objects a reference can name, the likeliest first; adding an object in a container. They change the files as written, keeping everything else of them, and reach every file of the set: an object’s EQ, SSH and SV elements and every reference to it.

The caller gives the files as they are now, each named as it likes (a URL, a file name), with its Index; the edits come back by that name.

Structs§

Addable
A class that can be added in an object, and the field naming it there.
Added
An object added: the edits, and where its name (else its start tag) is.
Addition
A field to add: where, and where its value is once added.
Candidate
An object a reference can name.
Copied
Objects copied: the edits, and each object’s new mRID.
Deletion
What deleting objects changes: the elements writing them, in every file, and the fields referring to them from what stays. Whole lines go, so a client should show it before applying it.
File
One file of the set, as it is now.
ReferenceFix
A fix for a reference to nothing (rdf:resource="#") or to an object the set lacks: name one of the likeliest objects instead.

Functions§

add
Add an object of class in parent, named name if given: an rdf:ID, its mRID, name and the field naming parent, in the file whose profile carries the class (the parent’s own first), after the last of the parent’s objects there, else after the parent, else at the end; and where the set has an SSH file and the class SSH attributes, an empty rdf:about there for them. What else it needs, validation asks for. Its mRID is _ and a UUID from random (uuid), drawn again while the set has it.
add_missing
Add field key to object id, which writes it nowhere: in the file (prefer first) whose profile carries it and that writes the object, after its last field, with a value to type over — the object’s mRID for IdentifiedObject.mRID, false, 0, an enumeration’s first value, or none. None if a file writes it already, its class does not declare it, or no file fits.
addable
The concrete classes of parent’s family whose objects the containment puts in it: the first of CONTAINED they declare that ranges over its class. Only classes of the profiles the set’s files declare (all, if none declares one).
candidates
The objects field key of object id can name — of the class it ranges over, or below — at most limit, the likeliest first: those linked to the object, naming what it names with its other fields or named by it (a terminal’s connectivity node, of its topological node; equipment’s base voltage, its voltage level’s); then those that share the most containers with it, by where they are or by where the objects are that name them with the same field (a line’s base voltage is the one the equipment of its voltage level names); then the most named. Empty if key is not a reference of the object’s class.
companion
The text of a new file of profile code (DL) beside like: its prolog and root, with their namespaces, and a FullModel header under the model id urn:uuid:{id} dependent on like’s model, with its times, version and modelling authority set.
copy
Copy objects ids with new mRIDs (_ and a UUID from random): every element writing each of them, in every file or only in from, its rdf:ID or rdf:about, its mRID field, and its references to the objects copied, rewritten to the copies; references to anything else stay. Each copy goes after its original, or with into, at the end of that file, which must bind the prefixes the copies use as their files do. from matters where two files define the same objects (a proposal and what was agreed of it): their copies would be one object written twice.
create
A new object of class, with values (field, value as set_field takes it) and its mRID as text where the class has a field for it (IdentifiedObject.mRID, or its own), written at the end of the file into, with an rdf:ID whose UUID is drawn from random. For objects in no container, which add cannot place: a response, a dependency.
delete
Delete objects ids.
describe
How an object is named in a title: its class and name, else mRID.
diagram
A DL diagram written into into: a new Diagram named name (y downwards), or in existing (in the file defining it, whatever into says), its drawing of what objects show replaced and the rest kept. Each of objects (the mRID it shows, its name, its points) a DiagramObject with its DiagramObjectPoints, numbered from 1. UUIDs from random. The diagram’s mRID is the result’s id.
prepare_rename
The mRID at pos in the file name — an element’s rdf:ID/rdf:about, or an rdf:resource — and the range of it as written; anywhere else in an element’s start tag, that element’s.
reference_fixes
The fixes for object id’s references to nothing or to objects the set lacks, in every file that writes it, or only the field at at: each the five likeliest objects (candidates); at names a file and a place in it. An enumeration value is not a reference to an object, so it has none.
referrers
The objects that refer to object id, and by which field, as the files write them: (referrer, field), each once.
remove_field
Remove field key from object id in every file writing it, its lines with it.
rename
Rename mRID old to new in every file: each element’s rdf:ID or rdf:about, each rdf:resource to it, and an IdentifiedObject.mRID (or a class’s own ….mRID) that writes it (without its leading _, as CGMES 3 does, if so).
set_field
Set field key of object id to value: a literal’s text (escaped here), a reference’s object (its mRID, or an IRI), or an enumeration’s value (D, or WindingConnection.D). Wherever a file writes the field, its value is replaced; where none does, it is added as add_missing adds it, prefer first. An error if the object’s class does not declare it.
uuid
A version 4 UUID from 16 random bytes, which the caller draws: the standard library has no randomness on every target this runs on.

Type Aliases§

Drawn
An object a diagram draws: the mRID it shows, its name, and its points.
Edits
Edits by file, in the order the files were given; only files that change.