This thread is for posting solutions to “Just KNIME It!” Challenge 12. Feel free to link your solution from KNIME Hub as well!
Here is the challenge of the week: Just KNIME It! | KNIME
Have an idea for a challenge?? We’d love to hear it! Feel free to write it here .
Carmen opera by Bizet kindly supported the following basic solution with regular statistics about each gene.
Here is my solution
1 table view for hormone listing and 3 text output for extra information.
Here’s my solution including XML data.
REF Challenge 12 rev 2.knwf (45.2 KB)
I’ve added a simple If Switch so the user can choose between JSON and XML. Ideally the workflow should automatically detect the file format, but without some actual XML data I’m not sure to approach the problem.
REF Challenge 12 rev 3.knwf (126.3 KB)
I like the opera reference! hehe
Hub Link to my Solution for challenge 12… Get request through loop while switch node / part answer is missing as i couldnt find how to identify the file on xml or json basis to parse.
Here is my solution to #justknimeit-12 :
KNIME Hub > gonhaddock > Spaces > Just_KNIME_It > Just KNIME It _ Challenge 012
Aiming to fulfil the XML availability, I’ve included a randomize formatting of the input; then parsing JSON together with XML server responses.
here’s my solution
Very cool API!
Kodo’s to who formulated to challenge. The small detail of handling xml encoded response forced me to add a whole loop around the data parsing section.
Pro-tip: Instead of downloading the data from the hub, one can access it using the HTTPS node
what is the difference between case and if nodes?
IF Switches have two output ports and come in different flavours:
- The Empty Table Switch bypasses the main branch when the input table is empty (no rows)
- The Java IF allows to write arbitrary Java code the decide which branch to activate (it has access to Flow Variables only – I wish it would also know about table dimensions)
- The IF Switch can be set up statically, or be controlled by a Flow Variable
The Case Switches allow any number of branches, and any data type. The output can be set up statically, or be controlled by a Flow Variable. So it’s kinda the big brother of the “normal” IF Switch. I have never used a Case Switch so far though, so I might not be 100% accurate about them.
In short: The abnormal IF Switches come in handy in situations, where a Case Switch would require helper nodes to produce the same behaviour.
PS: I should mention that the Case Switches got an overhaul with KNIME AP 4.5. Before that, they had a fixed number of 3 output ports and were limited to Flow Variables and Tables I think. So me not using them is force of habit, but that will fade
Here is our solution to this week’s challenge!
We let the user decide what parsing route to take (XML or JSON) based on a manual checking of the response type. We saw a few fully automated solutions here that look amazing too!
As always, thanks for engaging in our weekly challenges and for the high quality of the solutions!.
See you tomorrow for a new challenge!
Hi y’all !
A rather late submission but here it is.
A simple approach to decide whether the response is an XML or a JSON, using the Content type response header (application/xml; charset=utf-8 or application/json; charset=UTF-8).
This parser would admit any of those options and decide how to parse the corresponding output. At the end, it will concatenate both parsed branches. In this case we don’t have any XML response so we can only check the output of the json parser.
Cool idea to use the Rule-based Row Splitter!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.