Nodes and Relationships

The Simba Neo4j JDBC Driver creates tables to allow Neo4j nodes and relationships to be queried through SQL.

Nodes

The connector creates one table for each distinct combination of node labels.

For example, if the data store contains the following nodes:

  • Node1, with the label [Alphabet]
  • Node2, with the label [Google]
  • Node3, with the labels [Alphabet, Google]

Then the connector creates the following tables:

  • Alphabet: a table containing information for nodes that only have the label name "Alphabet".
  • Alphabet__Google: a table containing information for nodes that only have the label names [Alphabet, Google] or [Google, Alphabet].
  • Google: a table containing information for nodes that only have the label name "Google".

Note:

  • The connector only creates tables for nodes that have labels.
  • The default separator between the node label names is two underscores ( __ ). To use a different separator, set the LabelSeparator configuration property. For more information, see LabelSeparator.

Each node table contains a virtual column named _NodeId_ that contains the ID for the representative node.

Relationships

The connector creates one table for each distinct combination of source label, relationship type, and target label.

For example, if the data store contains a relationship between the source labels Google and Alphabet, the relationship type Companies, and the target label Search, the connector creates the table Google__Alphabet_COMPANIES_Search.

Note:

  • The default separator between the node label names is two underscores ( __ ). To use a different separator, set the LabelSeparator configuration property.
  • The default separator between node label names and relationship names is an underscore ( _ ). To use a different separator, set the RelNodeSeparator configuration property.

For more information, see LabelSeparator or RelNodeSeparator.

Each relationship table contains the following virtual columns:

Column name Content

_SourceId_

The ID for the source node being connected.

_TargetId_

The ID for the target node being connected.