value
|
This documentation is not current - it is for TypeDB 2.x, which is no longer supported. View the documentation for TypeDB 3.x: |
The value keyword is used in TypeQL schema to define the value type of an attribute type.
Syntax
The syntax of a value statement includes:
-
Subject — attribute type label
-
Predicate — the
valuekeyword -
Object — one of the value types
<attribute-type> value <value-type>;
Behavior
TypeQL statements with the value keyword can be used only in Define queries.
The value keyword adds a constraint on values of attributes of a given attribute type
to be of the selected value type only.
Usage in a schema definition
For this example, use a database with the IAM schema and sample data loaded.
Since in Define queries you can’t use variables, the subject of a value statement can only be
an attribute type label.
For example, to define a new attribute type callsign with a value type of string, use:
define
callsign sub attribute, value string;