Keyword glossary
Schema queries
define-
Denotes the beginning of a Define query, used to add new types, constraints, or functions to the schema.
undefine-
Denotes the beginning of a Undefine query, used to remove existing types, constraints, or functions from the schema.
redefine-
Denotes the beginning of a Redefine query, used to modify existing types, constraints, or functions in the schema.
Data pipeline stages
Data manipulation stages
match-
Denotes the beginning of a Match stage in a data pipeline, sed to match existing data instances in the database.
fetch-
Denotes the beginning of a Fetch stage in a data pipeline, used to format the output of a data pipeline into JSON.
insert-
Denotes the beginning of an Insert stage in a data pipeline, used to add new data instances into the database.
delete-
Denotes the beginning of a Delete stage in a data pipeline, used to remove existing data instances from the database.
update-
Denotes the beginning of an Update stage in a data pipeline, used to modify existing data instances in the database.
put-
Denotes the beginning of a Put stage in a data pipeline, used to add new data instances to the database if they do not already exist.
Stream manipulation stages
select-
Denotes the beginning of a Select operator in a data pipeline, used to keep specified variables for each element of the data stream and remove the rest.
require-
Denotes the beginning of a Require stage in a data pipeline, used to remove elements from the data stream that do not contain specified optional variables.
sort-
Denotes the beginning of a Sort operator in a data pipeline, used to order the elements of the data stream based on the value of specified variables.
limit-
Denotes the beginning of a Limit operator in a data pipeline, used to keep a specified number of elements of the data stream and remove the rest.
offset-
Denotes the beginning of an Offset operator in a data pipeline, used to remove a specified number of elements from the data stream.
reduce-
Denotes the beginning of a Reduce operator in a data pipeline, used to perform reduction operations on the data stream according to specified groupings.
Special stages
with-
Denotes the beginning of a Preamble in a data pipeline, used to define functions on an ad-hoc basis for use in the data pipeline.
Pattern logic
or-
Constructs a disjunction in a query pattern.
not-
Constructs a negation in a query pattern.
try-
Constructs an optional in a query pattern.
Statements
Type definition statements
entity-
Constructs an
entitystatement, used to define a new entity type. relation-
Constructs a
relationstatement, used to define a new relation type. attribute-
Constructs an
attributestatement, used to define a new attribute type. struct-
Constructs a
structstatement, used to define a new struct type. fun-
Constructs a
funstatement, used to define a new function.
Constraint definition statements
sub/sub!-
Constructs a
substatement, used to define the supertype of a type. relates/relates … as-
Constructs a
relatesstatement, used to define a new role for a relation type. plays-
Constructs a
playsstatement, used to define a new role player for a role. value-
Constructs a
valuestatement, used to define the value type of an attribute type. owns-
Constructs an
ownsstatement, used to define a new owner of an attribute type. alias-
Constructs an
aliasstatement, used to define an alias label for a type.
Instance statements
isa/isa!-
Constructs an
isastatement, used to specify the type of a data instance. links-
Constructs a
linksstatement, used to specify the role players in a relation. has-
Constructs a
hasstatement, used to specify an attribute of an entity or relation. is-
Constructs an
isstatement, used to specify that two variables represent the same data instance. let … =-
Constructs a
let … =statement, used to assign the result of an expression to a variable. let … in-
Constructs a
let … instatement, used to assign a stream or list element to a variable. contains-
Constructs a 3.x@typeql-reference::statements/comparisons.adoc#_string_comparison, used to specify that a string contains a specified substring.
like-
Constructs a 3.x@typeql-reference::statements/comparisons.adoc#_string_comparison, used to specify that a string matches a specified regex pattern.
Identity statements
label-
Constructs a
labelstatement, used to identify a type by its label. iid-
Constructs an
iidstatement, used to identify a data instance by its internal ID.
Annotations
Cardinality constraints
@card-
Describes a
@cardannotation, used to specify cardinality ranges for roles and ownerships. @cascade-
Describes a
@cascadeannotation, used to specify behavior when deleting a relation’s role players. @independent-
Describes an
@independentannotation, used to prevent attributes without owners from being deleted automatically.
Modality constraints
@abstract-
Describes an
@abstractannotation, used to specify that a type or role is abstract. @key-
Describes a
@keyannotation, used to specify key attributes for entities and relations. @subkey-
Describes a
@subkeyannotation, used to specify composite keys built from multiple attributes. @unique-
Describes a
@uniqueannotation, used to specify unique attributes for entities and relations.
Value constraints
@values-
Describes a
@valuesannotation, used to specify a set of permitted values for attributes. @range-
Describes a
@rangeannotation, used to specify a range of permitted values for attributes. @regex-
Describes a
@regexannotation, used to specify a regex pattern for permitted values of attributes. @distinct-
Describes a
@distinctannotation, used to restrict an owned list of attributes to distinct values.
Reductions
check-
Reduces the stream to a boolean value, indicating whether it contains any elements. See Reduce operator for more information.
first-
Reduces the stream to the first occurrence of a specified variable. See Reduce operator for more information.
count-
Reduces the stream to the number of occurrences of a specified variable. See Reduce operator for more information.
max-
Reduces the stream to the maximum value of a specified variable. See Reduce operator for more information.
min-
Reduces the stream to the minimum value of a specified variable. See Reduce operator for more information.
mean-
Reduces the stream to the arithmetic mean of a specified variable. See Reduce operator for more information.
median-
Reduces the stream to the median of a specified variable. See Reduce operator for more information.
std-
Reduces the stream to the (population) standard deviation of a given variable. See Reduce operator for more information.
sum-
Reduces the stream to the sum over a specified variable. See Reduce operator for more information.
list-
Reduces the stream to a list of occurrences of a specified variable. See Reduce operator for more information.
Value types
boolean-
Declares the values of an attribute type to be booleans. See Value types for more information.
integer-
Declares the values of an attribute type to be 64-bit signed integers. See Value types for more information.
double-
Declares the values of an attribute type to be 64-bit floating point numbers. See Value types for more information.
decimal-
Declares the values of an attribute type to be decimals, comprising a 64-bit signed integer component and 64-bit unsigned component representing up to 19 decimal places. See Value types for more information.
datetime-tz-
Declares the values of an attribute type to be nanosecond-precision ISO timestamps with timezones. See Value types for more information.
datetime-
Declares the values of an attribute type to be nanosecond-precision ISO timestamps without timezones. See Value types for more information.
date-
Declares the values of an attribute type to be ISO dates. See Value types for more information.
duration-
Declares the values of an attribute type to be ISO durations. See Value types for more information.
string-
Declares the values of an attribute type to be variable length UTF-8 encoded strings. See Value types for more information.
Built-in functions
round(…)-
Rounding function, returns the provided numeric argument rounded to the nearest integer. See Operators for more information.
ceil(…)-
Ceiling function, returns the provided numeric argument rounded to the nearest greater integer. See Operators for more information.
floor(…)-
Floor function, returns the provided numeric argument rounded to the nearest lesser integer. See Operators for more information.
abs(…)-
Modulus function, returns the absolute value of the provided numeric argument. See Operators for more information.
length(…)-
Length function, returns the length of the provided list argument. See Operators for more information.
min(…)-
Minimum function, returns the minimum value of the provided list argument. See Operators for more information.
max(…)-
Maximum function, returns the maximum value of the provided list argument. See Operators for more information.
Miscellaneous
asc-
Used to specify ascending order for Sort stages in data pipelines.
desc-
Used to specify descending order for Sort stages in data pipelines.
return-
Denotes the return signature of a function. See Writing functions for more information.
of-
Used to remove ownership of attributes and players of roles in Delete stages of data pipelines.
from-
Used to remove interfaces, role specialisation, and annotations in Undefine queries.
in-
Used to access stream or list elements. See
let … instatement for more information. as-
Used to specialise a role. See
relatesstatement for more information.