Open In App

Neo4j | Values and Types

Improve
Improve
Like Article
Like
Save
Share
Report

The Neo4j works by Cypher language and the Cypher language provides first class support for number of data types. All the number data types fall in different categories which will be described below with the subsection of those categories.

Data types in Neo4j:
There are: Property types, Structural types, and Composite types. These are explained as following below.

  1. Property Types:
    The Neo4j property types can be returned by cypher queries, can be used as a parameters, also can be stored as properties and can be constructed with Cypher literals.

    Property types is made of:

    • Number, an abstract type, which has the subtypes of Integer and Float
    • String
    • Boolean
    • The spatial type Point
    • Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration



    The adjective numeric is used to describe Cypher functions or the expressions. It indicates that the any types of number (Integer or float) applies. Homogeneous lists of all simple types can be stored as properties, but lists in general (Composite types) cannot be stored. The cypher language also provides the pass-through supports for byte arrays that can be stored property values but it does not have literal representation.

    Sorting of Special character:
    The Neo4j string that contains special character which don’t belong to (BMP stands for Basic Multilingual Plane) can have inconsistent ordering.
    Note: BMP is a subset(common character of common languages) of all characters defined in Unicode. Those are don’t belongs to BMP they belongs to Supplementary Multilingual Plane or the Supplementary Ideographic Plane.

  2. Structural Types:
    It can be returned by cypher queries, can’t used as a parameters, also can’t stored as properties and can’t constructed with Cypher literals.

    Structural types is made of:
    This contains nodes, Relationships and paths. The nodes are made of id, labels and maps, each nodes are denoted in circles and all the nodes can be connected that create maps and belongs to labels. Relationships are made of Id, Type, Map and Id of the start and end nodes. The last one Paths are made of an alternating sequence of nodes and relationships.

    Note: All the Nodes, relationships, and paths are returned as a result of pattern matching. Remember that the labels are not values they are form of pattern syntax.

  3. Composite Types:
    The Neo4j Composite types can be returned by cypher queries, can be used as a parameters, also can’t stored as properties and can be constructed with Cypher literals.

    Composite types are made are List and maps .

    • List:
      All the lists are heterogeneous, ordered collections of values, each of which has any kind property, structural or composite type.
    • maps:
      The maps are heterogeneous, unordered collections of (key, value) pairs, where the key is a String and the value has any property, structural or composite type.

Reference: https://neo4j.com/docs/cypher-manual/current/syntax/values/#composite-types


Last Updated : 05 Nov, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads