Neo4j Section Schema and Properties

Exported on 5/15/2025 at 23:49:54 PDT from Cursor (0.50.4)


User

section schema and properties from neo4j


Cursor

Here is the schema and properties for the Section node in your Neo4j database:

Node Label: Section

Relationships:

Properties found on Section nodes:

If you need details about the data types or want to see example values for any property, let me know!


User

find all parent, child, and linked to nodes of 10.6.4, follow the linked to nodes recursively, return id, clause, clauseNumber, requirement


Cursor

Here are all parent, child, and recursively “LINKS_TO” connected nodes for clauseNumber 10.6.4, with their id, clause, clauseNumber, and requirement:

  1. id: c2927624-257b-4950-a7b8-95ee6dd0c2e3

  2. id: b9cff05e-3172-4674-b40b-eafc271db74a

  3. id: f66ecb66-5a33-4d91-a08b-8db0bd1a8c45

  4. id: b24fbff1-a467-45df-8ae8-c7f9d0db2a57

  5. id: 8b262467-2b9d-4dc7-8bd7-a93cefd7b962

If you need the full requirement text for any node or want to see the relationship paths, let me know!


User

MATCH (start:Section {clauseNumber: ‘10.6.4’})\nOPTIONAL MATCH (start)-[:PARENT_OF]->(parent:Section)\nOPTIONAL MATCH (start)-[:CHILD_OF]->(child:Section)\nOPTIONAL MATCH path=(start)-[:LINKS_TO*]->(linked:Section)\nWITH COLLECT(DISTINCT parent) AS parents, COLLECT(DISTINCT child) AS children, COLLECT(DISTINCT linked) AS linkedNodes, start\nUNWIND parents + children + linkedNodes + [start] AS node\nWITH DISTINCT node\nWHERE node IS NOT NULL\nRETURN node.id AS id, node.clause AS clause, node.clauseNumber AS clauseNumber, node.requirement AS requirement”

strip the newlines from this query so i can use it in my shell


Cursor

Here is your Cypher query with all newlines removed, so you can use it in your shell:

MATCH (start:Section {clauseNumber: '10.6.4'}) OPTIONAL MATCH (start)-[:PARENT_OF]->(parent:Section) OPTIONAL MATCH (start)-[:CHILD_OF]->(child:Section) OPTIONAL MATCH path=(start)-[:LINKS_TO*]->(linked:Section) WITH COLLECT(DISTINCT parent) AS parents, COLLECT(DISTINCT child) AS children, COLLECT(DISTINCT linked) AS linkedNodes, start UNWIND parents + children + linkedNodes + [start] AS node WITH DISTINCT node WHERE node IS NOT NULL RETURN node.id AS id, node.clause AS clause, node.clauseNumber AS clauseNumber, node.requirement AS requirement

You can copy and paste this directly into your shell or Neo4j browser.

MATCH (start:Section {clauseNumber: '10.6.4'}) OPTIONAL MATCH (start)-[:PARENT_OF]->(parent:Section) OPTIONAL MATCH (start)-[:CHILD_OF]->(child:Section) OPTIONAL MATCH path=(start)-[:LINKS_TO*]->(linked:Section) WITH COLLECT(DISTINCT parent) AS parents, COLLECT(DISTINCT child) AS children, COLLECT(DISTINCT linked) AS linkedNodes, start UNWIND parents + children + linkedNodes + [start] AS node WITH DISTINCT node WHERE node IS NOT NULL RETURN node.id AS id, node.clause AS clause, node.clauseNumber AS clauseNumber, node.requirement AS requirement

User

explain this query to me as someone who has only just started using neo4j


Cursor

Absolutely! Here’s a step-by-step explanation of what this Cypher query does, in beginner-friendly terms:


1. Find the Starting Node

MATCH (start:Section {clauseNumber: '10.6.4'})

OPTIONAL MATCH (start)-[:PARENT_OF]->(parent:Section)
OPTIONAL MATCH (start)-[:CHILD_OF]->(child:Section)
OPTIONAL MATCH path=(start)-[:LINKS_TO*]->(linked:Section)

3. Collect the Results

WITH COLLECT(DISTINCT parent) AS parents, COLLECT(DISTINCT child) AS children, COLLECT(DISTINCT linked) AS linkedNodes, start

4. Combine All Nodes into One List

UNWIND parents + children + linkedNodes + [start] AS node

5. Remove Duplicates and Nulls

WITH DISTINCT node
WHERE node IS NOT NULL

6. Return the Information

RETURN node.id AS id, node.clause AS clause, node.clauseNumber AS clauseNumber, node.requirement AS requirement

Summary

This query finds a specific section (10.6.4), then gathers:

It then returns some key information about each of these nodes, with no duplicates.

If you want more details about any part, just ask!

MATCH (start:Section {clauseNumber: '10.6.4'})
OPTIONAL MATCH (start)-[:PARENT_OF]->(parent:Section)
OPTIONAL MATCH (start)-[:CHILD_OF]->(child:Section)
OPTIONAL MATCH path=(start)-[:LINKS_TO*]->(linked:Section)
WITH COLLECT(DISTINCT parent) AS parents, COLLECT(DISTINCT child) AS children, COLLECT(DISTINCT linked) AS linkedNodes, start
UNWIND parents + children + linkedNodes + [start] AS node
WITH DISTINCT node
WHERE node IS NOT NULL
RETURN node.id AS id, node.clause AS clause, node.clauseNumber AS clauseNumber, node.requirement AS requirement