@enervance/insight-cim-model 0.0.1 → 0.0.3

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.
Files changed (262) hide show
  1. package/dist/config/westnetz-neplan/neplan-load.config.js +0 -1
  2. package/dist/config/westnetz-neplan/neplan-load.config.js.map +1 -1
  3. package/dist/constants/cim-class-definition.js +6 -0
  4. package/dist/constants/cim-class-definition.js.map +1 -1
  5. package/dist/constants/cim-class-names.d.ts +6 -0
  6. package/dist/constants/cim-class-names.js +6 -0
  7. package/dist/constants/cim-class-names.js.map +1 -1
  8. package/dist/converter/integral7/ConverterIntegral7.d.ts +17 -4
  9. package/dist/converter/integral7/ConverterIntegral7.js +530 -39
  10. package/dist/converter/integral7/ConverterIntegral7.js.map +1 -1
  11. package/dist/converter/integral7/config/db-config.d.ts +3 -1
  12. package/dist/converter/integral7/model/integral/Hgueleitung.d.ts +9 -0
  13. package/dist/converter/integral7/model/integral/Hgueleitung.js +3 -0
  14. package/dist/converter/integral7/model/integral/Hgueleitung.js.map +1 -0
  15. package/dist/converter/integral7/model/integral/Kopfstation.d.ts +31 -0
  16. package/dist/converter/integral7/model/integral/Kopfstation.js +3 -0
  17. package/dist/converter/integral7/model/integral/Kopfstation.js.map +1 -0
  18. package/dist/converter/integral7/model/interfaces.d.ts +8 -0
  19. package/dist/converter/integral7/sql/integral.sql.d.ts +8 -0
  20. package/dist/converter/integral7/sql/integral.sql.js +22 -1
  21. package/dist/converter/integral7/sql/integral.sql.js.map +1 -1
  22. package/dist/converter/integral7/utils.d.ts +4 -1
  23. package/dist/converter/integral7/utils.js +26 -8
  24. package/dist/converter/integral7/utils.js.map +1 -1
  25. package/dist/etl-neplan/etl-neplan-contingency-analysis.js +22 -7
  26. package/dist/etl-neplan/etl-neplan-contingency-analysis.js.map +1 -1
  27. package/dist/etl-neplan/etl-neplan-feederline.d.ts +3 -1
  28. package/dist/etl-neplan/etl-neplan-feederline.js +73 -15
  29. package/dist/etl-neplan/etl-neplan-feederline.js.map +1 -1
  30. package/dist/etl-neplan/etl-neplan.js.map +1 -1
  31. package/dist/etl-neplan/neplan-contingency-analysis.d.ts +14 -0
  32. package/dist/etl-neplan/neplan-contingency-analysis.js +337 -0
  33. package/dist/etl-neplan/neplan-contingency-analysis.js.map +1 -0
  34. package/dist/graph/Types.d.ts +5 -0
  35. package/dist/graph/Types.js +10 -0
  36. package/dist/graph/Types.js.map +1 -0
  37. package/dist/graph/connections/connection.d.ts +11 -0
  38. package/dist/graph/connections/connection.js +17 -0
  39. package/dist/graph/connections/connection.js.map +1 -0
  40. package/dist/graph/edges/edge.d.ts +8 -0
  41. package/dist/graph/edges/edge.js +16 -0
  42. package/dist/graph/edges/edge.js.map +1 -0
  43. package/dist/graph/graph-interfaces.d.ts +15 -0
  44. package/dist/graph/graph-interfaces.js +3 -0
  45. package/dist/graph/graph-interfaces.js.map +1 -0
  46. package/dist/graph/graph-util.d.ts +13 -0
  47. package/dist/graph/graph-util.js +114 -0
  48. package/dist/graph/graph-util.js.map +1 -0
  49. package/dist/graph/graph.d.ts +15 -0
  50. package/dist/graph/graph.js +75 -0
  51. package/dist/graph/graph.js.map +1 -0
  52. package/dist/graph/nodes/node.d.ts +14 -0
  53. package/dist/graph/nodes/node.js +28 -0
  54. package/dist/graph/nodes/node.js.map +1 -0
  55. package/dist/index.d.ts +6 -0
  56. package/dist/index.js +12 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/model/core/ACDCTerminal.js +2 -2
  59. package/dist/model/core/ACDCTerminal.js.map +1 -1
  60. package/dist/model/core/ConnectivityNode.js +3 -2
  61. package/dist/model/core/ConnectivityNode.js.map +1 -1
  62. package/dist/model/core/PSRType.d.ts +0 -1
  63. package/dist/model/core/PSRType.js +3 -6
  64. package/dist/model/core/PSRType.js.map +1 -1
  65. package/dist/model/core/PowerSystemResource.js +3 -8
  66. package/dist/model/core/PowerSystemResource.js.map +1 -1
  67. package/dist/model/core/Substation.d.ts +3 -0
  68. package/dist/model/core/Substation.js +4 -0
  69. package/dist/model/core/Substation.js.map +1 -1
  70. package/dist/model/core/Terminal.d.ts +2 -0
  71. package/dist/model/core/Terminal.js +2 -2
  72. package/dist/model/core/Terminal.js.map +1 -1
  73. package/dist/model/core/VoltageLevel.js +0 -1
  74. package/dist/model/core/VoltageLevel.js.map +1 -1
  75. package/dist/model/dc/ACDCConverter.d.ts +23 -0
  76. package/dist/model/dc/ACDCConverter.js +33 -0
  77. package/dist/model/dc/ACDCConverter.js.map +1 -0
  78. package/dist/model/dc/ACDCConverterDCTerminal.d.ts +13 -0
  79. package/dist/model/dc/ACDCConverterDCTerminal.js +54 -0
  80. package/dist/model/dc/ACDCConverterDCTerminal.js.map +1 -0
  81. package/dist/model/dc/CsConverter.d.ts +21 -0
  82. package/dist/model/dc/CsConverter.js +43 -0
  83. package/dist/model/dc/CsConverter.js.map +1 -0
  84. package/dist/model/dc/CsOperatingModeKind.d.ts +4 -0
  85. package/dist/model/dc/CsOperatingModeKind.js +9 -0
  86. package/dist/model/dc/CsOperatingModeKind.js.map +1 -0
  87. package/dist/model/dc/CsPpccControlKind.d.ts +5 -0
  88. package/dist/model/dc/CsPpccControlKind.js +10 -0
  89. package/dist/model/dc/CsPpccControlKind.js.map +1 -0
  90. package/dist/model/dc/DCBaseTerminal.d.ts +8 -0
  91. package/dist/model/dc/DCBaseTerminal.js +30 -0
  92. package/dist/model/dc/DCBaseTerminal.js.map +1 -0
  93. package/dist/model/dc/DCConductingEquipment.d.ts +5 -0
  94. package/dist/model/dc/DCConductingEquipment.js +12 -0
  95. package/dist/model/dc/DCConductingEquipment.js.map +1 -0
  96. package/dist/model/dc/DCConverterOperatingModeKind.d.ts +5 -0
  97. package/dist/model/dc/DCConverterOperatingModeKind.js +10 -0
  98. package/dist/model/dc/DCConverterOperatingModeKind.js.map +1 -0
  99. package/dist/model/dc/DCConverterUnit.d.ts +14 -0
  100. package/dist/model/dc/DCConverterUnit.js +54 -0
  101. package/dist/model/dc/DCConverterUnit.js.map +1 -0
  102. package/dist/model/dc/DCEquipmentContainer.d.ts +5 -0
  103. package/dist/model/dc/DCEquipmentContainer.js +12 -0
  104. package/dist/model/dc/DCEquipmentContainer.js.map +1 -0
  105. package/dist/model/dc/DCLine.d.ts +11 -0
  106. package/dist/model/dc/DCLine.js +48 -0
  107. package/dist/model/dc/DCLine.js.map +1 -0
  108. package/dist/model/dc/DCLineSegment.d.ts +13 -0
  109. package/dist/model/dc/DCLineSegment.js +69 -0
  110. package/dist/model/dc/DCLineSegment.js.map +1 -0
  111. package/dist/model/dc/DCNode.d.ts +12 -0
  112. package/dist/model/dc/DCNode.js +41 -0
  113. package/dist/model/dc/DCNode.js.map +1 -0
  114. package/dist/model/dc/DCPolarityKind.d.ts +5 -0
  115. package/dist/model/dc/DCPolarityKind.js +10 -0
  116. package/dist/model/dc/DCPolarityKind.js.map +1 -0
  117. package/dist/model/dc/DCTerminal.d.ts +10 -0
  118. package/dist/model/dc/DCTerminal.js +38 -0
  119. package/dist/model/dc/DCTerminal.js.map +1 -0
  120. package/dist/model/dc/VsConverter.d.ts +18 -0
  121. package/dist/model/dc/VsConverter.js +33 -0
  122. package/dist/model/dc/VsConverter.js.map +1 -0
  123. package/dist/model/dc/VsPpccControlKind.d.ts +7 -0
  124. package/dist/model/dc/VsPpccControlKind.js +12 -0
  125. package/dist/model/dc/VsPpccControlKind.js.map +1 -0
  126. package/dist/model/dc/VsQpccControlKind.d.ts +5 -0
  127. package/dist/model/dc/VsQpccControlKind.js +10 -0
  128. package/dist/model/dc/VsQpccControlKind.js.map +1 -0
  129. package/dist/model/domain/UnitMultiplier.js.map +1 -1
  130. package/dist/model/extensions/amprion/model/AmprionModell.d.ts +25 -0
  131. package/dist/model/extensions/amprion/model/AmprionModell.js +64 -0
  132. package/dist/model/extensions/amprion/model/AmprionModell.js.map +1 -0
  133. package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.d.ts +34 -0
  134. package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js +134 -0
  135. package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js.map +1 -0
  136. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.d.ts +17 -0
  137. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js +77 -0
  138. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js.map +1 -0
  139. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.d.ts +14 -0
  140. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js +57 -0
  141. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js.map +1 -0
  142. package/dist/model/extensions/amprion/project/AMPRIONErpProject.d.ts +7 -0
  143. package/dist/model/extensions/amprion/project/AMPRIONErpProject.js +17 -0
  144. package/dist/model/extensions/amprion/project/AMPRIONErpProject.js.map +1 -0
  145. package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.d.ts +19 -0
  146. package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js +74 -0
  147. package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js.map +1 -0
  148. package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.d.ts +15 -0
  149. package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js +26 -0
  150. package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js.map +1 -0
  151. package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.d.ts +5 -0
  152. package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js +10 -0
  153. package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js.map +1 -0
  154. package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.d.ts +9 -0
  155. package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js +46 -0
  156. package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js.map +1 -0
  157. package/dist/model/extensions/enervance/operations/EVTerminalAction.js.map +1 -1
  158. package/dist/model/extensions/neplan-westnetz/assets/WNFacility.js.map +1 -1
  159. package/dist/model/generation/WindGeneratingUnit.d.ts +5 -0
  160. package/dist/model/generation/WindGeneratingUnit.js +66 -0
  161. package/dist/model/generation/WindGeneratingUnit.js.map +1 -1
  162. package/dist/model/model/Model.d.ts +39 -1
  163. package/dist/model/model/Model.js +91 -1
  164. package/dist/model/model/Model.js.map +1 -1
  165. package/dist/model/wires/ACLineSegment.d.ts +1 -0
  166. package/dist/model/wires/ACLineSegment.js +15 -2
  167. package/dist/model/wires/ACLineSegment.js.map +1 -1
  168. package/dist/model/wires/AsynchronousMachine.d.ts +1 -0
  169. package/dist/model/wires/AsynchronousMachine.js +37 -1
  170. package/dist/model/wires/AsynchronousMachine.js.map +1 -1
  171. package/dist/model/wires/Disconnector.js +1 -1
  172. package/dist/model/wires/EnergySource.d.ts +2 -0
  173. package/dist/model/wires/EnergySource.js +28 -2
  174. package/dist/model/wires/EnergySource.js.map +1 -1
  175. package/dist/model/wires/SeriesCompensator.d.ts +18 -2
  176. package/dist/model/wires/SeriesCompensator.js +108 -5
  177. package/dist/model/wires/SeriesCompensator.js.map +1 -1
  178. package/dist/util/util-create.js.map +1 -1
  179. package/dist/util/util-topology.d.ts +2 -2
  180. package/dist/util/util-topology.js +14 -6
  181. package/dist/util/util-topology.js.map +1 -1
  182. package/package.json +1 -1
  183. package/src/config/westnetz-neplan/neplan-load.config.ts +1 -1
  184. package/src/constants/cim-class-definition.ts +20 -1
  185. package/src/constants/cim-class-names.ts +9 -0
  186. package/src/converter/integral7/ConverterIntegral7.ts +753 -345
  187. package/src/converter/integral7/config/db-config.ts +3 -2
  188. package/src/converter/integral7/model/integral/Hgueleitung.ts +12 -0
  189. package/src/converter/integral7/model/integral/Kopfstation.ts +46 -0
  190. package/src/converter/integral7/model/interfaces.ts +23 -16
  191. package/src/converter/integral7/sql/integral.sql.ts +27 -1
  192. package/src/converter/integral7/utils.ts +43 -11
  193. package/src/etl-neplan/etl-neplan-contingency-analysis.ts +30 -12
  194. package/src/etl-neplan/etl-neplan-feederline.ts +100 -17
  195. package/src/etl-neplan/etl-neplan.ts +1 -0
  196. package/src/etl-neplan/neplan-contingency-analysis.ts +572 -0
  197. package/src/graph/Types.ts +7 -0
  198. package/src/graph/connections/connection.ts +29 -0
  199. package/src/graph/edges/edge.ts +27 -0
  200. package/src/graph/graph-interfaces.ts +21 -0
  201. package/src/graph/graph-util.ts +158 -0
  202. package/src/graph/graph.ts +84 -0
  203. package/src/graph/nodes/node.ts +43 -0
  204. package/src/index.ts +8 -0
  205. package/src/model/core/ACDCTerminal.ts +2 -2
  206. package/src/model/core/ConnectivityNode.ts +2 -2
  207. package/src/model/core/PSRType.ts +3 -6
  208. package/src/model/core/PowerSystemResource.ts +3 -7
  209. package/src/model/core/Substation.ts +6 -0
  210. package/src/model/core/Terminal.ts +15 -6
  211. package/src/model/core/VoltageLevel.ts +0 -1
  212. package/src/model/dc/ACDCConverter.ts +66 -0
  213. package/src/model/dc/ACDCConverterDCTerminal.ts +64 -0
  214. package/src/model/dc/CsConverter.ts +68 -0
  215. package/src/model/dc/CsOperatingModeKind.ts +4 -0
  216. package/src/model/dc/CsPpccControlKind.ts +5 -0
  217. package/src/model/dc/DCBaseTerminal.ts +30 -0
  218. package/src/model/dc/DCConductingEquipment.ts +8 -0
  219. package/src/model/dc/DCConverterOperatingModeKind.ts +6 -0
  220. package/src/model/dc/DCConverterUnit.ts +60 -0
  221. package/src/model/dc/DCEquipmentContainer.ts +8 -0
  222. package/src/model/dc/DCLine.ts +56 -0
  223. package/src/model/dc/DCLineSegment.ts +81 -0
  224. package/src/model/dc/DCNode.ts +49 -0
  225. package/src/model/dc/DCPolarityKind.ts +5 -0
  226. package/src/model/dc/DCTerminal.ts +45 -0
  227. package/src/model/dc/VsConverter.ts +48 -0
  228. package/src/model/dc/VsPpccControlKind.ts +7 -0
  229. package/src/model/dc/VsQpccControlKind.ts +5 -0
  230. package/src/model/domain/UnitMultiplier.ts +12 -12
  231. package/src/model/equivalents/EquivalentBranch.ts +10 -10
  232. package/src/model/extensions/amprion/model/AmprionModell.ts +92 -0
  233. package/src/model/extensions/amprion/project/AMPRIONConstructionProject.ts +174 -0
  234. package/src/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.ts +89 -0
  235. package/src/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.ts +64 -0
  236. package/src/model/extensions/amprion/project/AMPRIONErpProject.ts +21 -0
  237. package/src/model/extensions/amprion/project/AMPRIONErpProjectPhase.ts +89 -0
  238. package/src/model/extensions/amprion/project/AMPRIONErpProjectStructure.ts +36 -0
  239. package/src/model/extensions/amprion/project/AMPRIONProjectPriorityKind.ts +5 -0
  240. package/src/model/extensions/amprion/wires/AMPRIONSeriesCompensator.ts +53 -0
  241. package/src/model/extensions/enervance/core/EVTerminal.ts +1 -1
  242. package/src/model/extensions/enervance/operations/EVTerminalAction.ts +0 -1
  243. package/src/model/extensions/neplan-westnetz/assets/WNFacility.ts +0 -1
  244. package/src/model/generation/WindGeneratingUnit.ts +73 -0
  245. package/src/model/model/Model.ts +131 -7
  246. package/src/model/wires/ACLineSegment.ts +244 -228
  247. package/src/model/wires/AsynchronousMachine.ts +38 -1
  248. package/src/model/wires/Disconnector.ts +1 -1
  249. package/src/model/wires/EnergySource.ts +256 -222
  250. package/src/model/wires/SeriesCompensator.ts +145 -19
  251. package/src/util/util-create.ts +2 -0
  252. package/src/util/util-topology.ts +18 -7
  253. package/test/apache-jena-fuseki-interface/{apache-jena-fuseki-neplan.tests.spec.ts → apache-jena-fuseki-neplan-1.tests.sp-ec.ts} +0 -26
  254. package/test/apache-jena-fuseki-interface/apache-jena-fuseki-neplan-2.tests.spec.ts +255 -0
  255. package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_EQ_V1.xml +20867 -0
  256. package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_SSH_V1.xml +3784 -0
  257. package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_EQ_V1.xml +42546 -0
  258. package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SSH_V1.xml +10101 -0
  259. package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SV_V1.xml +6229 -0
  260. package/test/integral7-converter/integral7-converter.tests.spec.ts +12 -3
  261. package/test/power-system-data-model-converter/power-system-data-model-converter.tests.spec.ts +1 -1
  262. package/test/apache-jena-fuseki-interface/data/apache-jena-fuseki-3.12.0/run/system/tdb.lock +0 -1
