com-pas / compas-cim-mapping Goto Github PK
View Code? Open in Web Editor NEWService to Map CIM Data to SCL Data
License: Apache License 2.0
Service to Map CIM Data to SCL Data
License: Apache License 2.0
As a developer
I want to have a fresh start developing the CIM Mapping
So that the old code and Gradle build are gone
Currently the project is using Gradle, but we switched to Maven recently and also the code currently in the project is not needed anymore. That functionality moved to the CoMPAS SCL Data Service.
The idea is to rename this repository and create a new repository to have fresh start.
The following action need to be done:
As an architect
I would like to know the supported classes and the mapping rules from IEC CIM to IEC61850
So I can see if it fits my use-case
Acceptance criteria:
Document the supported classes
Refer to IEC mapping or write the mapping yourself (in case of custom/ non-standard mapping)
As an engineer
I want to map the IEC CIM 'Bay' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As a security specialist
I would like to have the credentians stored in a secure vault
so it is harder for hackers to use the default credentials
As a Deployer
I want to be able to configure which Claim Value (basically a key-value) to use for Who (in the tHistory part of the XML SCL file).
So that it can be configured for each environment.
Background:
The first solution was to get the name from the principal, but we want to have more control.
So make it configurable to configure which claim to use from the JWT.
Currently a Busbar Section in CIM is converted to a Bay in IEC 61850. This Busbar Section will also contain 1 Connectivity Node with a name X. This Connectivity Node should be used in the Bays that are also linked to X. Currently X is also added as new Connectivity Node to the other Bays.
Example:
<Bay name="BUSBAR10">
<ConnectivityNode name="CONNECTIVITY_NODE82" pathName="sub1/S1 380kV/BUSBAR10/CONNECTIVITY_NODE82"/>
</Bay>
<Bay name="BAY_T4_2">
<ConductingEquipment name="BREAKER25" type="CBR">
<Terminal cNodeName="CONNECTIVITY_NODE83" connectivityNode="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE83" name="T4_2_ADDB1"/>
<Terminal cNodeName="CONNECTIVITY_NODE84" connectivityNode="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE84" name="T4_2_ADDB2"/>
</ConductingEquipment>
<ConductingEquipment name="DISCONNECTOR49" type="DIS">
<Terminal cNodeName="CONNECTIVITY_NODE82" connectivityNode="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE82" name="T4_2_ADD_DSC11"/>
<Terminal cNodeName="CONNECTIVITY_NODE83" connectivityNode="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE83" name="T4_2_ADD_DSC12"/>
</ConductingEquipment>
<ConductingEquipment name="DISCONNECTOR50" type="DIS">
<Terminal cNodeName="CONNECTIVITY_NODE84" connectivityNode="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE84" name="T4_2_ADD_DSC21"/>
<Terminal cNodeName="CONNECTIVITY_NODE85" connectivityNode="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE85" name="T4_2_ADD_DSC22"/>
</ConductingEquipment>
<ConnectivityNode name="CONNECTIVITY_NODE82" pathName="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE82"/>
<ConnectivityNode name="CONNECTIVITY_NODE83" pathName="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE83"/>
<ConnectivityNode name="CONNECTIVITY_NODE84" pathName="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE84"/>
<ConnectivityNode name="CONNECTIVITY_NODE85" pathName="sub1/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE85"/>
</Bay>
The Connectivity Node of Terminal DISCONNECTOR49 should be pointing to "sub1/S1 380kV/BUSBAR10/CONNECTIVITY_NODE82" and that Connectivity Node should also not be added to the Bay "BAY_T4_2".
As a Developer
I want to have the PowSyBl being configured
So that the mapping of the CIM to IEC 61850 can be coded
The first step to start coding the mapping is to have a component in the service module to read a string that contains a CIM Mapping using PowSyBl that will be used as Source for the mapping.
To make it usable also create a REST Entrypoint that can be called. The endpoint retrieved a CIM Mapping File as "JAXB Element?" and returns a SCL Class in a response. The Entrypoint will call a Service in which the CIM Mapping File is read using PowSyBl
Development Steps:
As an data architect
I would like to have the IEC CIM busbarsection converted to a IEC61850 bay (including the name). The related connecity node should be part of this bay.
So it fits the IEC61850 guidelines
Acceptance criteria:
The 61850 bay of rail section can contain only one connectivity node.
CIM busbar section connected via a terminal to a CIM connectivitynode
Actions:
Covert IEC CIM busbarsection to a 61850 bay
Trace the related connectivity node via terminal and add it to the 61850 bay
Elements within elements are identified for example as follows:
@XmlElement(name = "Substation.Region")
private Region region;
This identifies a Substation.Region element within a Substation element.
I hope this can be achieved by using Region instead of Substation.Region:
@XmlElement(name = "Region")
private Region region;
I don't know if this is possible, but it's more clean.
As an engineer
I want to map the IEC CIM 'ConnectivityNode' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As an engineer
I want to map the IEC CIM 'PowerTransformer' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
When a error is returned from a Native Image the body isn't complete. The Error Code and Error Message fields are missing.
It looks like the @reflection annotation is needed for these classes on the configuration class, because as far as known the jaxrs-common jar is configured in the application.properties for scan during native image build.
Also see
As an engineer
I want to map the IEC CIM 'Terminal' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
It look like the latest upgrade of Quarkus (we think) broken the native image.
The following error occurs:
2022-05-02 10:54:00,235 WARN [org.lfe.com.cor.jax.exc.GenericExceptionHandler] (executor-thread-0) Unknown exception occurred.: java.lang.ClassCastException: javax.xml.bind.annotation.XmlSeeAlso$$ProxyImpl cannot be cast to com.sun.xml.bind.v2.model.annotation.Locatable
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:260)
It seems like to many classes are stripped.
After upgrading to Quarkus version 2.8.1.final the native image does work anymore.
Create a issue for it at Quarkus (#25325)
Until a new version is released we will create a non-native version of the Docker Image for CIM Mapping.
As this repo is now REUSE compliant, it is eligable for a badge.
You can submit this repo for scanning here: https://api.reuse.software/register
As an engineer
I want to map the IEC CIM 'Switch' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As an engineer
I want to map the IEC CIM 'Disconnector' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As an engineer
I want to map the IEC CIM substation class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As an engineer
I want to map the IEC CIM 'Junction' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
User Story
As a developer
I want to upgrade to Java 17
So that I can use the latest features and we keep up with Java releases (for security updated)
Acceptance criteria
The project is build with Java 17 and the containers are using Java 17 to run.
Convert some Request/Response/Model Classes to Records and check if it works.
As a risk owner
I want to fix the small LFx security scanner issues
So I know that known vulnerabilities are addressed
Background:
The security issues can be found in the LFx security scanner:
https://security.lfx.linuxfoundation.org/#/e8b6fdf9-2686-44c5-bbaa-6965d04ad3e1/issues
Acceptance criteria:
Start with the critical issues
Critical/High/Medium issues to be adressed
Quick fixes can be fixed directly
Major/complex issues require a seperate Github issue
As a developer
I want to use a mapping framework
So that I can easily map CIM Objects to IEC61850 Objects
To map the CIM Files it would be nice to use a mapping framework, like Orika, to map properties between CIM and IEC61850.
It would be nice to not have it only in code, but that there is also some kind of GUI to maintain these mappings. This way mapping can be updated in the future by other people then developers.
As an engineer
I want to map the IEC CIM 'VoltageLevel' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
To make easier releases, we should set up the GitHub Action Release please.
See OpenSCD Release-please for more info
Acceptance criteria:
Release-please creates a pull-request of a release
Right now, elements other than the default namespace are identified for example as follows:
@XmlElement(name = "Substation", namespace = "http://iec.ch/TC57/2013/CIM-schema-cim16#")
Namespaces are very changeable, so this needs to be fixed.
Or at least, now being hardcoded.
As a user
I want the tool to add a History record with the needed information, like username and CIM files used to create the SCL
So that later can be tracked how the SCL was created.
Background:
Create a THItem Record in the header
version -> "0.0.1"
revision -> ""
when -> current date/time (YYYY-MM-DDThh:mm:ssXXX) (XSD date-time format)
who -> Username of the logged in user
what -> "SCL created from CIM File(s), {list of CIM filenames}"
The data service will change the version number to the actual number in the database.
As a security officer
I want user to be authenticated
So that only known users can use the CIM Mapping Service.
Background:
We only want logged in users to be able to use the CIM Mapping Service.
Also the username is set on the History Record in the create SCL.
As a engineer
I would like to select a substation to convert from CIM to 61850 and see the progress
So I can convert them manually
Background:
To give engineers more confidence in conversions and more control. This relies heavily on the CIM-61850 mapping component.
Acceptance criteria:
Currently some queries are already changed to retrieve the minimal needed data from the TripStore.
But there are still some elements queried from the TripStore using the CGMES Model.
These queries most of the time need more required data, because of the CGMES Model, but that data isn't used in the mapping.
To prevent elements not being mapped, it would be better to use our own simplified SparQL to retrieve the data that's only needed for the mapping.
Example Queries can be copied as starting point from CGMES (File in Source of PowSyBl, CIM16.sparql).
As a user
I would like to convert IEC CGMES profiles without ACDCTerminal.sequenceNumber if they are not used by the mapping service or other related CoMPAS services
So I can use the CGMES profiles without ACDCTerminal.sequenceNumber
Background:
As long as ACDCTerminal.sequenceNumber is not used it the mapping, it can be removed.
As an engineer
I want to map the IEC CIM 'Busbar' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
Currently the query from PowSyBl CGMES is used to query the substations.
But these also query for (sub)regions and that information isn't used in CoMPAS.
So we will use our own query to only query data from the Substation that's used.
As a developer
I want to remove the PowSyBl depency in the CIM mapping
So that the software consumes less memory
Also we are use less functionality of CGMES from PowSyBl to query objects from the TripStore
and use our own queries to retrieve object from the Tripstore. Using only RDF4J will make more sense in this case.
As an engineer
I want to map the IEC CIM 'LoadBreakSwitch' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
After upgrading the native image is no longer working.
It looks like a specific class is missing so we probably need to add this class to the reflection list of classes.
For generating the SCL base files, we use XSD schemas in combination with XJC to generate the Java models.
The XSD schemas are downloaded from the IEC 61850-6 standard.
Do we need to add some license information about these schemas in our README?
This issue was automatically created by Allstar.
Security Policy Violation
Security policy not enabled.
A SECURITY.md file can give users information about what constitutes a vulnerability and how to report one securely so that information about a bug is not publicly visible. Examples of secure reporting methods include using an issue tracker with private issue support, or encrypted email with a published key.
To fix this, add a SECURITY.md file that explains how to handle vulnerabilities found in your repository. Go to https://github.com/com-pas/compas-cim-mapping/security/policy to enable.
For more information, see https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository.
This issue will auto resolve when the policy is in compliance.
Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.
As an engineer
I want to map the IEC CIM 'BaseVoltage' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Default value for CGMES profiles: k for the multiplier and V for the unit.
Background:
Mapping can be based on IEC/TS 62361-102
Acceptance criteria:
Document the use of the multiplier and unit.
We currently parse a RDF file as follows:
Model model = Rio.parse(new FileInputStream(file), "http://example.uri", RDFFormat.RDFXML);
It's not working unless we add a (random) baseURI (like http://example.uri for example).
Why is this? And how can we make this a bit more clean?
As an engineer
I want to map the IEC CIM 'TapChanger/PhaseTapChanger/RatioTapChanger' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As an engineer
I want to map the IEC CIM 'TransformerEnd/PowerTransformerEnd/TransformerTankEnd' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As before, some of the CGMES SparQL require more data then we use to map a CIM File to a 61850 File.
The solution is again to create our own simplified SparQL that requires less fields to be present.
Current CGMES Query is
SELECT *
WHERE {
{ GRAPH ?graph {
?PowerTransformer
a cim:PowerTransformer ;
cim:IdentifiedObject.name ?name .
OPTIONAL { ?PowerTransformer cim:Equipment.EquipmentContainer ?EquipmentContainer }
?TransformerEnd
a cim:PowerTransformerEnd ;
cim:PowerTransformerEnd.PowerTransformer ?PowerTransformer ;
cim:PowerTransformerEnd.b ?b ;
cim:PowerTransformerEnd.r ?r ;
cim:PowerTransformerEnd.x ?x ;
cim:PowerTransformerEnd.ratedU ?ratedU ;
cim:TransformerEnd.endNumber ?endNumber ;
cim:TransformerEnd.Terminal ?Terminal .
OPTIONAL { ?TransformerEnd cim:PowerTransformerEnd.connectionKind ?connectionKind }
OPTIONAL { ?TransformerEnd cim:PowerTransformerEnd.phaseAngleClock ?phaseAngleClock }
OPTIONAL { ?TransformerEnd cim:PowerTransformerEnd.g ?g }
OPTIONAL { ?RatioTapChanger cim:RatioTapChanger.TransformerEnd ?TransformerEnd }
OPTIONAL { ?PhaseTapChanger cim:PhaseTapChanger.TransformerEnd ?TransformerEnd }
}}
}
This may be simplified to
SELECT *
WHERE {
{ GRAPH ?graph {
?PowerTransformer
a cim:PowerTransformer ;
cim:IdentifiedObject.name ?name .
?TransformerEnd
a cim:PowerTransformerEnd ;
cim:PowerTransformerEnd.PowerTransformer ?PowerTransformer ;
cim:TransformerEnd.endNumber ?endNumber ;
cim:TransformerEnd.Terminal ?Terminal .
FILTER (str(?PowerTransformer) = \"http://default-cgmes-model/#${powerTransformerId}")
}}
}
As an engineer
I want to map the IEC CIM 'Breaker' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
As an engineer
I want to map Cim Switch Codes to IEC Equipment Type
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping is be based on IEC/TS 62361-102, chapter 5.6.2, but some CIM Codes can be mapped on multiple IEC Codes.
For instance
CAB("ACLineSegment", "DCLineSegment"),
GIL("ACLineSegment", "DCLineSegment"),
IFL("ACLineSegment", "DCLineSegment", "EquivalentBranch"),
LIN("ACLineSegment", "DCLineSegment"),
There must be decided how to handle this.
When I test a generic CGMES file and convert it 61850, and error occurs in the validation.
As a developer
I want to use compas-core functionality be reused by the compas-cim-mapping
So I can save time in development
Since 2.3.0, the setup-java GitHub actions have a built-in cache mechanism which simplifies configuration of the workflow.
It will simplify this: https://github.com/com-pas/contributing/blob/e0e6ccbc2160d9ad05cf0dadea5faa33a977d8c1/docs/GITHUB_ACTIONS.md?plain=1#L147
already updated in compas-sct com-pas/compas-sct#217
User Story
As a com-pas maintainer
I want to have the simpler code to maintain
So that I can develop faster
Acceptance criteria
Please describe the initial acceptance critera.
Same feature level with less and simpler code
As an engineer
I want to map the IEC CIM 'ProtectedSwitch' class to the IEC 61850 equivalent
So I can generate 61850 single line diagrams without manual editing
Background:
Mapping can be based on IEC/TS 62361-102
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.