Giter Site home page Giter Site logo

compas-cim-mapping's People

Contributors

apupier avatar dependabot[bot] avatar flurb avatar fredfouspro avatar juancho0202 avatar nicorikken avatar pascalwilbrink avatar stef3st avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

compas-cim-mapping's Issues

Setup GIT Repository for start developing

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:

  • Rename current repository
  • Create new "compas-cim-mapping" repository.
  • Copy settings from old repository
  • Create a project board
  • Check that the branches "main" and "develop" exist
  • Create a basic Quarkus project based on Maven
  • Transform this project to a multi-module project with Quarkus as "app" module and a module "service".

Document the mapping

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)

Map CIM class 'Bay' to IEC 61850 SCL equivalent

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

Vault use for secrets

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

Make configurable which Claim to use from JWT as value for Who

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.

Connectivity Node from Busbar Section should be used in the Bay

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".

Configure PowSyBl

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:

  • Create a component to read a CIM Mapping File using PowSyBl
  • Create a service component that uses that component and for know returns a empty SCL Class.
  • Create a endpoint that uses that service.

Add 61850 bay to 61850 connectivity node when transforming a IEC CIM railsection

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 named by order using a dot separator

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.

Map CIM class 'Terminal' to IEC 61850 SCL equivalent

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

CIM Mapping Native Image broken

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.

Fix broken Native Image

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.

Map CIM class 'Switch' to IEC 61850 SCL equivalent

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

Map CIM class 'Junction' to IEC 61850 SCL equivalent

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

Move to Java 17

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.

Fix security issues compas-cim-mapping

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

Investigate which mapping framework to use

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.

Setup Release-please

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

Namespaces of XML elements are hardcoded

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.

Correctly fill the THistory record of the created SCL

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.

Add SmallRye JWT Security to project

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.

GUI for CIM conversion

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:

  • Upload CIM XML file (CIM XML / RDFS) / (CGMES-EQ based)
  • Select substation
  • Convert to an .SSD and see the conversion result (openSCD)
  • OpenSCD plug-in

Use Simplified SparQL to retrieve data from TripStore

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).

Check and remove the ACDCTerminal.sequenceNumber dependency

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.

Simplified Query for Substation from the Tripstore

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.

Remove PowSyBl dependency

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.

Fix issue with Native image (0.7.5)

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.

Security Policy violation SECURITY.md

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.

Map CIM class 'BaseVoltage' to IEC 61850 SCL equivalent

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.

What to do with BaseURI in the RDF4J parser?

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?

Mapping PowerTransformerEnds from CIM to 61850 requires more data than used

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}")
}}
}

Map CIM class 'Breaker' to IEC 61850 SCL equivalent

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

How to handle double mappings from Cim Switch Code to IEC Equipment Type

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.

Use compas-core functionality

As a developer
I want to use compas-core functionality be reused by the compas-cim-mapping
So I can save time in development

Simplify caching Maven artifact configuration in GitHub Workflows example

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.