From 2220e4e78e9cdbbe97c1ba90891f9b61aeb4168a Mon Sep 17 00:00:00 2001 From: Leif Warland Date: Fri, 21 Jun 2024 15:34:54 +0200 Subject: [PATCH] fix: devide controller factor by number of poles for any converter The controller factor is given per pole and there can be one or two converters per pole. --- cimsparql/sparql/converters.sparql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cimsparql/sparql/converters.sparql b/cimsparql/sparql/converters.sparql index 5ea5a710..d8e67637 100644 --- a/cimsparql/sparql/converters.sparql +++ b/cimsparql/sparql/converters.sparql @@ -14,8 +14,14 @@ where { cim:IdentifiedObject.name ?name; ALG:VoltageSourceConverter.DCPole|ALG:DCConverter.DCPole ?pole. - ?pole ALG:DCPole.DCController/cim:IdentifiedObject.mRID ?controller; - ALG:DCPole.participationFactor ?controller_factor. + ?pole ALG:DCPole.DCController/cim:IdentifiedObject.mRID ?controller. + { + select ?pole (max(xsd:float(str(?controller_factor))) / count(*) as ?controller_factor) + { + ?converter ALG:VoltageSourceConverter.DCPole|ALG:DCConverter.DCPole ?pole. + ?pole ALG:DCPole.participationFactor ?controller_factor. + } group by ?pole + } optional {?converter cim:IdentifiedObject.aliasName ?alias .} # Extract properties for the terminals for the converter