GraphGists

Beer & Breweries GraphGist

OpenBeerDB.com has a list of 1400+ breweries and 5900+ beers. Here’s a graph of the first 50 breweries from that list. The graph makes beer recommendations based on beer style, beer category, location, and alcohol content.

Schema

beer brewery2

(Beer)

  • name: beer name

  • abv: alcohol by volume

(Brewery)

  • name: brewery name

  • address1

  • city

  • state

  • country

  • code

  • latitude

  • longitude

  • phone

  • website

(Category)

  • category

(City)

  • city

  • state

  • country

(State)

  • state

(Country)

  • country

(Beer) - [:BREWED_AT] → (Brewery) (Beer) - [:BEER_CATEGORY] → (Category) (Beer) - [:BEER_STYLE] → (Style) (Brewery) - [:LOC_CITY] → (City) - [:LOC_STATE] → (State) - [:LOC_COUNTRY] → (Country)

Create nodes and relationships

Queries: Beers in Beers San Francisco, CA

breweries per city2
MATCH (beer:Beer) - [:BREWED_AT] -> (brewery: Brewery) - [:LOC_CITY] -> (city:City {city: 'San Francisco'}) - [:LOC_STATE] -> (state:State {state: 'California'})
RETURN Distinct(beer.name) as beer, brewery.name as brewery, brewery.address1 as address
order by brewery.name, beer.name

Queries: Beers for in the German Lager category

MATCH   (category:Category {category: "German Lager"}) <- [:BEER_CATEGORY]- (beer:Beer) - [:BREWED_AT] -> (brewery: Brewery)  - [:LOC_CITY] -> (city:City) - [:LOC_STATE] -> (state:State)  - [:LOC_COUNTRY] -> (country:Country)
RETURN Distinct(beer.name) as beer,  brewery.name as brewery, city.city as city, state.state as state , country.country as country
order by country , beer

Beers for a particular category and location: British Ale beers in the UK

category per city
MATCH   (category:Category {category: "British Ale"}) <- [:BEER_CATEGORY]- (beer:Beer) - [:BREWED_AT] -> (brewery: Brewery)  - [:LOC_CITY] -> (city:City) - [:LOC_STATE] -> (state:State)  - [:LOC_COUNTRY] -> (country:Country {country: "United Kingdom"})
RETURN Distinct(beer.name) as beer,  brewery.name as brewery, city.city as city
order by city, beer

Beers for a particular style: Porter beers

MATCH    (style:Style {style: 'Porter'}) <- [:BEER_STYLE] - (beer:Beer) - [:BREWED_AT] -> (brewery: Brewery)  - [:LOC_CITY] -> (city:City) - [:LOC_STATE] -> (state:State)  - [:LOC_COUNTRY] -> (country:Country)
RETURN Distinct(beer.name) as beer,  brewery.name as brewery, city.city as city, state.state as state , country.country as country
order by country , beer

Beers that are the same style: Beers like IPA

similar beers
MATCH   (:Beer {name: 'IPA'}) - [:BEER_STYLE] - >  (style:Style) <- [:BEER_STYLE] - (beer:Beer)  - [:BREWED_AT] -> (brewery: Brewery)  - [:LOC_CITY] -> (city:City) - [:LOC_STATE] -> (state:State)  - [:LOC_COUNTRY] -> (country:Country)
RETURN  Distinct(beer.name) as beer ,  brewery.name as brewery, city.city as city, state.state as state , country.country as country
order by beer

Strongest beers (highest alcohol by volume)

MATCH   (beer:Beer) - [:BREWED_AT] -> (brewery: Brewery)
RETURN  beer.name as beer ,  beer.abv, brewery.name as brewery, brewery.city as city, brewery.state as state , brewery.country as country
order by beer.abv desc
limit 10

Weakest beers (low alcohol content)

MATCH   (beer:Beer) - [:BREWED_AT] -> (brewery: Brewery)
where beer.abv > 0
RETURN  beer.name as beer ,  beer.abv, brewery.name as brewery, brewery.city as city, brewery.state as state , brewery.country as country
order by beer.abv
limit 10