Solutions to “Just KNIME It!” Challenge 12 - Season 3

:sun_with_face: Another Wednesday, another Just KNIME It! challenge! :sun_with_face:

:beers: Did you know that August 2nd is International Beer Day? :eyes: Let’s celebrate the history of one of the world’s oldest beverages with a challenge on REST APIs and JSON processing! :gear:

Here is the challenge. Let’s use this thread to post our solutions to it, which should be uploaded to your public KNIME Hub spaces with tag JKISeason3-12.

:sos: Need help with tags? To add tag JKISeason3-12 to your workflow, go to the description panel in KNIME Analytics Platform, click the pencil to edit it, and you will see the option for adding tags right there. :slight_smile: Let us know if you have any problems!

3 Likes

My solution.

I’m really interested how others approach the challenge :slight_smile:

6 Likes

Here is my solution for this Challenge.

I used JSON reader and recursive loop.
Get request did not recieve all the data as i tried it.

3 Likes

Here’s my solution. It produces a list of all of the breweries. There’s also a Choropleth map of the USA. I have a mind block about JSON so I converted it to XML so I could parse the data with XPath. I added another output which allows selection of brewpub, micro or large brewery types.

3 Likes

Hello everyone, this is my solution.

I have made two solutions. One uses a loop and the other doesn’t. Since this website supports high concurrent access, a loop doesn’t need to be used.

6 Likes

Here is my take on it.

I wrapped it into a component that allows to configure:

  • Items per page to be retrieved
  • optional delay between iterations (might be necessary to avoid running over rate limits although in my tests it also worked with 0 delay :slight_smile: )

My approach was to use the meta data endpoint to get the total number of breweries.

Based on that and the user input of breweries per page I calculate the number of requests that are necessary to fetch all items and then generate a dynamic URL incl. page and items per page to get the data and turn it from JSON into a table.

Overview (view inside the component):

Link:

4 Likes

Hi all, Here is may solution.

My solution seems to be similar to you all’s. I felt it is a good exercise for learning how to use the REST API on KNIME :slight_smile:

5 Likes

Find herewith my Submission

3 Likes

A lot of missing and some bad geodata, but seemed worthwhile to know the opportunities for a “pint” nearby

5 Likes

Good morning !
I hope everyone is okay.
Here is my solution to the challenge

3 Likes

Good morning !
I hope everyone is okay.
Here is my solution to the challenge

3 Likes

Hi all,
Here is my solution.

Number of breweries to return in each request was controlled by component configuration.

3 Likes

Hello everyone,
I created my workflow by mimicking everyone’s workflow. Thanks.

5 Likes

Here’s my attempt for this challenge and let me break it down for you.

1. Set the base url and decide how many results you want per pages in each iteration

2. Create a custom url with page. Here I used https://api.openbrewerydb.org/v1/breweries?page=1&per_page=200 with the page number changing wit h each iteration and the “per_page” value set using flow variables
( Note: Fun fact! It turns out pages 0 and 1 served up the same results. So, I spiced things up a bit by adding +1 in the string manipulation to keep the results unique. :wink:)

3. Create a custom loop to interact with the JSON response and check if it contains any results or is just an empty array “[ ]”

4. Use the Variable Condition Loop End node to stop the loop (where the json is only contains “[ ]”

5. Delete the unused column “status” and “content type”

6. Clean the data by changing the missing value

7. Show the result in Table View or connect to Excel Writer/CSV Writer node to save the data

And voila! You’ve got the dataset. This dataset contains a information that’s really interesting to explore, whether through dashboard visualizations, statistical analysis, or other insights!

Do you have any recommendation to simplify this solution?

Ahmad Ulfi Jihad Dzulqornain
Bachelor Degree of Statistics
Let’s Connect!

4 Likes

Hello @ JKIers
This is my take to the challenge; It’s always a good fun to practice some REST retrieving data, together with Brewery insights.

From a first sight over the query, I can conclude that the data is quite biased to USA industry.

image

Keep coding :vulcan_salute:t4:

3 Likes

:boom: Hi, everybody! :sun_with_face: As always on Tuesdays, here’s our solution to last week’s Just KNIME It! challenge.

:thought_balloon: The trick here involved computing the number of pages first, and then iterating over the pages to make sure that we got all the brewery data. :beers:

:people_hugging: Thanks for the very creative solutions and dashboards! :female_detective: See you tomorrow for a challenge on fraud detection. :mag_right:

4 Likes

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