@enervance/insight-cim-model 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/westnetz-neplan/neplan-load.config.js +0 -1
- package/dist/config/westnetz-neplan/neplan-load.config.js.map +1 -1
- package/dist/constants/cim-class-definition.js +6 -0
- package/dist/constants/cim-class-definition.js.map +1 -1
- package/dist/constants/cim-class-names.d.ts +6 -0
- package/dist/constants/cim-class-names.js +6 -0
- package/dist/constants/cim-class-names.js.map +1 -1
- package/dist/converter/integral7/ConverterIntegral7.d.ts +17 -4
- package/dist/converter/integral7/ConverterIntegral7.js +530 -39
- package/dist/converter/integral7/ConverterIntegral7.js.map +1 -1
- package/dist/converter/integral7/config/db-config.d.ts +3 -1
- package/dist/converter/integral7/model/integral/Hgueleitung.d.ts +9 -0
- package/dist/converter/integral7/model/integral/Hgueleitung.js +3 -0
- package/dist/converter/integral7/model/integral/Hgueleitung.js.map +1 -0
- package/dist/converter/integral7/model/integral/Kopfstation.d.ts +31 -0
- package/dist/converter/integral7/model/integral/Kopfstation.js +3 -0
- package/dist/converter/integral7/model/integral/Kopfstation.js.map +1 -0
- package/dist/converter/integral7/model/interfaces.d.ts +8 -0
- package/dist/converter/integral7/sql/integral.sql.d.ts +8 -0
- package/dist/converter/integral7/sql/integral.sql.js +22 -1
- package/dist/converter/integral7/sql/integral.sql.js.map +1 -1
- package/dist/converter/integral7/utils.d.ts +4 -1
- package/dist/converter/integral7/utils.js +26 -8
- package/dist/converter/integral7/utils.js.map +1 -1
- package/dist/etl-neplan/etl-neplan-contingency-analysis.js +22 -7
- package/dist/etl-neplan/etl-neplan-contingency-analysis.js.map +1 -1
- package/dist/etl-neplan/etl-neplan-feederline.d.ts +3 -1
- package/dist/etl-neplan/etl-neplan-feederline.js +73 -15
- package/dist/etl-neplan/etl-neplan-feederline.js.map +1 -1
- package/dist/etl-neplan/etl-neplan.js.map +1 -1
- package/dist/etl-neplan/neplan-contingency-analysis.d.ts +14 -0
- package/dist/etl-neplan/neplan-contingency-analysis.js +337 -0
- package/dist/etl-neplan/neplan-contingency-analysis.js.map +1 -0
- package/dist/graph/Types.d.ts +5 -0
- package/dist/graph/Types.js +10 -0
- package/dist/graph/Types.js.map +1 -0
- package/dist/graph/connections/connection.d.ts +11 -0
- package/dist/graph/connections/connection.js +17 -0
- package/dist/graph/connections/connection.js.map +1 -0
- package/dist/graph/edges/edge.d.ts +8 -0
- package/dist/graph/edges/edge.js +16 -0
- package/dist/graph/edges/edge.js.map +1 -0
- package/dist/graph/graph-interfaces.d.ts +15 -0
- package/dist/graph/graph-interfaces.js +3 -0
- package/dist/graph/graph-interfaces.js.map +1 -0
- package/dist/graph/graph-util.d.ts +13 -0
- package/dist/graph/graph-util.js +114 -0
- package/dist/graph/graph-util.js.map +1 -0
- package/dist/graph/graph.d.ts +15 -0
- package/dist/graph/graph.js +75 -0
- package/dist/graph/graph.js.map +1 -0
- package/dist/graph/nodes/node.d.ts +14 -0
- package/dist/graph/nodes/node.js +28 -0
- package/dist/graph/nodes/node.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/model/core/ACDCTerminal.js +2 -2
- package/dist/model/core/ACDCTerminal.js.map +1 -1
- package/dist/model/core/ConnectivityNode.js +3 -2
- package/dist/model/core/ConnectivityNode.js.map +1 -1
- package/dist/model/core/PSRType.d.ts +0 -1
- package/dist/model/core/PSRType.js +3 -6
- package/dist/model/core/PSRType.js.map +1 -1
- package/dist/model/core/PowerSystemResource.js +3 -8
- package/dist/model/core/PowerSystemResource.js.map +1 -1
- package/dist/model/core/Substation.d.ts +3 -0
- package/dist/model/core/Substation.js +4 -0
- package/dist/model/core/Substation.js.map +1 -1
- package/dist/model/core/Terminal.d.ts +2 -0
- package/dist/model/core/Terminal.js +2 -2
- package/dist/model/core/Terminal.js.map +1 -1
- package/dist/model/core/VoltageLevel.js +0 -1
- package/dist/model/core/VoltageLevel.js.map +1 -1
- package/dist/model/dc/ACDCConverter.d.ts +23 -0
- package/dist/model/dc/ACDCConverter.js +33 -0
- package/dist/model/dc/ACDCConverter.js.map +1 -0
- package/dist/model/dc/ACDCConverterDCTerminal.d.ts +13 -0
- package/dist/model/dc/ACDCConverterDCTerminal.js +54 -0
- package/dist/model/dc/ACDCConverterDCTerminal.js.map +1 -0
- package/dist/model/dc/CsConverter.d.ts +21 -0
- package/dist/model/dc/CsConverter.js +43 -0
- package/dist/model/dc/CsConverter.js.map +1 -0
- package/dist/model/dc/CsOperatingModeKind.d.ts +4 -0
- package/dist/model/dc/CsOperatingModeKind.js +9 -0
- package/dist/model/dc/CsOperatingModeKind.js.map +1 -0
- package/dist/model/dc/CsPpccControlKind.d.ts +5 -0
- package/dist/model/dc/CsPpccControlKind.js +10 -0
- package/dist/model/dc/CsPpccControlKind.js.map +1 -0
- package/dist/model/dc/DCBaseTerminal.d.ts +8 -0
- package/dist/model/dc/DCBaseTerminal.js +30 -0
- package/dist/model/dc/DCBaseTerminal.js.map +1 -0
- package/dist/model/dc/DCConductingEquipment.d.ts +5 -0
- package/dist/model/dc/DCConductingEquipment.js +12 -0
- package/dist/model/dc/DCConductingEquipment.js.map +1 -0
- package/dist/model/dc/DCConverterOperatingModeKind.d.ts +5 -0
- package/dist/model/dc/DCConverterOperatingModeKind.js +10 -0
- package/dist/model/dc/DCConverterOperatingModeKind.js.map +1 -0
- package/dist/model/dc/DCConverterUnit.d.ts +14 -0
- package/dist/model/dc/DCConverterUnit.js +54 -0
- package/dist/model/dc/DCConverterUnit.js.map +1 -0
- package/dist/model/dc/DCEquipmentContainer.d.ts +5 -0
- package/dist/model/dc/DCEquipmentContainer.js +12 -0
- package/dist/model/dc/DCEquipmentContainer.js.map +1 -0
- package/dist/model/dc/DCLine.d.ts +11 -0
- package/dist/model/dc/DCLine.js +48 -0
- package/dist/model/dc/DCLine.js.map +1 -0
- package/dist/model/dc/DCLineSegment.d.ts +13 -0
- package/dist/model/dc/DCLineSegment.js +69 -0
- package/dist/model/dc/DCLineSegment.js.map +1 -0
- package/dist/model/dc/DCNode.d.ts +12 -0
- package/dist/model/dc/DCNode.js +41 -0
- package/dist/model/dc/DCNode.js.map +1 -0
- package/dist/model/dc/DCPolarityKind.d.ts +5 -0
- package/dist/model/dc/DCPolarityKind.js +10 -0
- package/dist/model/dc/DCPolarityKind.js.map +1 -0
- package/dist/model/dc/DCTerminal.d.ts +10 -0
- package/dist/model/dc/DCTerminal.js +38 -0
- package/dist/model/dc/DCTerminal.js.map +1 -0
- package/dist/model/dc/VsConverter.d.ts +18 -0
- package/dist/model/dc/VsConverter.js +33 -0
- package/dist/model/dc/VsConverter.js.map +1 -0
- package/dist/model/dc/VsPpccControlKind.d.ts +7 -0
- package/dist/model/dc/VsPpccControlKind.js +12 -0
- package/dist/model/dc/VsPpccControlKind.js.map +1 -0
- package/dist/model/dc/VsQpccControlKind.d.ts +5 -0
- package/dist/model/dc/VsQpccControlKind.js +10 -0
- package/dist/model/dc/VsQpccControlKind.js.map +1 -0
- package/dist/model/domain/UnitMultiplier.js.map +1 -1
- package/dist/model/extensions/amprion/model/AmprionModell.d.ts +25 -0
- package/dist/model/extensions/amprion/model/AmprionModell.js +64 -0
- package/dist/model/extensions/amprion/model/AmprionModell.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.d.ts +34 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js +134 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.d.ts +17 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js +77 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.d.ts +14 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js +57 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProject.d.ts +7 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProject.js +17 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProject.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.d.ts +19 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js +74 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.d.ts +15 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js +26 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.d.ts +5 -0
- package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js +10 -0
- package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js.map +1 -0
- package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.d.ts +9 -0
- package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js +46 -0
- package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js.map +1 -0
- package/dist/model/extensions/enervance/operations/EVTerminalAction.js.map +1 -1
- package/dist/model/extensions/neplan-westnetz/assets/WNFacility.js.map +1 -1
- package/dist/model/generation/WindGeneratingUnit.d.ts +5 -0
- package/dist/model/generation/WindGeneratingUnit.js +66 -0
- package/dist/model/generation/WindGeneratingUnit.js.map +1 -1
- package/dist/model/model/Model.d.ts +39 -1
- package/dist/model/model/Model.js +91 -1
- package/dist/model/model/Model.js.map +1 -1
- package/dist/model/wires/ACLineSegment.d.ts +1 -0
- package/dist/model/wires/ACLineSegment.js +15 -2
- package/dist/model/wires/ACLineSegment.js.map +1 -1
- package/dist/model/wires/AsynchronousMachine.d.ts +1 -0
- package/dist/model/wires/AsynchronousMachine.js +37 -1
- package/dist/model/wires/AsynchronousMachine.js.map +1 -1
- package/dist/model/wires/Disconnector.js +1 -1
- package/dist/model/wires/EnergySource.d.ts +2 -0
- package/dist/model/wires/EnergySource.js +28 -2
- package/dist/model/wires/EnergySource.js.map +1 -1
- package/dist/model/wires/SeriesCompensator.d.ts +18 -2
- package/dist/model/wires/SeriesCompensator.js +108 -5
- package/dist/model/wires/SeriesCompensator.js.map +1 -1
- package/dist/util/util-create.js.map +1 -1
- package/dist/util/util-topology.d.ts +2 -2
- package/dist/util/util-topology.js +14 -6
- package/dist/util/util-topology.js.map +1 -1
- package/package.json +1 -1
- package/src/config/westnetz-neplan/neplan-load.config.ts +1 -1
- package/src/constants/cim-class-definition.ts +20 -1
- package/src/constants/cim-class-names.ts +9 -0
- package/src/converter/integral7/ConverterIntegral7.ts +753 -345
- package/src/converter/integral7/config/db-config.ts +3 -2
- package/src/converter/integral7/model/integral/Hgueleitung.ts +12 -0
- package/src/converter/integral7/model/integral/Kopfstation.ts +46 -0
- package/src/converter/integral7/model/interfaces.ts +23 -16
- package/src/converter/integral7/sql/integral.sql.ts +27 -1
- package/src/converter/integral7/utils.ts +43 -11
- package/src/etl-neplan/etl-neplan-contingency-analysis.ts +30 -12
- package/src/etl-neplan/etl-neplan-feederline.ts +100 -17
- package/src/etl-neplan/etl-neplan.ts +1 -0
- package/src/etl-neplan/neplan-contingency-analysis.ts +572 -0
- package/src/graph/Types.ts +7 -0
- package/src/graph/connections/connection.ts +29 -0
- package/src/graph/edges/edge.ts +27 -0
- package/src/graph/graph-interfaces.ts +21 -0
- package/src/graph/graph-util.ts +158 -0
- package/src/graph/graph.ts +84 -0
- package/src/graph/nodes/node.ts +43 -0
- package/src/index.ts +8 -0
- package/src/model/core/ACDCTerminal.ts +2 -2
- package/src/model/core/ConnectivityNode.ts +2 -2
- package/src/model/core/PSRType.ts +3 -6
- package/src/model/core/PowerSystemResource.ts +3 -7
- package/src/model/core/Substation.ts +6 -0
- package/src/model/core/Terminal.ts +15 -6
- package/src/model/core/VoltageLevel.ts +0 -1
- package/src/model/dc/ACDCConverter.ts +66 -0
- package/src/model/dc/ACDCConverterDCTerminal.ts +64 -0
- package/src/model/dc/CsConverter.ts +68 -0
- package/src/model/dc/CsOperatingModeKind.ts +4 -0
- package/src/model/dc/CsPpccControlKind.ts +5 -0
- package/src/model/dc/DCBaseTerminal.ts +30 -0
- package/src/model/dc/DCConductingEquipment.ts +8 -0
- package/src/model/dc/DCConverterOperatingModeKind.ts +6 -0
- package/src/model/dc/DCConverterUnit.ts +60 -0
- package/src/model/dc/DCEquipmentContainer.ts +8 -0
- package/src/model/dc/DCLine.ts +56 -0
- package/src/model/dc/DCLineSegment.ts +81 -0
- package/src/model/dc/DCNode.ts +49 -0
- package/src/model/dc/DCPolarityKind.ts +5 -0
- package/src/model/dc/DCTerminal.ts +45 -0
- package/src/model/dc/VsConverter.ts +48 -0
- package/src/model/dc/VsPpccControlKind.ts +7 -0
- package/src/model/dc/VsQpccControlKind.ts +5 -0
- package/src/model/domain/UnitMultiplier.ts +12 -12
- package/src/model/equivalents/EquivalentBranch.ts +10 -10
- package/src/model/extensions/amprion/model/AmprionModell.ts +92 -0
- package/src/model/extensions/amprion/project/AMPRIONConstructionProject.ts +174 -0
- package/src/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.ts +89 -0
- package/src/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.ts +64 -0
- package/src/model/extensions/amprion/project/AMPRIONErpProject.ts +21 -0
- package/src/model/extensions/amprion/project/AMPRIONErpProjectPhase.ts +89 -0
- package/src/model/extensions/amprion/project/AMPRIONErpProjectStructure.ts +36 -0
- package/src/model/extensions/amprion/project/AMPRIONProjectPriorityKind.ts +5 -0
- package/src/model/extensions/amprion/wires/AMPRIONSeriesCompensator.ts +53 -0
- package/src/model/extensions/enervance/core/EVTerminal.ts +1 -1
- package/src/model/extensions/enervance/operations/EVTerminalAction.ts +0 -1
- package/src/model/extensions/neplan-westnetz/assets/WNFacility.ts +0 -1
- package/src/model/generation/WindGeneratingUnit.ts +73 -0
- package/src/model/model/Model.ts +131 -7
- package/src/model/wires/ACLineSegment.ts +244 -228
- package/src/model/wires/AsynchronousMachine.ts +38 -1
- package/src/model/wires/Disconnector.ts +1 -1
- package/src/model/wires/EnergySource.ts +256 -222
- package/src/model/wires/SeriesCompensator.ts +145 -19
- package/src/util/util-create.ts +2 -0
- package/src/util/util-topology.ts +18 -7
- package/test/apache-jena-fuseki-interface/{apache-jena-fuseki-neplan.tests.spec.ts → apache-jena-fuseki-neplan-1.tests.sp-ec.ts} +0 -26
- package/test/apache-jena-fuseki-interface/apache-jena-fuseki-neplan-2.tests.spec.ts +255 -0
- package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_EQ_V1.xml +20867 -0
- package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_SSH_V1.xml +3784 -0
- package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_EQ_V1.xml +42546 -0
- package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SSH_V1.xml +10101 -0
- package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SV_V1.xml +6229 -0
- package/test/integral7-converter/integral7-converter.tests.spec.ts +12 -3
- package/test/power-system-data-model-converter/power-system-data-model-converter.tests.spec.ts +1 -1
- package/test/apache-jena-fuseki-interface/data/apache-jena-fuseki-3.12.0/run/system/tdb.lock +0 -1
|
@@ -1,12 +1,59 @@
|
|
|
1
1
|
import { ConductingEquipment } from "../core/ConductingEquipment";
|
|
2
|
+
import { Model } from '../model/Model';
|
|
3
|
+
import { getValue, writeElement, writeElementAttribute } from '../../util/utils';
|
|
4
|
+
import { toBoolean } from '../../util/datatype-converter';
|
|
5
|
+
import { RDF_XML } from '../../constants/rdf-xml';
|
|
6
|
+
import XMLWriter from 'xml-writer';
|
|
2
7
|
|
|
3
|
-
export class SeriesCompensator extends ConductingEquipment{
|
|
8
|
+
export class SeriesCompensator extends ConductingEquipment {
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
r: number; // Pflichtattr
|
|
11
|
+
x: number; // Pflichtattr
|
|
12
|
+
r0: number; // Pflichtattr
|
|
13
|
+
x0: number; // Pflichtattr
|
|
14
|
+
|
|
15
|
+
varistorPresent: boolean;
|
|
16
|
+
varistorRatedCurrent: number; // CurrentFlow Pflichtattr
|
|
17
|
+
varistorVoltageThreshold: number; // Voltage Pflichtattr
|
|
18
|
+
|
|
19
|
+
constructor(uuid?: string, name?: string, shortName?: string, description?: string) {
|
|
20
|
+
super(uuid, name, shortName, description);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
public static resolveClassFusekiJSON(data: any, cimModel: Model){
|
|
25
|
+
data.results.bindings.forEach((value: any) => {
|
|
26
|
+
const seriesCompensator = new SeriesCompensator();
|
|
27
|
+
seriesCompensator.resolveAttributesFusekiJSON(value);
|
|
28
|
+
cimModel.addSeriesCompensator(seriesCompensator);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected resolveAttributesFusekiJSON(value: any){
|
|
33
|
+
super.resolveAttributesFusekiJSON(value);
|
|
34
|
+
this.r = +getValue(value, 'r');
|
|
35
|
+
this.x = +getValue(value, 'x');
|
|
36
|
+
this.r0 = +getValue(value, 'r0');
|
|
37
|
+
this.x0 = +getValue(value, 'x0');
|
|
38
|
+
|
|
39
|
+
this.varistorPresent = toBoolean(getValue(value, 'varistorPresent'));
|
|
40
|
+
this.varistorRatedCurrent = +getValue(value, 'varistorRatedCurrent');
|
|
41
|
+
this.varistorVoltageThreshold = +getValue(value, 'varistorVoltageThreshold');
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public resolveParsedAssociations(cimModel: Model){
|
|
46
|
+
super.resolveParsedAssociations(cimModel);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public static getQuerySPARQL(graphURI: string): string {
|
|
50
|
+
if (graphURI.length > 0) {
|
|
51
|
+
return SeriesCompensator.sparqlQuery.replace('<http://default/>', graphURI);
|
|
7
52
|
}
|
|
53
|
+
return SeriesCompensator.sparqlQuery;
|
|
54
|
+
}
|
|
8
55
|
|
|
9
|
-
|
|
56
|
+
public static sparqlQuery: string = `
|
|
10
57
|
PREFIX cim: <http://iec.ch/TC57/2013/CIM-schema-cim16#>
|
|
11
58
|
PREFIX enervance: <http://enervance.com/CIM/Extensions#>
|
|
12
59
|
PREFIX entsoe: <http://entsoe.eu/CIM/SchemaExtension/3/1#>
|
|
@@ -15,26 +62,105 @@ export class SeriesCompensator extends ConductingEquipment{
|
|
|
15
62
|
PREFIX apf: <http://jena.hpl.hp.com/ARQ/property#>
|
|
16
63
|
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
|
17
64
|
|
|
18
|
-
SELECT (strafter(strafter(str(?
|
|
19
|
-
|
|
65
|
+
SELECT (strafter(strafter(str(?MRID), "#"), "_") AS ?uuid)
|
|
66
|
+
?name shortName description r x r0 x0 varistorPresent varistorRatedCurrent varistorVoltageThreshold
|
|
67
|
+
(strafter(strafter(str(?bvUUID), '#'), '_') AS ?baseVoltageUUID)
|
|
68
|
+
(strafter(strafter(str(?ptUUID), '#'), '_') AS ?psrTypeUUID)
|
|
69
|
+
(strafter(strafter(str(?ecUUID), '#'), '_') AS ?equipmentContainerUUID)
|
|
20
70
|
WHERE {
|
|
21
71
|
GRAPH <http://default/>{
|
|
22
|
-
?
|
|
23
|
-
?
|
|
72
|
+
?MRID rdf:type cim:SeriesCompensator .
|
|
73
|
+
OPTIONAL{?MRID cim:IdentifiedObject.name ?name .}
|
|
74
|
+
OPTIONAL{?MRID entsoe:IdentifiedObject.shortName ?shortName .}
|
|
75
|
+
OPTIONAL{?MRID cim:IdentifiedObject.description ?description .}
|
|
76
|
+
OPTIONAL{?MRID cim:Equipment.aggregate ?aggregate .}
|
|
77
|
+
OPTIONAL{?MRID cim:SeriesCompensator.r ?r .}
|
|
78
|
+
OPTIONAL{?MRID cim:SeriesCompensator.x ?x .}
|
|
79
|
+
OPTIONAL{?MRID cim:SeriesCompensator.r0 ?r0 .}
|
|
80
|
+
OPTIONAL{?MRID cim:SeriesCompensator.x0 ?x0 .}
|
|
81
|
+
|
|
82
|
+
OPTIONAL{?MRID cim:SeriesCompensator.varistorPresent ?varistorPresent .}
|
|
83
|
+
OPTIONAL{?MRID cim:SeriesCompensator.varistorRatedCurrent ?varistorRatedCurrent
|
|
84
|
+
OPTIONAL{?MRID cim:SeriesCompensator.varistorVoltageThreshold ?varistorVoltageThreshold .}
|
|
85
|
+
|
|
86
|
+
OPTIONAL{?MRID cim:PowerSystemResource.PSRType ?ptUUID .}
|
|
87
|
+
OPTIONAL{?MRID cim:ConductingEquipment.BaseVoltage ?bvUUID .}
|
|
88
|
+
OPTIONAL{?MRID cim:Equipment.EquipmentContainer ?ecUUID .}
|
|
24
89
|
}
|
|
25
90
|
}
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
91
|
+
`
|
|
92
|
+
|
|
93
|
+
public breadthFirstSearch(networkElements: any[]) {
|
|
94
|
+
if (!this.visited) {
|
|
95
|
+
this.addNetworkElement(networkElements);
|
|
96
|
+
super.breadthFirstSearch(networkElements);
|
|
32
97
|
}
|
|
98
|
+
}
|
|
33
99
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
100
|
+
/** CIM RDF/XML Serialisierung */
|
|
101
|
+
public toCIMXML(xmlWriter: XMLWriter, profile: string) {
|
|
102
|
+
let defaultValues = '';
|
|
103
|
+
this.checkMandatoryAttributes(profile, defaultValues);
|
|
104
|
+
this.description += defaultValues;
|
|
105
|
+
if(profile === RDF_XML.PROFILE_EQ) {
|
|
106
|
+
const suffixID = this.getSuffixID(profile);
|
|
107
|
+
const prefixUUID = this.getPrefixUUID(suffixID);
|
|
108
|
+
xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
|
|
109
|
+
writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
|
|
110
|
+
this.toCIMXMLAttributes(xmlWriter, profile);
|
|
111
|
+
this.toCIMXMLAssociations(xmlWriter, profile);
|
|
112
|
+
xmlWriter.endElement();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
|
|
117
|
+
super.toCIMXMLAttributes(xmlWriter, profile);
|
|
118
|
+
if(profile === RDF_XML.PROFILE_EQ) {
|
|
119
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.r`, this.r);
|
|
120
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.x`, this.x);
|
|
121
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.r0`, this.r0);
|
|
122
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.x0`, this.x0);
|
|
123
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.varistorPresent`, this.varistorPresent);
|
|
124
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.varistorRatedCurrent`, this.varistorRatedCurrent);
|
|
125
|
+
writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:SeriesCompensator.varistorVoltageThreshold`, this.varistorVoltageThreshold);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
|
|
130
|
+
super.toCIMXMLAssociations(xmlWriter, profile);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
checkMandatoryAttributes(profile: string, defaultValues: string) {
|
|
134
|
+
super.checkMandatoryAttributes(profile, defaultValues);
|
|
135
|
+
if (profile === RDF_XML.PROFILE_EQ) {
|
|
136
|
+
if (!this.r) {
|
|
137
|
+
this.r = 0;
|
|
138
|
+
defaultValues += 'r,'
|
|
139
|
+
}
|
|
140
|
+
if (!this.x) {
|
|
141
|
+
this.x = 0.1;
|
|
142
|
+
defaultValues += 'x,'
|
|
143
|
+
}
|
|
144
|
+
if (!this.r0) {
|
|
145
|
+
this.r0 = 0;
|
|
146
|
+
defaultValues += 'r0,'
|
|
147
|
+
}
|
|
148
|
+
if (!this.x0) {
|
|
149
|
+
this.x0 = 0.1;
|
|
150
|
+
defaultValues += 'x0,'
|
|
151
|
+
}
|
|
152
|
+
if (!this.varistorPresent) {
|
|
153
|
+
this.varistorPresent = false;
|
|
154
|
+
defaultValues += 'varistorPresent,'
|
|
155
|
+
}
|
|
156
|
+
if (!this.varistorRatedCurrent) {
|
|
157
|
+
this.varistorRatedCurrent = 100;
|
|
158
|
+
defaultValues += 'varistorRatedCurrent,'
|
|
159
|
+
}
|
|
160
|
+
if (!this.varistorVoltageThreshold) {
|
|
161
|
+
this.varistorVoltageThreshold = 0;
|
|
162
|
+
defaultValues += 'varistorVoltageThreshold,'
|
|
163
|
+
}
|
|
39
164
|
}
|
|
165
|
+
}
|
|
40
166
|
}
|
package/src/util/util-create.ts
CHANGED
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
|
|
11
11
|
} from '..';
|
|
12
12
|
import { getUUID } from './utils';
|
|
13
|
+
import { convertValue } from './datatype-converter';
|
|
14
|
+
|
|
13
15
|
|
|
14
16
|
export function createGeoregion(uuid: string, name: string, shortName: string, description: string, cimModel: Model): GeographicalRegion {
|
|
15
17
|
const region = new GeographicalRegion(getUUID(uuid), name, shortName, description);
|
|
@@ -8,6 +8,7 @@ import { ExternalNetworkInjection } from '../model/wires/ExternalNetworkInjectio
|
|
|
8
8
|
import { ACLineSegment } from '../model/wires/ACLineSegment';
|
|
9
9
|
import { PowerTransformer } from '../model/wires/PowerTransformer';
|
|
10
10
|
import { Switch } from '../model/wires/Switch';
|
|
11
|
+
import { isInArray } from './utils';
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
/** bestimmt alle elektrisch zusammenhängende Knoten/Nodes in eimen Teilnetz.
|
|
@@ -48,7 +49,7 @@ export function determineNetworksSlackElements(cimModel: Model, networks: IIdent
|
|
|
48
49
|
|
|
49
50
|
for (let i = 0; i < networks.length; i++) {
|
|
50
51
|
const network: IIdentifiedObject[] = networks[i];
|
|
51
|
-
const networkSlackElemenets: IIdentifiedObject[][] = determineNetworkSlackElements(cimModel, network);
|
|
52
|
+
const networkSlackElemenets: IIdentifiedObject[][] = determineNetworkSlackElements(cimModel, network, 'ExternalNetworkInjection');
|
|
52
53
|
for(const arraySlackElem of networkSlackElemenets) {
|
|
53
54
|
networksSlackElements.push(arraySlackElem);
|
|
54
55
|
}
|
|
@@ -58,13 +59,13 @@ export function determineNetworksSlackElements(cimModel: Model, networks: IIdent
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
/** Es werden Netzelemente bestimmt, die im übergebenen Netz mit dem Slack direkt verbunden sind. */
|
|
61
|
-
export function determineNetworkSlackElements(cimModel: Model, network: IIdentifiedObject[]): IIdentifiedObject[][] {
|
|
62
|
+
export function determineNetworkSlackElements(cimModel: Model, network: IIdentifiedObject[], startObjectName: string): IIdentifiedObject[][] {
|
|
62
63
|
|
|
63
64
|
const networkSlackElemenets: IIdentifiedObject[][] = [];
|
|
64
65
|
for (let i = 0; i < network.length; i++) {
|
|
65
66
|
const networkElement = network[i];
|
|
66
67
|
// Slack-Element bestimmen
|
|
67
|
-
if (networkElement.constructor.name ===
|
|
68
|
+
if (networkElement.constructor.name === startObjectName) {
|
|
68
69
|
if(!networkElement.visited) {
|
|
69
70
|
const slackElemenets: IIdentifiedObject[] = [];
|
|
70
71
|
networkElement.determineSlackNodes(slackElemenets);
|
|
@@ -77,7 +78,7 @@ export function determineNetworkSlackElements(cimModel: Model, network: IIdentif
|
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
/** Kruecke für NEPLAN-Netze. Bestimme Umspannstationen, die als Anlagen modelliert sind. */
|
|
80
|
-
export function determineSubstations(cimModel: Model): IIdentifiedObject[] {
|
|
81
|
+
export function determineSubstations(cimModel: Model, computableGridsSlackElements: IIdentifiedObject[][]): IIdentifiedObject[] {
|
|
81
82
|
const substationElements: IIdentifiedObject[] = [];
|
|
82
83
|
|
|
83
84
|
for (const vl of cimModel.voltageLevels.values()) {
|
|
@@ -90,13 +91,23 @@ export function determineSubstations(cimModel: Model): IIdentifiedObject[] {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
if(counter > 9) {
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
/** In Neplan Netzen umfasst ein VoltageLevel alle elektrisch verbundene Elemente.
|
|
95
|
+
* Dieses Vorgehen bestimmt alle Elemente, die zur gegebenen Spannung gehören => eine Anlage */
|
|
96
|
+
|
|
97
|
+
const networkSlackElemenets: IIdentifiedObject[][] = determineNetworkSlackElements(cimModel, vl.equipments, 'BusbarSection');
|
|
98
|
+
for(const arraySlackNetz of networkSlackElemenets) {
|
|
99
|
+
for (const arraySlackElem of arraySlackNetz) {
|
|
100
|
+
if(!isInArray(arraySlackElem, computableGridsSlackElements)) {
|
|
101
|
+
substationElements.push(arraySlackElem);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
95
105
|
}
|
|
96
106
|
}
|
|
97
|
-
|
|
107
|
+
resetMapCIM(cimModel.objects);
|
|
98
108
|
return substationElements;
|
|
99
109
|
}
|
|
110
|
+
|
|
100
111
|
//Prüft, ob das Netz rechenfähig ist.
|
|
101
112
|
export function isComputable(network: IIdentifiedObject[]): boolean{
|
|
102
113
|
if(isGeneratorsExists(network)){
|
|
@@ -792,32 +792,6 @@ describe('Apache Jena Fuseki Interface Neplan Test', () => {
|
|
|
792
792
|
|
|
793
793
|
});
|
|
794
794
|
|
|
795
|
-
/* it('Apache Jena Fuseki Interface RegExTest', async(done) => {
|
|
796
|
-
cimModel.purgeData();
|
|
797
|
-
|
|
798
|
-
const regexTrafo = /-T\d*!/;
|
|
799
|
-
// exec return mathed string
|
|
800
|
-
const keyA = '05154032-S-K-ST-00442-VB';
|
|
801
|
-
const keyB = '05154032-S-K-ST-00442-T';
|
|
802
|
-
const keyC = '05154032-S-K-ST-00443-T1';
|
|
803
|
-
const keyD = '05154032-S-K-ST-00442-T2';
|
|
804
|
-
const keyE = '05154032-S-K-ST-00442-T3';
|
|
805
|
-
|
|
806
|
-
expect(regexTrafo.test(keyA)).toBeFalse();
|
|
807
|
-
expect(regexTrafo.test(keyB)).toBeTrue()
|
|
808
|
-
expect(regexTrafo.test(keyC)).toBeTrue();
|
|
809
|
-
expect(regexTrafo.test(keyD)).toBeTrue();
|
|
810
|
-
expect(regexTrafo.test(keyE)).toBeTrue();
|
|
811
|
-
|
|
812
|
-
//[ '-T', index: 21, input: '05154032-S-K-ST-00442-T', groups: undefined ]
|
|
813
|
-
/!* expect(regexTrafo.exec(keyB)).toBe('-T')
|
|
814
|
-
expect(regexTrafo.exec(keyC)[0]).toBe('-T1')
|
|
815
|
-
expect(regexTrafo.exec(keyD)[0]).toBe('-T2')
|
|
816
|
-
expect(regexTrafo.exec(keyE)[0]).toBe('-T3')*!/
|
|
817
|
-
|
|
818
|
-
done();
|
|
819
|
-
});*/
|
|
820
|
-
|
|
821
795
|
afterAll(async (done) => {
|
|
822
796
|
|
|
823
797
|
await fetch(fusekiURI, {
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import * as fetch from 'node-fetch';
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
import * as childProcess from 'child_process';
|
|
5
|
+
import {
|
|
6
|
+
ACLineSegment,
|
|
7
|
+
addNeplanFacilities,
|
|
8
|
+
CIM_CLASS_NAMES,
|
|
9
|
+
EVTerminal,
|
|
10
|
+
EVTerminalAction,
|
|
11
|
+
FUSEKI_LOAD_CONFIG_NEPLAN, generateUUID, getActivityRecordEventByTypeName,
|
|
12
|
+
getClassDefinitionMap,
|
|
13
|
+
getEnergyConsumerByName,
|
|
14
|
+
getObjectByProperty,
|
|
15
|
+
IConnectivityNode,
|
|
16
|
+
Model, PROPERTY_HANDLER_WESTNETZNEPLAN_CONFIG,
|
|
17
|
+
SwitchActionKind,
|
|
18
|
+
SwitchingPlan,
|
|
19
|
+
transformEnergyConsumers,
|
|
20
|
+
WNConnectivityNode, WNFacility,
|
|
21
|
+
WNFaultConnectivityNode,
|
|
22
|
+
WNFeeder
|
|
23
|
+
} from "../../src";
|
|
24
|
+
import { loadFusekiData, parseFusekiData } from '../../src/etl-neplan/etl-neplan';
|
|
25
|
+
import { postNodeFetchData } from '../../src/util/utils';
|
|
26
|
+
import { createFeederLines } from '../../src/etl-neplan/etl-neplan-feederline';
|
|
27
|
+
import { performContingencyAnalysis } from '../../src/etl-neplan/etl-neplan-contingency-analysis';
|
|
28
|
+
import { WNOutage } from '../../src/model/extensions/neplan-westnetz/operations/WNOutage';
|
|
29
|
+
import { WNEnergyConsumer } from '../../src/model/extensions/neplan-westnetz/wires/WNEnergyConsumer';
|
|
30
|
+
import { determineSubstations } from '../../src/util/util-topology';
|
|
31
|
+
import { performContingencyAnalysisV2 } from '../../src/etl-neplan/neplan-contingency-analysis';
|
|
32
|
+
|
|
33
|
+
describe('Apache Jena Fuseki Interface Neplan Test', () => {
|
|
34
|
+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2147483633;
|
|
35
|
+
const FUSEKI_PORT = 3010;
|
|
36
|
+
const FUSEKI_TBD_NAME = 'test';
|
|
37
|
+
|
|
38
|
+
const fusekiURI = `http://127.0.0.1:${FUSEKI_PORT}/${FUSEKI_TBD_NAME}`;
|
|
39
|
+
const graphURL = 'http://test/data';
|
|
40
|
+
const graphURI = `<${graphURL}>`;
|
|
41
|
+
|
|
42
|
+
/** Endpunkt: Aktualisieren der Daten*/
|
|
43
|
+
const fusekiUpdateURI = `${fusekiURI}/update`;
|
|
44
|
+
|
|
45
|
+
/** Endpunkt: Abfrage der Daten*/
|
|
46
|
+
const fusekiQueryURI = `${fusekiURI}/query`;
|
|
47
|
+
|
|
48
|
+
/** Endpunkt: Datenimport */
|
|
49
|
+
const fusekiDataURI = `${fusekiURI}/data`;
|
|
50
|
+
|
|
51
|
+
/** Endpunkt: GraphURI-basierter Datenimport */
|
|
52
|
+
const fusekiGraphDataURI = `${fusekiURI}/data?graph=${graphURL}`;
|
|
53
|
+
|
|
54
|
+
let childRef;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const cimModel = new Model();
|
|
58
|
+
|
|
59
|
+
beforeAll((done) => {
|
|
60
|
+
|
|
61
|
+
childRef = childProcess.spawn('fuseki-server', [`--port=${FUSEKI_PORT}`, '--update'], {
|
|
62
|
+
cwd: process.cwd() + '\\test\\apache-jena-fuseki-interface\\data\\apache-jena-fuseki-3.12.0\\',
|
|
63
|
+
shell: true,
|
|
64
|
+
/*detached: true,*/
|
|
65
|
+
});
|
|
66
|
+
childRef.stdout.on('data', async (code) => {
|
|
67
|
+
/** auf die Ausgabe warten, wenn der Server gestartet ist */
|
|
68
|
+
const consolePrint = code.toString();
|
|
69
|
+
//console.log(consolePrint);
|
|
70
|
+
if (consolePrint.includes('Started') && consolePrint.includes('on port')) {
|
|
71
|
+
console.log('Fuseki started');
|
|
72
|
+
|
|
73
|
+
/** Mit RegEx Zahlen prüfen: nullen und Dezmaltrennzeichen abschneiden */
|
|
74
|
+
/** 0.081510 -> 0.08151, 0. -> 0, 10.00 -> 10*/
|
|
75
|
+
const regexDecimal = /(?:(\.\d*?[1-9]+)|\.)0*(?=<)/gm;
|
|
76
|
+
/** 0e+000 -> 0*/
|
|
77
|
+
const regexZeroScientific = /(>\d+(?=e[+-]0+))e[+-]0+/gm;
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/** load testdata */
|
|
81
|
+
const eq = await fs.readFileSync('test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_EQ_V1.xml', 'utf8');
|
|
82
|
+
const dataDecimalEq = eq.replace(regexDecimal, `$1`);
|
|
83
|
+
const dataAdjustedEq = dataDecimalEq.replace(regexZeroScientific, `$1`);
|
|
84
|
+
|
|
85
|
+
const ssh = await fs.readFileSync('test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_SSH_V1.xml', 'utf8');
|
|
86
|
+
const dataDecimalSSH = ssh.replace(regexDecimal, `$1`);
|
|
87
|
+
const dataAdjustedSSH = dataDecimalSSH.replace(regexZeroScientific, `$1`);
|
|
88
|
+
/** feeder lines */
|
|
89
|
+
/** psrtypes */
|
|
90
|
+
const psrTypes = await fs.readFileSync('test/apache-jena-fuseki-interface/data/xml/PsrType.xml', 'utf8');
|
|
91
|
+
|
|
92
|
+
Promise.all([ postNodeFetchData(fusekiGraphDataURI, 'post', dataAdjustedEq, {'Content-type': 'application/rdf+xml;charset=utf-8'}),
|
|
93
|
+
postNodeFetchData(fusekiGraphDataURI, 'post', dataAdjustedSSH, {'Content-type': 'application/rdf+xml;charset=utf-8'}),
|
|
94
|
+
postNodeFetchData(fusekiGraphDataURI, 'post', psrTypes, {'Content-type': 'application/rdf+xml;charset=utf-8'})
|
|
95
|
+
]).then((values: any[]) => {
|
|
96
|
+
done();
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('Apache Jena Fuseki Interface Neplan ETL add Feeder&SwitchActions', async (done) => {
|
|
103
|
+
cimModel.purgeData();
|
|
104
|
+
/** configure query data */
|
|
105
|
+
const neplanClassDefinitions = getClassDefinitionMap();
|
|
106
|
+
|
|
107
|
+
/** query data */
|
|
108
|
+
let cimFusekiDataRaw = await loadFusekiData(fusekiURI, graphURI, FUSEKI_LOAD_CONFIG_NEPLAN, neplanClassDefinitions);
|
|
109
|
+
/** parse queried data */
|
|
110
|
+
parseFusekiData(cimModel, cimFusekiDataRaw, FUSEKI_LOAD_CONFIG_NEPLAN, neplanClassDefinitions);
|
|
111
|
+
cimModel.resolveParsedAssociations();
|
|
112
|
+
|
|
113
|
+
const defaultSubstation = cimModel.getObjectByName('DefaultSubstation');
|
|
114
|
+
const baseIRI = defaultSubstation.baseIRI;
|
|
115
|
+
|
|
116
|
+
/** Objekte erzeugen */
|
|
117
|
+
const insertObjectSPARQL = createFeederLines(cimModel, baseIRI);
|
|
118
|
+
|
|
119
|
+
console.log('Feeders');
|
|
120
|
+
for (const feeder of cimModel.feeders.values()) {
|
|
121
|
+
const wnFeeder = feeder as WNFeeder;
|
|
122
|
+
console.log('\t' + wnFeeder.name);
|
|
123
|
+
for (const trm of wnFeeder.normalHeadTerminals.values()) {
|
|
124
|
+
console.log('\t\t' + trm.connectivityNode.name + ' - ' + wnFeeder.normalEnergizedConnectivityNodes.size);
|
|
125
|
+
}
|
|
126
|
+
/* for (const cn of wnFeeder.normalEnergizedConnectivityNodes.values()) {
|
|
127
|
+
console.log('\t\t' + cn.name);
|
|
128
|
+
}*/
|
|
129
|
+
}
|
|
130
|
+
const queryCreateFeedersSwitch = `
|
|
131
|
+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
|
132
|
+
PREFIX cim: <http://iec.ch/TC57/2013/CIM-schema-cim16#>
|
|
133
|
+
PREFIX entsoe: <http://entsoe.eu/CIM/SchemaExtension/3/1#>
|
|
134
|
+
PREFIX westnetzneplan: <http://westnetzneplan.de/CIM/Extensions#>
|
|
135
|
+
PREFIX enervance: <http://enervance.com/CIM/Extensions#>
|
|
136
|
+
INSERT DATA{
|
|
137
|
+
GRAPH ${graphURI} {
|
|
138
|
+
${insertObjectSPARQL.join(' ')}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
|
|
143
|
+
await postNodeFetchData(fusekiUpdateURI, 'post', queryCreateFeedersSwitch, {'Content-type': 'application/sparql-update'});
|
|
144
|
+
|
|
145
|
+
expect(defaultSubstation).toBeDefined();
|
|
146
|
+
expect(baseIRI).toBeDefined();
|
|
147
|
+
|
|
148
|
+
// SwitchActions
|
|
149
|
+
// const insertSPARQL = performContingencyAnalysis(cimModel);
|
|
150
|
+
const insertSPARQL = performContingencyAnalysisV2(cimModel);
|
|
151
|
+
const queryCreateSwitchActions = `
|
|
152
|
+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
|
153
|
+
PREFIX cim: <http://iec.ch/TC57/2013/CIM-schema-cim16#>
|
|
154
|
+
PREFIX entsoe: <http://entsoe.eu/CIM/SchemaExtension/3/1#>
|
|
155
|
+
PREFIX westnetzneplan: <http://westnetzneplan.de/CIM/Extensions#>
|
|
156
|
+
PREFIX enervance: <http://enervance.com/CIM/Extensions#>
|
|
157
|
+
INSERT DATA{
|
|
158
|
+
GRAPH ${graphURI} {
|
|
159
|
+
${insertSPARQL.join(' ')}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
await postNodeFetchData(fusekiUpdateURI, 'post', queryCreateSwitchActions, {'Content-type': 'application/sparql-update'});
|
|
164
|
+
cimModel.purgeData();
|
|
165
|
+
|
|
166
|
+
/** query data */
|
|
167
|
+
const cimFusekiDataRawNew = await loadFusekiData(fusekiURI, graphURI, FUSEKI_LOAD_CONFIG_NEPLAN, neplanClassDefinitions);
|
|
168
|
+
/** parse queried data */
|
|
169
|
+
parseFusekiData(cimModel, cimFusekiDataRawNew, FUSEKI_LOAD_CONFIG_NEPLAN, neplanClassDefinitions);
|
|
170
|
+
cimModel.resolveParsedAssociations();
|
|
171
|
+
|
|
172
|
+
expect(cimModel.feeders.size).toBe(10);
|
|
173
|
+
|
|
174
|
+
// Head Terminals
|
|
175
|
+
for (const feeder of cimModel.feeders.values()) {
|
|
176
|
+
/** Jeder Abgang hat mind. eine assozierte Head-Terminal Instanz */
|
|
177
|
+
expect(feeder.normalHeadTerminals.size).toBe(1);
|
|
178
|
+
/** NEPLAN Spezifisch: jeder Abgang hat im Esloh-Netz mind. einen versorgten ConnectivityNode */
|
|
179
|
+
expect((feeder as WNFeeder).normalEnergizedConnectivityNodes.size).toBeGreaterThan(0);
|
|
180
|
+
|
|
181
|
+
// contingency analysis result
|
|
182
|
+
for (const headTerminal of feeder.normalHeadTerminals.values()) {
|
|
183
|
+
/** Der Kopf-Knoten -> Schaltfeld-Ersatz */
|
|
184
|
+
const headCN = headTerminal.connectivityNode as WNConnectivityNode;
|
|
185
|
+
expect(headCN).toBeDefined();
|
|
186
|
+
|
|
187
|
+
/** Schaltfeld-Ersatz-> Ausfall-Simumation */
|
|
188
|
+
const faultCN = headCN.fault;
|
|
189
|
+
expect(faultCN).toBeDefined();
|
|
190
|
+
|
|
191
|
+
/** Netzausfall-Instanz */
|
|
192
|
+
const outage = faultCN.outage as WNOutage;
|
|
193
|
+
expect(outage).toBeDefined();
|
|
194
|
+
|
|
195
|
+
expect(outage.outageIsolationEquipment.size).toBeGreaterThan(0);
|
|
196
|
+
expect(outage.outageIsolationConnectivityNodes.size).toBeGreaterThan(0);
|
|
197
|
+
|
|
198
|
+
expect(outage.switchingPlans.size).toBeGreaterThan(0);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* performContingencyAnalysis(cimModel);
|
|
203
|
+
//CN
|
|
204
|
+
const wnCN = getObjectByProperty(cimModel.connectivityNodes, 'name', '05958016-S-K-ST-00056') as WNConnectivityNode;
|
|
205
|
+
expect(wnCN).toBeDefined();
|
|
206
|
+
expect(wnCN.additionalConnectivityNodeContainer).toBeDefined()*/;
|
|
207
|
+
|
|
208
|
+
done();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
afterAll(async (done) => {
|
|
213
|
+
|
|
214
|
+
await fetch(fusekiURI, {
|
|
215
|
+
method: 'post',
|
|
216
|
+
body: `DROP GRAPH ${graphURI}`,
|
|
217
|
+
headers: {'Content-type': 'application/sparql-update'},
|
|
218
|
+
});
|
|
219
|
+
console.log(`Graph ${graphURI} dropped`);
|
|
220
|
+
console.log('Fuseki childRef PID ' + childRef.pid);
|
|
221
|
+
|
|
222
|
+
const childRefPort = childProcess.spawn(`echo off & (for /f \"tokens=5\" %a in (\'netstat -aon ^| findstr ${FUSEKI_PORT}\') do tasklist /NH /FO \"csv\" /FI \"PID eq %a\") & echo on`, {
|
|
223
|
+
shell: true,
|
|
224
|
+
});
|
|
225
|
+
childRefPort.stdout.on('data', (code) => {
|
|
226
|
+
try {
|
|
227
|
+
const arrayData = code.toString().split(',');
|
|
228
|
+
const appName = arrayData[0];
|
|
229
|
+
const pid = arrayData[1];
|
|
230
|
+
if (appName.includes('java')) {
|
|
231
|
+
const cildRefKill = childProcess.exec(`taskkill /PID ${pid} /F`, (error, stdout, stderr) => {
|
|
232
|
+
});
|
|
233
|
+
cildRefKill.stdout.on('data', (code) => {
|
|
234
|
+
console.log('Kill Fuseki Server');
|
|
235
|
+
console.log(code.toString());
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
} catch (e) {
|
|
239
|
+
} finally {
|
|
240
|
+
//TODO
|
|
241
|
+
}
|
|
242
|
+
done();
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
/** Methode zum Schreiben der Daten in eine Datei */
|
|
249
|
+
export function writeFile(filePath: string, data: any) {
|
|
250
|
+
fs.writeFile(filePath, JSON.stringify(data), function (err) {
|
|
251
|
+
if (err) {
|
|
252
|
+
console.log(err);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|