Skip to content

Fix CGMES connectivityNodesContainer performance#3915

Draft
jeandemanged wants to merge 1 commit into
mainfrom
fix-cgmes-perf-connectivityNodesContainer
Draft

Fix CGMES connectivityNodesContainer performance#3915
jeandemanged wants to merge 1 commit into
mainfrom
fix-cgmes-perf-connectivityNodesContainer

Conversation

@jeandemanged
Copy link
Copy Markdown
Member

@jeandemanged jeandemanged commented May 12, 2026

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Bug fix / performance

What is the current behavior?

connectivityNodeContainers query performing poorly for very large numbers of substations and voltage levels

What is the new behavior (if this is a feature change)?
Fixed performance issue by simplifying connectivityNodeContainers query and moving additional processing on Java side.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

TBD: Unsure here, is changing PropertyBags content a breaking change ?

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Reported on PowSyBl #cgmes Slack channel by https://codeberg.org/caspereijkens
Tool to build large CGMES grids: https://codeberg.org/caspereijkens/gigagrid/src/branch/main/main.py

Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
@jeandemanged jeandemanged marked this pull request as draft May 12, 2026 21:38
@sonarqubecloud
Copy link
Copy Markdown

String line = type != null && type.contains("Line") ? id : null;
String voltageLevel = type.contains("VoltageLevel") ? id : c.getId("VoltageLevel");
String substation = type.contains(SUBSTATION) ? id : c.getId(SUBSTATION);
String line = type.contains("Line") ? id : null;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an If on the type would be cleaner

Comment on lines +319 to +320
?ConnectivityNodeContainer cim:Bay.VoltageLevel ?VoltageLevel .
?VoltageLevel cim:VoltageLevel.Substation ?Substation .
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to check: does it work if Bay properly contained in VoltageLevel but VoltageLevel not contained in any Substation ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work, but this is probably illegal data (?)

cim:Bay.VoltageLevel ?VoltageLevel .
?VoltageLevel cim:VoltageLevel.Substation ?Substation
}
OPTIONAL {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this on purpose? ignoring that some connectivity nodes may be contained directly in a substation?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the fix also apply to CIM100.sparql?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, CIM100.sparql is based in CIM16.sparql, only queries that are different are rewritten. the query for connectivity node containers is not overriden in CIM100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants