Solved

Exploding a multi-nested XML file using XMLFragmenter to build a lookup table

  • 6 December 2019
  • 3 replies
  • 24 views

Badge +10

I can't seem to line up my elements/attributes on this lookup table I'm creating. Thanks in advance!

Below is the screenshot of the XML attribute I'd like to create a feature from.

Below is the parent-children tree of the elements I want to retrieve from my XML file.

This is the screenshot of my workspace and configuration. Enable Flatenning is checked and all options are default.

This is the result I'm getting from the workbench

Below is the expected result

 

 

DomainNetworkName

networkSourceId

NetworkSourceName

AssetGroupCode

AssetGroupName

AssetTypeCode

AssetTypeName

ElectricDistribution

6

ElectricDistributionDevice

1

Arrester

1

Distribution Class

ElectricDistribution

6

ElectricDistributionDevice

2

Breaker

1

Air Powered

ElectricDistribution

6

ElectricDistributionDevice

3

Capacitor

1

Fixed Capacitor

ElectricDistribution

6

ElectricDistributionDevice

4

Circuit Breaker

1

Air Powered

ElectricDistribution

6

ElectricDistributionDevice

5

Elbow

1

Load Break

ElectricDistribution

6

ElectricDistributionDevice

6

Fuse

1

Automatic Sectionalizing

ElectricDistribution

7

ElectricDistributionLine

3

Low Voltage

1

Overhead

ElectricDistribution

7

ElectricDistributionLine

1

Busbar

1

Busbar

ElectricDistribution

7

ElectricDistributionLine

4

Medium Voltage

1

Single-phase Overhead

ElectricDistribution

7

ElectricDistributionLine

6

Subtransmission

1

Overhead

ElectricDistribution

9

ElectricDistributionJunction

3

Ground

1

Neutral Ground

ElectricTransmission

11

ElectricTransmissionDevice

3

Circuit Breaker

1

Circuit Breaker

ElectricTransmission

11

ElectricTransmissionDevice

6

Line Monitor

1

Line Monitor

ElectricTransmission

11

ElectricTransmissionDevice

11

Transformer

1

Transformer

ElectricTransmission

11

ElectricTransmissionDevice

13

Capacitor

1

Fixed Capacitor

ElectricTransmission

12

ElectricTransmissionLine

2

Connector

1

Connector

ElectricTransmission

12

ElectricTransmissionLine

3

High Voltage AC

1

High Voltage AC

ElectricTransmission

14

ElectricTransmissionJunction

1

Connection Point

1

Attachment

ElectricTransmission

14

ElectricTransmissionJunction

3

Ground

1

Neutral Ground

icon

Best answer by salvaleonrp 12 December 2019, 15:42

View original

3 replies

Badge +22

My recommendation would be to set the Elements to Match to 'JunctionSource', in the flatten options, add the Ancestor Element (Grandparent). Then explode the AssetGroups/AssetTypes lists to get one feature per AssetType with all the necessary ancestor attributes.

Badge +10

Thanks for the suggestion @jdh. I'm a few more steps closer.

Here's the updated workbench with ListExploders.

I am getting there.

A couple of issues though.

1. DomainNetworkID and DomainNetworkName are missing even if I have the Grandparent enabled.

2. Where AssetGroup=0 and AssetType=0 are going to the rejecte port for MISSING_PARAMETR_LIST even if these features are in the tree?

Badge +10

Problem solved. Results below.

For problem 1, the key was the XML-Parent-ID of the child elements AssetGroups. By separating the rejected output port for the three DomainNetwork values and merging it later with the elements of the AssetGroup and AssetType I was able to populate the DomainID and DomainNetwork values from the attribute merge of the FeatureMerger. My second issue was merely AssetGroups that do not have AssetTypes. After making a sort on the XML-ID the pattern became quite obvious.

Screenshot of final translation below.

Yesterday, I found the network services DE in REST so I'm going to have a new version for that. The JSON on queryDataElements has more metadata.

Reply