@@ -3,7 +3,7 @@ import { Conductor } from './Conductor';
3
3
  import { Model } from '../model/Model';
4
4
  import { DiagramObject } from '../diagram/DiagramObject';
5
5
  import { ConnectivityNode } from '../core/ConnectivityNode';
6
- import {ISchemaSettings} from '../../interfaces/schema-settings/ShapeInfos';
6
+ import { ISchemaSettings } from '../../interfaces/schema-settings/ShapeInfos';
7
7
  import { getValue, writeElement, writeElementAttribute } from '../../util/utils';
8
8
  import { CIM_CLASS_NAMES, IConnectivityNode } from '../..';
9
9
  import { convertValue } from '../../util/datatype-converter';
@@ -12,23 +12,23 @@ import XMLWriter from 'xml-writer';
12
12
 
13
13
  export class ACLineSegment extends Conductor {
14
14
 
15
- constructor(uuid?: string, name?: string, shortName?: string, description?: string, length?: number,aggregate?: boolean){
16
- super(uuid, name, shortName, description, length, aggregate);
17
- }
15
+ constructor(uuid?: string, name?: string, shortName?: string, description?: string, length?: number, aggregate?: boolean) {
16
+ super(uuid, name, shortName, description, length, aggregate);
17
+ }
18
18
 
19
- r0: number;
20
- x0: number;
21
- r: number;
22
- x: number;
23
- bch: number;
24
- gch: number;
19
+ r0: number;
20
+ x0: number;
21
+ r: number;
22
+ x: number;
23
+ bch: number;
24
+ gch: number;
25
25
 
26
- b0ch: number;
27
- g0ch: number;
26
+ b0ch: number;
27
+ g0ch: number;
28
28
 
29
- shortCircuitEndTemperature: number;
29
+ shortCircuitEndTemperature: number;
30
30
 
31
- public static sparqlQuery : string = `
31
+ public static sparqlQuery: string = `
32
32
  PREFIX cim: <http://iec.ch/TC57/2013/CIM-schema-cim16#>
33
33
  PREFIX enervance: <http://enervance.com/CIM/Extensions#>
34
34
  PREFIX entsoe: <http://entsoe.eu/CIM/SchemaExtension/3/1#>
@@ -69,225 +69,241 @@ export class ACLineSegment extends Conductor {
69
69
  ?installation ?length ?r ?x ?bch ?gch ?length ?bvUUID ?ptUUID ?ecUUID
70
70
  `
71
71
 
72
- public static getQuerySPARQL(graphURI : string) : string{
73
- if(graphURI.length > 0){
74
- return ACLineSegment.sparqlQuery.replace('<http://default/>', graphURI);
75
- }
76
- return ACLineSegment.sparqlQuery;
77
- }
78
-
79
- public static resolveClassFusekiJSON(data: any, cimModel: Model){
80
- data.results.bindings.forEach((value: any) => {
81
- const acLineSegment = new ACLineSegment();
82
- acLineSegment.resolveAttributesFusekiJSON(value);
83
- cimModel.addACLineSegment(acLineSegment);
84
- });
72
+ public static getQuerySPARQL(graphURI: string): string {
73
+ if (graphURI.length > 0) {
74
+ return ACLineSegment.sparqlQuery.replace('<http://default/>', graphURI);
85
75
  }
86
-
87
- protected resolveAttributesFusekiJSON(value: any){
88
- super.resolveAttributesFusekiJSON(value);
89
- this.r = +getValue(value, 'r');
90
- this.x = +getValue(value, 'x');
91
- this.bch = +getValue(value, 'bch');
92
- this.gch = +getValue(value, 'gch');
93
-
94
- }
95
-
96
- public resolveParsedAssociations(cimModel: Model){
97
- super.resolveParsedAssociations(cimModel);
76
+ return ACLineSegment.sparqlQuery;
77
+ }
78
+
79
+ public static resolveClassFusekiJSON(data: any, cimModel: Model) {
80
+ data.results.bindings.forEach((value: any) => {
81
+ const acLineSegment = new ACLineSegment();
82
+ acLineSegment.resolveAttributesFusekiJSON(value);
83
+ cimModel.addACLineSegment(acLineSegment);
84
+ });
85
+ }
86
+
87
+ protected resolveAttributesFusekiJSON(value: any) {
88
+ super.resolveAttributesFusekiJSON(value);
89
+ this.r = +getValue(value, 'r');
90
+ this.x = +getValue(value, 'x');
91
+ this.bch = +getValue(value, 'bch');
92
+ this.gch = +getValue(value, 'gch');
93
+ }
94
+
95
+ public resolveParsedAssociations(cimModel: Model) {
96
+ super.resolveParsedAssociations(cimModel);
97
+ }
98
+
99
+
100
+ public toJSON() {
101
+ super.toJSON();
102
+ this.toJSONAttributes();
103
+ this.toJSONAssociations();
104
+ return this.json;
105
+ }
106
+
107
+ public toJSONAttributes() {
108
+ super.toJSONAttributes();
109
+ //this.json['baseVoltageUUID'] = this.baseVoltage.nominalVoltage.value;
110
+ this.json['r'] = this.r;
111
+ this.json['x'] = this.x;
112
+ this.json['bch'] = this.bch;
113
+ this.json['gch'] = this.gch;
114
+ this.json['currentLimit'] = this.getCurrentLimit();
115
+ }
116
+
117
+ public toJSONAssociations() {
118
+ super.toJSONAssociations();
119
+ if (this.baseVoltage)
120
+ this.json['baseVoltageUUID'] = this.baseVoltage.mrid;
121
+ }
122
+
123
+ public toGeoJSON(geoJSON: any, profile: string, schemaSettings: ISchemaSettings, diagramObject?: DiagramObject): any {
124
+ if (diagramObject) {
125
+ super.toGeoJSON(geoJSON, profile, schemaSettings, diagramObject);
126
+ const linePoints: number[][] = [];
127
+ diagramObject.diagramObjectPoints.forEach((point) => {
128
+ linePoints.push([+point.getXPosition(), +point.getYPosition() * -1]);
129
+ });
130
+ geoJSON['geometry'] = {
131
+ type: 'LineString',
132
+ coordinates: linePoints
133
+ }
134
+ geoJSON['properties'] = {
135
+ diagramObjectUUID: diagramObject.mrid,
136
+ objectType: this.constructor.name,
137
+ }
98
138
  }
99
-
100
-
101
- public toJSON(){
102
- super.toJSON();
103
- this.toJSONAttributes();
104
- this.toJSONAssociations();
105
- return this.json;
139
+ return geoJSON;
140
+ }
141
+
142
+ /** Erstellt ein GeoJSON-Objekt für die Karte */
143
+ // TODO überarbeiten und konsolidieren mit Schema
144
+ public toMapGeoJSON(): any {
145
+ const linePoints: number[][] = [];
146
+ this.location.positionPoints.forEach((point) => {
147
+ linePoints.push([+point.xPosition, +point.yPosition]);
148
+ });
149
+ const geoJSON = {};
150
+
151
+ geoJSON['id'] = this.mrid;
152
+ geoJSON['type'] = 'Feature';
153
+ geoJSON['geometry'] = {
154
+ type: 'LineString',
155
+ coordinates: linePoints
156
+ };
157
+ geoJSON['properties'] = {
158
+ uuid: this.mrid,
159
+ objectType: this.constructor.name,
106
160
  }
107
-
108
- public toJSONAttributes(){
109
- super.toJSONAttributes();
110
- //this.json['baseVoltageUUID'] = this.baseVoltage.nominalVoltage.value;
111
- this.json['r'] = this.r;
112
- this.json['x'] = this.x;
113
- this.json['bch'] = this.bch;
114
- this.json['gch'] = this.gch;
115
- this.json['currentLimit'] = this.getCurrentLimit();
161
+ return geoJSON;
162
+ }
163
+
164
+ //hier endet der Aufruf
165
+ public determineTopologicalNodes(connNodes: IConnectivityNode[]) {
166
+ return;
167
+ }
168
+
169
+ /** die Methode bestimmt den Datentyp, konvertiert und weist den Wert zu */
170
+ /* public setProperty(cimModel: Model, propName: string, propertyValue: any){
171
+ const dataType: string = this.prop2Datatype.get(propName);
172
+
173
+ if(dataType) {
174
+ if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
175
+ this.setAssociation(cimModel, propName, propertyValue);
176
+ } else { // primitiver Datentyp
177
+ this[propName] = convertValue(dataType, propertyValue);
178
+ }
179
+ }
180
+ }*/
181
+
182
+ /* public setAssociation(cimModel: Model, associationName: string, associatioValue: any){
183
+ super.setAssociation(cimModel, associationName, associatioValue);
184
+ }*/
185
+
186
+
187
+ /** die Methode gibt basierend auf der aktuellen Ausprägung des übergebenen Property
188
+ * ein SPARQL-INSERT Statemant zurück.
189
+ * 2 Szearien:
190
+ * Löschen der aktuellen Ausprägung -> wird im DELETE DATA Block platziert.
191
+ * Einfügen der aktuellen Ausprägung -> wird im INSERT DATA Block platziert. */
192
+
193
+ /* public getUpdateSPARQL(className: string, propName: string): string {
194
+ if(this.constructor.name === className) {
195
+
196
+ const dataType: string = this.prop2Datatype.get(propName);
197
+ if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
198
+ return super.getUpdateSPARQL(className, propName);
199
+ } else {
200
+ const propValue = String(this[propName]); // aktuelle Ausprägung auslesen
201
+
202
+ const propNS = this.prop2namespacePrefix.get(String(propName));
203
+ const propClassName = this.prop2Class.get(String(propName));
204
+ if(propNS) {
205
+ return `<${this.baseIRI}${this.mrid}> ${propNS}:${propClassName}.${propName} \'${propValue}\' . `;
206
+ }
207
+ }
208
+ } else {
209
+ //TODO überarbeiten murks
210
+ return super.getUpdateSPARQL(className, propName);
211
+ }
212
+ return;
213
+ }*/
214
+
215
+ /** CIM RDF/XML Serialisierung */
216
+ public toCIMXML(xmlWriter: XMLWriter, profile: string) {
217
+ const suffixID = this.getSuffixID(profile);
218
+ const prefixUUID = this.getPrefixUUID(suffixID);
219
+ let defaultValues = '';
220
+ this.checkMandatoryAttributes(profile, defaultValues);
221
+ this.description += defaultValues;
222
+ if (profile === RDF_XML.PROFILE_EQ) {
223
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
224
+ writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
225
+ this.toCIMXMLAttributes(xmlWriter, profile);
226
+ this.toCIMXMLAssociations(xmlWriter, profile);
227
+ xmlWriter.endElement();
228
+ } else if (profile === RDF_XML.PROFILE_AMPI7 && this.checkExportData(RDF_XML.PROFILE_AMPI7)) {
229
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
230
+ writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
231
+ this.toCIMXMLAttributes(xmlWriter, profile);
232
+ this.toCIMXMLAssociations(xmlWriter, profile);
233
+ xmlWriter.endElement();
116
234
  }
117
-
118
- public toJSONAssociations(){
119
- super.toJSONAssociations();
120
- if(this.baseVoltage)
121
- this.json['baseVoltageUUID'] = this.baseVoltage.mrid;
235
+ }
236
+
237
+ protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
238
+ super.toCIMXMLAttributes(xmlWriter, profile);
239
+ if (profile === RDF_XML.PROFILE_EQ) {
240
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.r`, this.r);
241
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.x`, this.x);
242
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.bch`, this.bch);
243
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.gch`, this.gch);
244
+
245
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.r0`, this.r0);
246
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.x0`, this.x0);
247
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.b0ch`, this.b0ch);
248
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.g0ch`, this.g0ch);
249
+
250
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.shortCircuitEndTemperature`, this.shortCircuitEndTemperature);
122
251
  }
123
-
124
- public toGeoJSON (geoJSON: any, profile: string, schemaSettings: ISchemaSettings, diagramObject?: DiagramObject): any {
125
- if(diagramObject) {
126
- super.toGeoJSON(geoJSON, profile, schemaSettings, diagramObject);
127
- const linePoints: number[][] = [];
128
- diagramObject.diagramObjectPoints.forEach( (point) => {
129
- linePoints.push([+point.getXPosition(), +point.getYPosition() * -1]);
130
- });
131
- geoJSON['geometry'] = {
132
- type: 'LineString',
133
- coordinates: linePoints
134
- }
135
- geoJSON['properties'] = {
136
- diagramObjectUUID: diagramObject.mrid,
137
- objectType: this.constructor.name,
138
- }
139
- }
140
- return geoJSON;
252
+ }
253
+
254
+ protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
255
+ super.toCIMXMLAssociations(xmlWriter, profile);
256
+ }
257
+
258
+ checkMandatoryAttributes(profile: string, defaultValues: string) {
259
+ super.checkMandatoryAttributes(profile, defaultValues);
260
+ if (profile === RDF_XML.PROFILE_EQ) {
261
+ if (!this.r) {
262
+ this.r = 1;
263
+ defaultValues += 'r,'
264
+ }
265
+ if (!this.x) {
266
+ this.x = 1;
267
+ defaultValues += 'x,'
268
+ }
269
+ if (!this.bch) {
270
+ this.bch = 1;
271
+ defaultValues += 'bch,'
272
+ }
273
+ if (!this.gch) {
274
+ this.gch = 1;
275
+ defaultValues += 'gch,'
276
+ }
277
+ if (!this.r0) {
278
+ this.r0 = 1;
279
+ defaultValues += 'r0,'
280
+ }
281
+ if (!this.x0) {
282
+ this.x0 = 1;
283
+ defaultValues += 'x0,'
284
+ }
285
+ if (!this.b0ch) {
286
+ this.b0ch = 1;
287
+ defaultValues += 'b0ch,'
288
+ }
289
+ if (!this.g0ch) {
290
+ this.g0ch = 1;
291
+ defaultValues += 'g0ch,'
292
+ }
293
+ if (!this.shortCircuitEndTemperature) {
294
+ this.shortCircuitEndTemperature = 80;
295
+ defaultValues += 'shortCircuitEndTemperature,'
296
+ }
141
297
  }
142
-
143
- /** Erstellt ein GeoJSON-Objekt für die Karte */
144
- // TODO überarbeiten und konsolidieren mit Schema
145
- public toMapGeoJSON (): any {
146
- const linePoints: number[][] = [];
147
- this.location.positionPoints.forEach( (point) => {
148
- linePoints.push([+point.xPosition, +point.yPosition]);
149
- });
150
- const geoJSON = {};
151
-
152
- geoJSON['id'] = this.mrid;
153
- geoJSON['type'] = 'Feature';
154
- geoJSON['geometry'] = {
155
- type: 'LineString',
156
- coordinates: linePoints
157
- };
158
- geoJSON['properties'] = {
159
- uuid: this.mrid,
160
- objectType: this.constructor.name,
161
- }
162
- return geoJSON;
163
- }
164
-
165
- //hier endet der Aufruf
166
- public determineTopologicalNodes(connNodes: IConnectivityNode[]){
167
- return;
168
- }
169
-
170
- /** die Methode bestimmt den Datentyp, konvertiert und weist den Wert zu */
171
- /* public setProperty(cimModel: Model, propName: string, propertyValue: any){
172
- const dataType: string = this.prop2Datatype.get(propName);
173
-
174
- if(dataType) {
175
- if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
176
- this.setAssociation(cimModel, propName, propertyValue);
177
- } else { // primitiver Datentyp
178
- this[propName] = convertValue(dataType, propertyValue);
179
- }
180
- }
181
- }*/
182
-
183
- /* public setAssociation(cimModel: Model, associationName: string, associatioValue: any){
184
- super.setAssociation(cimModel, associationName, associatioValue);
185
- }*/
186
-
187
-
188
- /** die Methode gibt basierend auf der aktuellen Ausprägung des übergebenen Property
189
- * ein SPARQL-INSERT Statemant zurück.
190
- * 2 Szearien:
191
- * Löschen der aktuellen Ausprägung -> wird im DELETE DATA Block platziert.
192
- * Einfügen der aktuellen Ausprägung -> wird im INSERT DATA Block platziert. */
193
- /* public getUpdateSPARQL(className: string, propName: string): string {
194
- if(this.constructor.name === className) {
195
-
196
- const dataType: string = this.prop2Datatype.get(propName);
197
- if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
198
- return super.getUpdateSPARQL(className, propName);
199
- } else {
200
- const propValue = String(this[propName]); // aktuelle Ausprägung auslesen
201
-
202
- const propNS = this.prop2namespacePrefix.get(String(propName));
203
- const propClassName = this.prop2Class.get(String(propName));
204
- if(propNS) {
205
- return `<${this.baseIRI}${this.mrid}> ${propNS}:${propClassName}.${propName} \'${propValue}\' . `;
206
- }
207
- }
208
- } else {
209
- //TODO überarbeiten murks
210
- return super.getUpdateSPARQL(className, propName);
211
- }
212
- return;
213
- }*/
214
-
215
- /** CIM RDF/XML Serialisierung */
216
- public toCIMXML(xmlWriter: XMLWriter, profile: string) {
217
- let defaultValues = '';
218
- this.checkMandatoryAttributes(profile, defaultValues);
219
- this.description += defaultValues;
220
- if(profile === RDF_XML.PROFILE_EQ) {
221
- const suffixID = this.getSuffixID(profile);
222
- const prefixUUID = this.getPrefixUUID(suffixID);
223
- xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
224
- writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
225
- this.toCIMXMLAttributes(xmlWriter, profile);
226
- this.toCIMXMLAssociations(xmlWriter, profile);
227
- xmlWriter.endElement();
228
- }
229
- }
230
-
231
- protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
232
- super.toCIMXMLAttributes(xmlWriter, profile);
233
- if(profile === RDF_XML.PROFILE_EQ) {
234
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.r`, this.r);
235
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.x`, this.x);
236
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.bch`, this.bch);
237
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.gch`, this.gch);
238
-
239
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.r0`, this.r0);
240
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.x0`, this.x0);
241
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.b0ch`, this.b0ch);
242
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.g0ch`, this.g0ch);
243
-
244
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACLineSegment.shortCircuitEndTemperature`, this.shortCircuitEndTemperature);
245
- }
246
- }
247
-
248
- protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
249
- super.toCIMXMLAssociations(xmlWriter, profile);
250
- }
251
-
252
- checkMandatoryAttributes(profile: string, defaultValues: string) {
253
- super.checkMandatoryAttributes(profile, defaultValues);
254
- if (profile === RDF_XML.PROFILE_EQ) {
255
- if (!this.r) {
256
- this.r = 1;
257
- defaultValues += 'r,'
258
- }
259
- if (!this.x) {
260
- this.x = 1;
261
- defaultValues += 'x,'
262
- }
263
- if (!this.bch) {
264
- this.bch = 1;
265
- defaultValues += 'bch,'
266
- }
267
- if (!this.gch) {
268
- this.gch = 1;
269
- defaultValues += 'gch,'
270
- }
271
- if (!this.r0) {
272
- this.r0 = 1;
273
- defaultValues += 'r0,'
274
- }
275
- if (!this.x0) {
276
- this.x0 = 1;
277
- defaultValues += 'x0,'
278
- }
279
- if (!this.b0ch) {
280
- this.b0ch = 1;
281
- defaultValues += 'b0ch,'
282
- }
283
- if (!this.g0ch) {
284
- this.g0ch = 1;
285
- defaultValues += 'g0ch,'
286
- }
287
- if (!this.shortCircuitEndTemperature) {
288
- this.shortCircuitEndTemperature = 80;
289
- defaultValues += 'shortCircuitEndTemperature,'
290
- }
291
- }
298
+ }
299
+
300
+ /** Die Methode überprüft, ob für die übergebene ProfilURI
301
+ * relevante Informationen gepflegt sind.
302
+ * @param profilURI URI des Profils. */
303
+ checkExportData(profilURI: string): boolean {
304
+ if (this.psrType || this.psrTypeUUID) {
305
+ return true;
292
306
  }
307
+ return false;
308
+ }
293
309
  }
@@ -24,6 +24,9 @@ export class AsynchronousMachine extends RotatingMachine {
24
24
 
25
25
  /** CIM RDF/XML Serialisierung */
26
26
  public toCIMXML(xmlWriter: XMLWriter, profile: string) {
27
+ let defaultValues = '';
28
+ this.checkMandatoryAttributes(profile, defaultValues);
29
+ this.description += defaultValues;
27
30
  if(profile === RDF_XML.PROFILE_EQ) {
28
31
  const suffixID = this.getSuffixID(profile);
29
32
  const prefixUUID = this.getPrefixUUID(suffixID);
@@ -40,7 +43,7 @@ export class AsynchronousMachine extends RotatingMachine {
40
43
  if(profile === RDF_XML.PROFILE_EQ) {
41
44
  writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.nominalFrequency`, this.nominalFrequency);
