Skip to content

Commit

Permalink
CGMES import grounds
Browse files Browse the repository at this point in the history
Signed-off-by: Luma <zamarrenolm@aia.es>
  • Loading branch information
zamarrenolm authored and So-Fras committed Jan 16, 2024
1 parent e148a02 commit fa5c00e
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
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));
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

0 comments on commit fa5c00e

Please sign in to comment.