Solutions to "Just KNIME It!" Challenge 12

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! :heart_eyes: Feel free to write it here .

1 Like

Carmen opera by Bizet kindly supported the following basic solution with regular statistics about each gene.

2 Likes

Hi everyone,
Here is my solution
1 table view for hormone listing and 3 text output for extra information.

2 Likes

Hello,

here is the link to my solution: justknimeit - 12 - Raffaello Barri – KNIME Hub

RB

1 Like

Here’s my solution including XML data.

REF Challenge 12 rev 2.knwf (45.2 KB)

1 Like

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)

2 Likes

I like the opera reference! hehe

1 Like

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.

anil

Hello KNIMErs,

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.

BR

1 Like

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 :face_with_open_eyes_and_hand_over_mouth:

what is the difference between case and if nodes?

cheers

2 Likes

@martinmunch
IF Switches have two output ports and come in different flavours:

  1. The Empty Table Switch bypasses the main branch when the input table is empty (no rows)
  2. 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)
  3. 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 :wink:

2 Likes

:fire: Here is our solution to this week’s challenge! :fire:

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!. :heavy_heart_exclamation: :heavy_heart_exclamation: :heavy_heart_exclamation:

See you tomorrow for a new challenge!

3 Likes

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.

Final output:

2 Likes

Cool idea to use the Rule-based Row Splitter!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.