42
45
  writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.nominalSpeed`, this.nominalSpeed);
43
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.converterFedDrive`, this.converterFedDrive ? this.converterFedDrive : false);
46
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.converterFedDrive`, this.converterFedDrive);
44
47
  writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.efficiency`, this.efficiency);
45
48
  writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.iaIrRatio`, this.iaIrRatio);
46
49
  writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:AsynchronousMachine.polePairNumber`, this.polePairNumber);
@@ -53,4 +56,38 @@ export class AsynchronousMachine extends RotatingMachine {
53
56
  protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
54
57
  super.toCIMXMLAssociations(xmlWriter, profile);
55
58
  }
59
+
60
+ checkMandatoryAttributes(profile: string, defaultValues: string) {
61
+ super.checkMandatoryAttributes(profile, defaultValues);
62
+ if (profile === RDF_XML.PROFILE_EQ) {
63
+ if (!this.converterFedDrive) {
64
+ this.converterFedDrive = false;
65
+ defaultValues += 'converterFedDrive,'
66
+ }
67
+ if (!this.efficiency) {
68
+ this.efficiency = 1;
69
+ defaultValues += 'efficiency,'
70
+ }
71
+ if (!this.iaIrRatio) {
72
+ this.iaIrRatio = 1;
73
+ defaultValues += 'iaIrRatio,'
74
+ }
75
+ if (!this.polePairNumber) {
76
+ this.polePairNumber = 1;
77
+ defaultValues += 'polePairNumber,'
78
+ }
79
+ if (!this.ratedMechanicalPower) {
80
+ this.ratedMechanicalPower = 0;
81
+ defaultValues += 'ratedMechanicalPower,'
82
+ }
83
+ if (!this.reversible) {
84
+ this.reversible = false;
85
+ defaultValues += 'reversible,'
86
+ }
87
+ if (!this.rxLockedRotorRatio) {
88
+ this.rxLockedRotorRatio = 0.1;
89
+ defaultValues += 'rxLockedRotorRatio,'
90
+ }
91
+ }
92
+ }
56
93
  }
@@ -62,7 +62,7 @@ export class Disconnector extends Switch {
62
62
  OPTIONAL{?dUUID cim:Switch.retained ?retained .}
63
63
  OPTIONAL{?dUUID cim:Switch.open ?open .}
64
64
  OPTIONAL{?dUUID cim:Equipment.EquipmentContainer ?ecUUID .}
65
- OPTIONAL {?dUUID cim:Equipment.AdditionalEquipmentContainer ?aecUUIDs .}
65
+ OPTIONAL{?dUUID cim:Equipment.AdditionalEquipmentContainer ?aecUUIDs .}
66
66
  }
67
67
  }
68
68
  GROUP BY ?dUUID ?baseIRI ?name ?shortName ?description