<commit_before>[[graphdb-neo4j]]
The Neo4j Graph Database
========================

This chapter goes into more detail on the data model and behavior of Neo4j.

[[graphdb-neo4j-nodes]]
== Nodes ==

The fundamental units that form a graph are nodes and relationships.
In Neo4j, both nodes and relationships can contain <<graphdb-neo4j-properties,properties>>.

Nodes are often used to represent _entities,_ but depending on the domain relationships may be used for that purpose as well.

["dot", "graphdb-nodes-overview.svg", "meta"]
----
"A Node" [fillcolor="NODEHIGHLIGHT"]
"A Node" -> "Relationships" [label="can have"]
"A Node" -> "Properties" [label="can have"]
----

Let's start out with a really simple graph, containing only a single node with one property:

["dot", "graphdb-nodes.svg"]
----
"name: Marko"
----


[[graphdb-neo4j-relationships]]
== Relationships ==

Relationships between nodes are a key part of a graph database.
They allow for finding related data.
Just like nodes, relationships can have <<graphdb-neo4j-properties,properties>>.

["dot", "graphdb-rels-overview.svg", "meta"]
----
"A Relationship" [fillcolor="NODEHIGHLIGHT"]
"A Relationship" -> "Start node" [label="has a"]
"A Relationship" -> "End node" [label="has a"]
"A Relationship" -> "Relationship type" [label="has a"]
"A Relationship" -> "Properties" [label="can have"]
"Relationship type" -> Name [label="uniquely identified by"]
----

A relationship connects two nodes, and is guaranteed to have valid start and end nodes.

["dot", "graphdb-rels.svg"]<commit_msg>Added a missing relationship.<commit_after>[[graphdb-neo4j]]
The Neo4j Graph Database
========================

This chapter goes into more detail on the data model and behavior of Neo4j.

[[graphdb-neo4j-nodes]]
== Nodes ==

The fundamental units that form a graph are nodes and relationships.
In Neo4j, both nodes and relationships can contain <<graphdb-neo4j-properties,properties>>.

Nodes are often used to represent _entities,_ but depending on the domain relationships may be used for that purpose as well.

["dot", "graphdb-nodes-overview.svg", "meta"]
----
"A Node" [fillcolor="NODEHIGHLIGHT"]
"A Node" -> "Relationships" [label="can have"]
"A Node" -> "Properties" [label="can have"]
"Relationships" -> "Properties" [label="can have"]
----

Let's start out with a really simple graph, containing only a single node with one property:

["dot", "graphdb-nodes.svg"]
----
"name: Marko"
----


[[graphdb-neo4j-relationships]]
== Relationships ==

Relationships between nodes are a key part of a graph database.
They allow for finding related data.
Just like nodes, relationships can have <<graphdb-neo4j-properties,properties>>.

["dot", "graphdb-rels-overview.svg", "meta"]
----
"A Relationship" [fillcolor="NODEHIGHLIGHT"]
"A Relationship" -> "Start node" [label="has a"]
"A Relationship" -> "End node" [label="has a"]
"A Relationship" -> "Relationship type" [label="has a"]
"A Relationship" -> "Properties" [label="can have"]
"Relationship type" -> Name [label="uniquely identified by"]
----

A relationship connects two nodes, and is guaranteed to have valid start and end nodes.

["dot", "graphdb-rels.svg"]
{'fraction_non_alphanumeric': 0.15588513726727674, 'fraction_numerical': 0.0050489113284947935, 'mean_word_length': 4.8812615955473095, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3109110', 'n_tokens_mistral': 962, 'n_tokens_neox': 922, 'n_words': 358}