Skip to content

Commit

Permalink
Merge pull request #181 from com-pas/develop
Browse files Browse the repository at this point in the history
Create new release with library updates and bugfixes
  • Loading branch information
Dennis Labordus authored Feb 7, 2022
2 parents d4cecf9 + 06cd24c commit 270c7c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ SPDX-License-Identifier: Apache-2.0

<compas.core.version>0.7.0</compas.core.version>

<quarkus.platform.version>2.6.2.Final</quarkus.platform.version>
<quarkus.platform.version>2.7.0.Final</quarkus.platform.version>
<microprofile-openapi-api.version>3.0</microprofile-openapi-api.version>
<slf4j.version>1.7.33</slf4j.version>
<powsybl.version>4.6.0</powsybl.version>
<slf4j.version>1.7.35</slf4j.version>
<powsybl.version>4.6.1</powsybl.version>
<mapstruct.version>1.4.2.Final</mapstruct.version>
<openpojo.version>0.9.1</openpojo.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ public CimToSclMapperContext(CgmesModel cgmesModel) {
* @return The List of converted CGMES Substations that were found.
*/
public List<CgmesSubstation> getSubstations() {
return cgmesModel.substations()
.stream()
return cgmesModel.tripleStore().query(
START_QUERY +
" ?Substation" +
" a cim:Substation ;" +
" cim:IdentifiedObject.name ?name ;" +
END_QUERY).stream()
.map(propertyBag -> new CgmesSubstation(
propertyBag.getId(SUBSTATION_PROP),
propertyBag.get(NAME_PROP)))
Expand Down Expand Up @@ -89,7 +93,9 @@ public List<CgmesBusbarSection> getBusbarSectionsByEquipmentContainer(String con
" OPTIONAL { ?BusbarSection cim:IdentifiedObject.name ?name }\n" +
" FILTER (str(?EquipmentContainer) = \"http://default-cgmes-model/#" + containerId + "\") " +
END_QUERY).stream()
.map(bag -> new CgmesBusbarSection(bag.getId(BUSBARSECTION_PROP), bag.get(NAME_PROP)))
.map(bag -> new CgmesBusbarSection(
bag.getId(BUSBARSECTION_PROP),
bag.get(NAME_PROP)))
.collect(Collectors.toList());
}

Expand All @@ -108,7 +114,9 @@ public List<CgmesBay> getBaysByVoltageLevel(String voltageLevelId) {
" OPTIONAL { ?Bay cim:IdentifiedObject.name ?name }\n" +
" FILTER (str(?VoltageLevel) = \"http://default-cgmes-model/#" + voltageLevelId + "\") " +
END_QUERY).stream()
.map(bag -> new CgmesBay(bag.getId(BAY_PROP), bag.get(NAME_PROP)))
.map(bag -> new CgmesBay(
bag.getId(BAY_PROP),
bag.get(NAME_PROP)))
.collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ void getSubstations_WhenCalled_ThenPropertyBagsIsConvertedToCgmesSubstation() {
bag.put(NAME_PROP, substationName);
bags.add(bag);

when(cgmesModel.substations()).thenReturn(bags);
var tripleStore = mock(TripleStore.class);
when(cgmesModel.tripleStore()).thenReturn(tripleStore);
when(tripleStore.query(anyString())).thenReturn(bags);

var result = context.getSubstations();
assertNotNull(result);
Expand Down

0 comments on commit 270c7c6

Please sign in to comment.