BrainPreview
Open in TheBrain

Neo4j

<ul>

<li>Neo4j is a&nbsp;<strong>Database</strong>&nbsp;&ndash; use it to reliably&nbsp;<strong>store information</strong> and&nbsp;<strong>find it later</strong></li>

</ul>

<ul>

<li>Neo4j&rsquo;s data model is a&nbsp;<strong>Graph</strong>, in particular a&nbsp;<strong>Property Graph</strong></li>

</ul>

<p>&nbsp;</p>

<ul>

<li><strong>Cypher</strong> is Neo4j&rsquo;s graph query language (<strong>SQL for graphs!</strong>)</li>

<li>Cypher is a declarative query language: it describes&nbsp;<strong>what</strong> you are interested in, not&nbsp;<strong>how</strong> it is acquired.</li>

<li>Cypher is meant to be very&nbsp;<strong>readable</strong> and&nbsp;<strong>expressive</strong></li>

</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<div class="row">

<div class="columns"><header class="text-center margin-bottom-large">

<h2 id="basics" class="section_title" data-magellan-target="basics">Neo4j Basics</h2>

<h3>The Labeled Property Graph Model</h3>

<a name="basics"></a>

<p>&nbsp;</p>

</header></div>

</div>

<div class="row small-up-1 medium-up-2 grid--gutters-lg ">

<div class="column column-block">

<h3 class="default">Nodes</h3>

<div class="card__content">

<ul>

<li>Nodes are the main data elements</li>

<li>Nodes are connected to other nodes via <strong>relationships</strong></li>

<li>Nodes can have one or more <strong>properties</strong> (i.e., attributes stored as key/value pairs)</li>

<li>Nodes have one or more <strong>labels</strong> that describes its role in the graph</li>

<li>Example: Person nodes vs Car nodes</li>

</ul>

</div>

</div>

<div class="column column-block">

<h3 class="default">Relationships</h3>

<div class="card__content">

<ul>

<li>Relationships connect two nodes</li>

<li>Relationships are directional</li>

<li><strong>Nodes</strong> can have multiple, even recursive relationships</li>

<li>Relationships can have one or more <strong>properties</strong> (i.e., attributes stored as key/value pairs)</li>

</ul>

</div>

</div>

<div class="column column-block">

<h3 class="default">Properties</h3>

<div class="card__content">

<ul>

<li>Properties are named values where the name (or key) is a string</li>

<li>Properties can be indexed and constrained</li>

<li>Composite indexes can be created from multiple properties</li>

</ul>

</div>

</div>

<div class="column column-block">

<h3 class="default">Labels</h3>

<div class="card__content">

<ul>

<li>Labels are used to group <strong>nodes</strong> into sets</li>

<li>A node may have multiple labels</li>

<li>Labels are indexed to accelerate finding nodes in the graph</li>

<li>Native label indexes are optimized for speed</li>

</ul>

</div>

</div>

</div>