Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGMES ground conversion #2848

Merged
merged 10 commits into from
Jan 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public Network convert(Reporter reporter) {
convert(cgmes.busBarSections(), bbs -> new BusbarSectionConversion(bbs, context));
}

convert(cgmes.grounds(), g -> new GroundConversion(g, context));
annetill marked this conversation as resolved.
Show resolved Hide resolved
convert(cgmes.energyConsumers(), ec -> new EnergyConsumerConversion(ec, context));
convert(cgmes.energySources(), es -> new EnergySourceConversion(es, context));
convf = eqi -> new EquivalentInjectionConversion(eqi, context);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
Copyright (c) 2024, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* SPDX-License-Identifier: MPL-2.0
*/
package com.powsybl.cgmes.conversion.elements;

import com.powsybl.cgmes.conversion.Context;
import com.powsybl.iidm.network.*;
import com.powsybl.triplestore.api.PropertyBag;

/**
* @author Luma Zamarreño {@literal <zamarrenolm at aia.es>}
*/
public class GroundConversion extends AbstractConductingEquipmentConversion {

public GroundConversion(PropertyBag ec, Context context) {
super("Ground", ec, context);
}

@Override
public void convert() {
GroundAdder adder = voltageLevel().newGround();
identify(adder);
connect(adder);
Ground g = adder.add();
addAliasesAndProperties(g);
convertedTerminals(g.getTerminal());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ default PropertyBags graph() {
return new PropertyBags();
}

default PropertyBags grounds() {
return new PropertyBags();
}

CgmesDcTerminal dcTerminal(String dcTerminalId);

void clear(CgmesSubset subset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ public PropertyBags graph() {
return namedQuery("graph");
}

@Override
public PropertyBags grounds() {
return namedQuery("grounds");
}

@Override
public PropertyBags modelProfiles() {
return namedQuery(MODEL_PROFILES);
Expand Down
11 changes: 11 additions & 0 deletions cgmes/cgmes-model/src/main/resources/CIM16.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,17 @@ WHERE {
}}
}

# query: grounds
SELECT *
WHERE {
{ GRAPH ?graph {
?Ground
a cim:Ground ;
cim:IdentifiedObject.name ?name .
?Terminal cim:Terminal.ConductingEquipment ?Ground .
}}
}

# query: update
DELETE { GRAPH <{0}>
{ ?subject ?predicate ?value }
Expand Down