Skip to content

Nov 20: Neo4j, Graph Model

Learning Objectives

After today's class, you should be able to:

  • Compare Neo4j's graph model with the relational database model.
  • Write basic Cypher queries using pattern matching and filtering.

Lesson Outline

Hints/Tips [15 min]

Lecture [35 min]

Mini Lab [25 min]

Hints and Tips

HW5 Hints
  1. Three SELECT statements in a subquery
  2. Use EXCEPT
  3. LEFT JOIN
  4. Two subqueries, > interval '10 minutes'
  5. SELECT DISTINCT in subquery
  6. Similar in structure to #5
  7. PARTITION BY "course"
  8. Get total enrollment by subject
GP6 Preview
  • Your project is due in two weeks
  • Prepare your final presentation
profs Updates
  1. In app.py, using standard SQLAlchemy instead of the legacy get_sqla_class() function. The legacy function was based on outdated examples.
  2. In app.py, using an application factory pattern by defining a create_app() function. The flask run command recognizes and calls this function automatically. Works better for non-trivial apps.
  3. In menu.py, moved the from views import ... into the setup_menu() function. This solves the circular import problem, because the app module will finish importing before this function is called.
  4. In forms.py, can now from app import db once at the top, rather than in each method (because of change #4).

Your To-Do List

  • Finish and submit HW5 – due tonight
  • Make progress on your project and GP6