Integer

A 64-bit signed integer.

Define an integer attribute type

#!test[schema]
define
  attribute total-likes value integer;

Insert data that has an integer attribute

#!test[schema]
#{{
define
  entity post, owns total-likes;
#}}
#!test[write]
insert
  $p isa post, has total-likes 42;

Insert a standalone integer attribute

#!test[write]
insert
  $_ isa total-likes 42;

Specify valid values for an integer attribute type

#!test[schema]
define
  attribute star-rating value integer @values(1, 2, 3, 4, 5);

Specify valid values for owning an integer attribute type

#!test[schema]
define
  entity review owns star-rating @values(1, 3, 5);

Specify range of valid values for an integer attribute type

#!test[schema]
define
  attribute publication-year value integer @range(1900..2100);

Specify range of valid values for owning an integer attribute type

#!test[schema]
define
  entity book owns publication-year @range(2000..2100);

Retrieve data by integer attribute

#!test[read]
match
  $p isa post, has total-likes 42;