JSON file rotation

Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,635Unicorn
edited December 2018 inProduct Feedback - Resolved

Raw JSON files often contain data for mulitple examples in a repeated array format. However, the current "JSON to Data" operator ignores that and simply imports all fields into a single row---in effect, ignoring the array structure and pretending that each JSON file contains only a single record.

It is possible, with a lot of extra post-processing effort, to turn that into a typical dataset, with separate rows for each example and the same attribute set for all examples, using a combination of Pivot, Transpose, Generate Attributes, Split, etc.. However, this transformation should really be an automatic part of the initial import process, or at least an option.

JSON files are becoming more and more popular as the returned format for API calls and web services, and it is a shame that RapidMiner handles them so poorly in its current implementation. Enhancing the Read JSON operator would go a long way to making it more functional for working with that type of semi-structured data.

Brian T.
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts
BalazsBarany sgenzer kayman Thomas_Ott SGolbert tftemme rfuentealba Telcontar120 Andy2
9
9 votes

Declined·Last Updated

very good solution available with OWC Web Automation extension

Comments

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager

    是的是的是的是的。谢谢你!@Telcontar120You're speaking my language!

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn

    Yes, I vote for this. I've been forced to manipulate JSON outside of RapidMiner before loading it in and it's not an 'elegant' solution.

  • tftemmetftemme Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, RMResearcher, MemberPosts:164RM Research

    For the time being, you may want to have a look into the 'Split Document into Collection' operator from the Operator Toolbox Extension. If you have a specific character (e.g. end-of-line character as \n) to separate the JSON string of your different examples, you can use the operator to split your single input document into a collection of documents. This you can feed into the JSON to Data operator to convert into an ExampleSet with more than one example.

    I have to say, this will not solve the issue with an array of JSON objects in one input document out of the hand, but maybe the operator is useful in other cases.

  • SGolbertSGolbert RapidMiner Certified Analyst, MemberPosts:344Unicorn

    I agree. I think that having a wizard like in Read XML would be the best.

  • rfuentealbarfuentealba Moderator, RapidMiner Certified Analyst, Member, University ProfessorPosts:568Unicorn

    Hey people,

    I am designing an extension (but still not coding it) to create this kind of complex structure, taking some stuff from@mschmitz, the suggestions by@SGolberton this same thread and some experiences from a Ruby gem I built years ago. I think I'm going to need some help because I don't know how to expose this properly through RapidMiner Server or if it's feasible.

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager

    @rfuentealbathat's awesome! I hope you know about ourdeveloper resources.:)

  • rfuentealbarfuentealba Moderator, RapidMiner Certified Analyst, Member, University ProfessorPosts:568Unicorn

    Hi@sgenzer, yes I did. I have some questions but these are outside the scope of this idea. I'll send you a PM you once I finish what I'm doing;)

  • SGolbertSGolbert RapidMiner Certified Analyst, MemberPosts:344Unicorn

    我看到在GitHub开发者指南doesn't correspond to the one on the documentation (the one on GitHub is about game data processing).

    另外tionally, my text editor (Atom) has trouble to find the import statements with the java-importer plugin, but that's what I get for not using the right tools (Idea or Eclipse).

  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM ModeratorPosts:2,959Community Manager
Sign InorRegisterto comment.