GraphGists

What's on the menu?

Introduction

New York Public Library has over 45,000 menus from 1840s to present-day in its What’s on the menu? collection. This graph list dishes from four menus from that collection.

Schema

c5212c0f 28ed 492e 9214 68ac078bb79e 5M40Mrujs

Nodes

  • (Menu)

    • name: name of the restaurant

    • event

    • physical_description: description of the menu

    • notes

    • call_number: call number for the New York Public Library

    • date: date of the menu

    • status:

    • page_count: number of pages in the menu

  • (Dish)

    • name: name of dish

  • (Location)

    • address

    • city

    • state

Relationships

  • [:SERVES]

    • price: price of dish

  • [:LOCATED_AT]

Create nodes and relationships

Queries

List all the menus

ba8d123a 43b3 47e7 ad43 8a26f1b853c7 Gj2M9BQew
Figure 1. All the menus
MATCH (menu: Menu)
RETURN menu.name AS Restaurant, menu.dish_count AS `Dish Count`, menu.call_number AS `Call Number`, menu.date AS Date
ORDER By menu.name

Find all the restaurants in a city

All restaurants in New York City

MATCH (location: Location {city:"New York"})<-[:LOCATED_AT]-(menu: Menu)
RETURN menu.name AS Restaurant, location.city AS City, location.state AS State, menu.date AS Date
ORDER BY menu.name
871ac062 2653 4285 ab60 c96440fcad1b 40MKlc2Xa
Figure 2. Menus Per City

Find restaurants that serve a particular dish.

All restaurants that serve coffee.

MATCH (location: Location)<-[:LOCATED_AT]-(menu: Menu)-[r:SERVES]->(dish: Dish {name: 'Coffee'})
RETURN menu.name AS Restaurant, r.price as price, location.city AS City, location.state AS State, menu.date AS Date
ORDER BY menu.name
a8be4fef 8961 4290 bf05 59a74a862f70 S 0qHbG9L
Figure 3. Restaurants that serve coffee

Find restaurants in a city that serve a particular dish.

All restaurants in New York City that serve milk.

MATCH (location: Location {city:"New York"})<-[:LOCATED_AT]-(menu: Menu)-[r:SERVES]->(dish: Dish {name: 'Milk'})
RETURN menu.name AS Restaurant, r.price as price, location.city AS City, location.state AS State, menu.date AS Date
ORDER BY menu.name

Find all the dishes that a particular restaurants serves

cc76df9e 8a9f 47f1 b4f1 cbe1e071586c x QWK1EcV
Figure 4. All the dishes from Virginia Hotel
MATCH (menu: Menu {name: 'Virginia Hotel'})-[r:SERVES]->(dish: Dish)
RETURN dish.name AS Dish, r.price as price, menu.date AS Date
ORDER BY dish.name
613c8496 32ae 4375 8ae4 7ffd73e6dbdf GJTEAouj5

Find the most common dishes

MATCH (menu: Menu)-[re:SERVES]->(dish: Dish)
WITH dish, count(menu) AS rels, collect(menu.name) as menus
RETURN dish.name AS Dish, rels AS Count, menus AS Restaurants
ORDER BY rels DESC
LIMIT 5

Find all the dishes that two restaurants have in common

Dishes that Republican House and Hotel Marlborough serve.

MATCH (menu: Menu {name: 'Republican House'})-[r:SERVES]->(dish: Dish)
RETURN dish, menu
UNION
MATCH (menu: Menu {name: 'Hotel Marlborough'})-[r:SERVES]->(dish: Dish)
RETURN dish, menu
290ef5bc ca85 436c 8b8c 2e828c024e5a wRUmBVnuI

Find dishes by prices

Most expensive dishes

MATCH (location: Location)<-[:LOCATED_AT]-(menu: Menu)-[r:SERVES]->(dish: Dish)
WHERE r.price > 0
RETURN dish.name, menu.name AS Restaurant, r.price as price, location.city AS City, location.state AS State, menu.date AS Date
ORDER BY price DESC
LIMIT 5

Least expensive dishes

MATCH (location: Location)<-[:LOCATED_AT]-(menu: Menu)-[r:SERVES]->(dish: Dish)
WHERE r.price > 0
RETURN dish.name, menu.name AS Restaurant, r.price AS Price, location.city AS City, location.state AS State, menu.date AS Date
ORDER BY r.price ASC
LIMIT 5