Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/ Documentation version: v5.3.2 # Data types A data type, also called a value type, describes the values that an expression, variable, parameter, query result, or property can contain. When you [create a graph type](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/), you must specify the data type of each property value. The property value type determines what the property can store. Not every value type can be used to define a node or edge property. For example, `NODE` and `EDGE` represent graph element references, and `NULL` represents the absence of a material value. They cannot be used as property types. ## Categories The following table groups the value types supported by NebulaGraph Database Developer Edition according to their primary usage: | Category | Types | Property type | Primary usage | Basic property value types | [Numeric](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/numeric-type/), [character string](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/c-string-type/), [Boolean](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/boolean-type/), [temporal](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/temporal-type/), and [vector](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/vector-type/) | Yes | Node or edge properties, variables, parameters, and expressions | Container and composite value types | [List](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/list-type/), [set](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/set-type/), [map](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/map-type/), and [spatial](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/geo-type/) | Depends on the specific value type and whether the graph is persistent or temporary | Properties, variables, and expressions | Query result types | [Path](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/path-type/) and [record](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/record-type/) | No | Path matching, records, and table results | Table type | [Table](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/table-type/) | No | Table variables, procedure parameters, and intermediate or query results | Graph element reference types | [Node and edge](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/graph-element-reference-type/) | No | `MATCH` variables, procedure parameters, and query results | Immaterial value type | [NULL](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/null-type/) | No | `NULL` expressions and type inference ## Property value type restrictions This section covers only value types that can define node or edge properties. `NODE`, `EDGE`, `PATH`, `RECORD`, `TABLE`, and `NULL` cannot be used as property types and are therefore not included in the following table. Temporary graphs in NebulaGraph Database Developer Edition are mutable temporary graphs that support data modification through DML statements (INSERT, SET, DELETE). However, mutable temporary graphs have the following restrictions on property data types: | Data type | Persistent graph | Temporary graph | Notes | Set | ✅ | ❌ | Not supported as a temporary graph property type | Map | ✅ | ❌ | Not supported as a temporary graph property type | Spatial (`GEOGRAPHY`) | ✅ | ❌ | Not supported as a temporary graph property type | List | ✅ | ✅* | Supported, but element types must also be of supported types (recursive check) | Other types | ✅ | ✅ | Numeric, string, boolean, temporal, vector, etc. are all supported Caution If the graph type referenced by a temporary graph uses `SET`, `MAP`, or `GEOGRAPHY` type properties, an error will be raised when creating the temporary graph. Ensure that the graph type referenced by the temporary graph only contains supported property types. For the index types supported by each property value type, see [Property value types and index support](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/#property_value_types_and_index_support). ## Type conversion GQL supports type conversion between different data types. For more information, see [Cast value expression](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/fe/expressions/cast/). ## Operators Operators are used to perform operations on data. The type of operation that you can perform often depends on the data type. For more information about the operators that can be used with each data type, see [Operators](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/fe/operators/). ## Value constraints After a data type is specified for a property value, you can add constraints on the values that can be stored in the property. Supported constraints include nullability, default value, and uniqueness. ### Nullability The data type of a property value can be nullable or non-nullable. If a data type is nullable, the property value of the data type can be value `NULL`. `NULL` is a special value that indicates the absence of a value and is not the same as an empty string or zero. By default, the property value of a data type is nullable. For the distinction among the null value, the `NULL` type, and nullability, see [NULL type](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-types/null-type/). If a data type is non-nullable, the property value of the data type CANNOT be the value `NULL` and must be a valid value. For more information about how to specify the nullability of a data type, see [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/). ### Default value You can set a default value for a data type. If the data type of a property value is nullable, the default value is `NULL`. If the data type of a property value is non-nullable, the default value is the specified value. For more information about how to specify the default value of a data type, see [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/). ### Uniqueness When you define the properties for a node type or an edge type, the property values may be subject to certain uniqueness constraints. Note Property names must be unique within a node type or an edge type. If a property is solely declared as the `PRIMARY KEY` of a node type or the `MULTIEDGE KEY` of an edge type, the value of this property must be unique among all nodes of the node type or all edges of the edge type respectively. If multiple properties are jointly declared as the `PRIMARY KEY` of a node type or the `MULTIEDGE KEY` of an edge type, the combinations of these property values must be unique among all nodes of the node type or all edges of the edge type respectively. For more information about how to specify the primary key or multi-edge key, see [CREATE GRAPH TYPE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph-type/create/).