value
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
value
keyword -
Object — one of the value types
Syntax
<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 value type query example
define
callsign sub attribute, value string;