The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"JSON to data operator"
fmehraliyev
Member Posts: 2 Learner III
Hello. I am really new in RapidMiner.
Basically, I have a dataset that has .json extension.
I was recommended to use JSON to data operator to be able to work with dataset.
Unfortunately I could not use the operator. It does not say anywhere, where in the operator to specify which dataset I am intending to work with. I basically cannot figure out, how to use this operator.
p.s. I have read some responses but they seem to be to advanced with xml codes. Do I need to specify the name of the file somwhere in xml code or? Thanks ahead.
Tagged:
0
Answers
hi @fmehraliyev - welcome to the community. To use the "JSON to Data" operator with a local JSON file, just use a "Read Document" operator before it:
As for sharing XML, that's the way we RapidMiner share our processes with one another. You can read about how to do this here:
https://community.rapidminer.com/t5/RapidMiner-Studio-Knowledge-Base/How-can-I-share-processes-without-RapidMiner-Server/ta-p/37047
Scott
Thank you very much!
One step is done. Now the second problem.
Json to data operator could not transform the file into dataset appopriately.
This is how my json file looks like:
It is a yelp dataset, and as I understand every {} sign should represent one row.
However, the operator transforms everything into one row and all attribute names starts with businessid (screenshot.jpg file attached).
Following is the xml code.
I have been reading a lot about json extention in rapidminer, hope it can be fixed though. Thanks everybody
Hi,
to process the JSON document into an example set, you need to group the entries in a collection.
This can be easily done with the Split Document into Collection Operator from the Text Processing Extension.
If the document looks exactly as your sample, then the split string is " \n" to indicate a new line (as parameter without the quotes).
See this sample process as an example:
Another way to deal with this would be to cut your json first using a jsonpath constructor to get rid of your 'root', this would allow you to 'flatten' your tree so the results of the example set would be more in line with your expectations. This is quite common with JSON, specifically if you call webservices as the actual json is still encapsulated in a result node.
so load your json -> cut the root with jsonpath (something simple like $.. could already do miracles) -> json to data
Hi,
Just a small addition, the Split Document into Collection operator is from the Operator Toolbox Extension. But as @David_A says, it is probably exactly what you need.
Best regards,
Fabian