HW 6 – Graph data stores. Neo4j

(5 points)

  1. Design the graph data model based on the analytical tasks (see HW1) that are intended to be solved with Neo4j.
    • Identify node labels, relationship types, and properties required for efficient queries.
    • Apply graph modeling best practices: avoid overly generic nodes, ensure meaningful relationships, and normalize repetitive properties into relationships.
    • Data must be modeled using multiple node labels and meaningful relationships, not a single node type with large property sets.
  2. Insert the data into Neo4j using the CSV/JSON generated for the project (see HW0).
    • Load only the necessary entities and relationships to solve the analytical tasks (e.g., via Cypher scripts, LOAD CSV…).
    • Ensure data import is reproducible (e.g., via Cypher scripts, LOAD CSV, or neo4j-admin import).
  3. Implement and run Cypher queries (see HW1):
    • Write Cypher queries to solve each analytical task.
    • Create appropriate indexes and constraints to optimize performance.
    • Demonstrate graph algorithms or path-finding where relevant (e.g., shortest path, centrality).
    • Explain chosen traversal patterns and query design decisions.
    • Restrictions:
      • Always specify the properties to return explicitly to reduce query overhead (no RETURN * in queries).
      • MATCH (a),(b) without explicit relationships is prohibited, except for controlled cases with LIMIT.
      • All frequently queried properties (e.g., id, name) must be indexed or constrained.
  4. Prepare a detailed report including:
    • Text from HW0 and HW1 (edited if necessary).
    • A clear graph schema diagram.
    • Node/relationship creation commands with reasoning for chosen graph structure.
    • Data import scripts and explanation of the loading process.
    • All Cypher queries for analytical tasks:
      • Task number (as in HW1);
      • Description of the analytical question;
      • Cypher query code with explanation;
      • Screenshot of the query result.

Important: If certain analytical tasks are not meaningful or feasible for Neo4j, replace them with other relevant graph-oriented tasks and update earlier work (HW0/HW1).

Submission Instructions

Submit to the BRUTE system:

  • HW6.docx file.

Submit the hw6.cypher file to the NoSQL server (nosql.felk.cvut.cz), containing Neo4j commands and brief comments.

Execution:

  • Execute the following shell command to evaluate the whole Neo4j script
    • cypher-shell -f $ScriptFile
    • $ScriptFile is a file with Cypher queries to be executed, i.e. queries.cypher
  • Tools:
    • Neo4j 5.23.0 (Java 21 *) (installed on the NoSQL server)
  • References:

Server: nosql.felk.cvut.cz Do not forget to execute the homework submission script after you upload it.

Deadline Sunday 14. 12. 2025 until 23:59

courses/be4m36ds2/homework/hw6.txt · Last modified: 2025/09/21 18:43 by prokoyul