I’m hoping you can help me! I’m new to JSON and I’m new to Knime.
I’m working with a JSON file structured like this:
I want to be able to write to a table where the “@k” values are column headers and the “@v” values are populated under the appropriate column heading. Looking at the image above, I want “addr:city” to be a heading and “Derby” to be a value underneath that heading.
The workflow works well and I’ve adapted it to be able to cater for far larger JSON files - I’m filtering by hotels. However, the output is still one row, when I’m trying to get a row per property (or @ID).
I’ve tried various Knime tools unsuccessfully. Do you have any pointers or recommendations?
Your workflow has done practically everything, thank you. The one final area I’m trying to resolve is grouping all the attributes in to the right row, for data accuracy purposes.
If I look at the source data, the Premier Inn data does not include a postcode.
The addr:postcode value has been populated from another property in the source data:
This pattern is consistent and I’m trying to work back through your workflow to understand where that’s happening. Playing with the group and ungroup, but, if you have any quick ideas on finalising this, I would really appreciate it. I’ll keep plugging away.
I can’t break the back of my problem here; looking at the data and the workflow, the problem I have is that the relationship between the key value pairs and the parent object is lost and I can’t work out how to re-establish it, so I think I need to take the “ID” and other objects through the entire workflow so that I can ensure data integrity and accuracy in the final output.
One approach I’ve looked at is below and I’d appreciate your view - per row analysis, in a loop?
In my latest version (below) I’ve searched the data for hotel data (this is what I’m interested in) and then put that data in to a table. In order to maintain the relationship through out, do you think a loop that iterates in to your workflow is viable?
@Matt_D and @ipazin - guys, please excuse my delay in responding - I’ve used both and they worked so well and I cracked on with creating my solution that I forgot to thank you.
Guys, thank you both - great work, patience and fantastic support.