Support Questions

Find answers, ask questions, and share your expertise

Transform JSON SPECs

avatar
New Contributor

Hi,

I need specs for the below JSON transformation using JOLT (https://jolt-demo.appspot.com/).

It would be grateful if someone could help on the same. 

 

Input JSON:

[
{
"Name": "Construction",
"ID": "2",
"Canonical Definition": "Chemicals used for removal of the sticky & other bonding materials from the surface where adhesives are used.",
"MIs": "Wax Remover, Sample, Test 1",
"DNIs": "Graffiti Remover",
"Children": "11",
"Primary Path": "2",
"Allpath": "2;3,30"
},
{
"Name": "Paints & Supplies",
"ID": "11",
"Canonical Definition": "Cleaners used to remove oil, tar, grease & other petroleum based stains from concrete and brick Surfaces",
"MIs": "Degreaser",
"DNIs": "Stain Removers, Test 2, Test 3",
"Children": "101,102,103",
"Primary Path": "2,11",
"Allpath": "2,11;4,400"
},
{
"Name": "Chemicals & Cleaners",
"ID": "101",
"Canonical Definition": "Chemicals used to prepare the surface by restoring wood's natural color and beauty",
"MIs": "Patio Cleaner; Wood Cleaner",
"DNIs": "Roof Cleaner",
"Children": "1001,1002,1003,1004,1005",
"Primary Path": "2,11,101",
"All Path": "2,11,101"
}
]

 

 

 

Expected Output JSON:

[
{
"Name": "Construction",
"ID": 2,
"Canonical Definition": "Chemicals used for removal of the sticky & other bonding materials from the surface where adhesives are used.",
"MIs": "Wax Remover, Sample, Test 1",
"DNIs": "Graffiti Remover",
"Children": [11],
"Primary Path": [2],
"Allpath":[
{"path":[2]},
{"path":[3,30]}]
},
{
"Name": "Paints & Supplies",
"ID": 11,
"Canonical Definition": "Cleaners used to remove oil, tar, grease & other petroleum based stains from concrete and brick Surfaces",
"MIs": "Degreaser",
"DNIs": "Stain Removers, Test 2, Test 3",
"Children": [101,102,103],
"Primary Path": [2,11],
"Allpath":[
{"path":[2,11]},
{"path":[4,400]}]
},
{
"Name": "Chemicals & Cleaners",
"ID": 101,
"Canonical Definition": "Chemicals used to prepare the surface by restoring wood's natural color and beauty",
"MIs": "Patio Cleaner; Wood Cleaner",
"DNIs": "Roof Cleaner",
"Children": [1001,1002,1003,1004,1005],
"Primary Path": [2,11,101],
"Allpath":[
{"path":[2,11,101]}]
}
]

 

Thanks in advance. 

 

1 REPLY 1

avatar
New Contributor

@NIFIJOLT is this something you can help. 

Last time you helped on the below and it worked out well for us. 

https://community.cloudera.com/t5/Support-Questions/Need-Jolt-Spec-to-convert-matrix-json-to-denorma...