Skip to content

TypeDBLiteValue

Defined in: libs/runtime/src/interpreter.ts:159

A result cell: a concept, the way the TypeDB driver hands one back. A cell carries what it is:

  • an entity or relation: its iid and its actual type — writer, not the person the query wrote, because TypeDB answers the instance’s own type;
  • an attribute: its actual type and its value;
  • a value: a value type and a value (an expression’s or a reducer’s result);
  • a type: a schema type by its label — person, or a role type as employment:employee — which is what match $x sub person; answers. It has no iid and no value.

The three as…() readers work on an attribute or value cell and throw on a thing or a type, with the driver’s own message shape. A repository that projects a thing reads iid and type and nothing else.

Properties

Name Description
type The type label: a thing’s type, an attribute’s type, or a value’s value type.

Accessors

Name Description
iid A thing’s internal id.
iidHex The concept’s iid as TypeQL writes it — 0x…, what iid($x) answers and $x iid … matches (see iid.ts).
label The type cell’s label.

Methods

Name Description
asDouble() An attribute’s or value’s number as a double.
asInteger() An attribute’s or value’s integer.
asString() An attribute’s or value’s text.
isAttribute() Whether this cell is an attribute.
isEntity() Whether this cell is an entity.
isRelation() Whether this cell is a relation.
isThing() Whether this cell is a thing, an entity or a relation: one with an iid.
isType() Whether this cell is a schema type, as match $x sub person; answers.
isValue() Whether this cell is a value: the result of an expression or a reducer.
toString() A stable rendering for every kind — what a shell prints and a set comparison keys on.
attribute() An attribute cell: its type, and its value as text.
entity() An entity cell: its iid and its own type.
relation() A relation cell: its iid and its own type.
type() A schema type, by label — person, or a role type as relation:role.
value() A value cell: the result of an expression or a reducer, with its value type and its value as text.

readonly type: string

Defined in: libs/runtime/src/interpreter.ts:163

The type label: a thing’s type, an attribute’s type, or a value’s value type.

get iid(): number

Defined in: libs/runtime/src/interpreter.ts:230

A thing’s internal id. Throws on an attribute or value cell, which have none.

number


get iidHex(): string

Defined in: libs/runtime/src/interpreter.ts:241

The concept’s iid as TypeQL writes it — 0x…, what iid($x) answers and $x iid … matches (see iid.ts). A thing or an attribute has one; a value or a type does not.

string


get label(): string

Defined in: libs/runtime/src/interpreter.ts:199

The type cell’s label. Throws on any other kind — a thing has a type, not a label.

string

asDouble(): number

Defined in: libs/runtime/src/interpreter.ts:289

An attribute’s or value’s number as a double.

number

on a thing or a type, and on a value that is not a number.


asInteger(): number

Defined in: libs/runtime/src/interpreter.ts:276

An attribute’s or value’s integer. It throws rather than coercing, matching the driver.

number

on a thing or a type, and on a value that is not an integer.


asString(): string

Defined in: libs/runtime/src/interpreter.ts:260

An attribute’s or value’s text.

string

on a thing or a type, which have no string value.


isAttribute(): boolean

Defined in: libs/runtime/src/interpreter.ts:220

Whether this cell is an attribute.

boolean


isEntity(): boolean

Defined in: libs/runtime/src/interpreter.ts:205

Whether this cell is an entity.

boolean


isRelation(): boolean

Defined in: libs/runtime/src/interpreter.ts:210

Whether this cell is a relation.

boolean


isThing(): boolean

Defined in: libs/runtime/src/interpreter.ts:215

Whether this cell is a thing, an entity or a relation: one with an iid.

boolean


isType(): boolean

Defined in: libs/runtime/src/interpreter.ts:194

Whether this cell is a schema type, as match $x sub person; answers.

boolean


isValue(): boolean

Defined in: libs/runtime/src/interpreter.ts:225

Whether this cell is a value: the result of an expression or a reducer.

boolean


toString(): string

Defined in: libs/runtime/src/interpreter.ts:299

A stable rendering for every kind — what a shell prints and a set comparison keys on.

string


static attribute(type, value): TypeDBLiteValue

Defined in: libs/runtime/src/interpreter.ts:179

An attribute cell: its type, and its value as text.

string

string

TypeDBLiteValue


static entity(iid, type): TypeDBLiteValue

Defined in: libs/runtime/src/interpreter.ts:169

An entity cell: its iid and its own type.

number

string

TypeDBLiteValue


static relation(iid, type): TypeDBLiteValue

Defined in: libs/runtime/src/interpreter.ts:174

A relation cell: its iid and its own type.

number

string

TypeDBLiteValue


static type(label): TypeDBLiteValue

Defined in: libs/runtime/src/interpreter.ts:189

A schema type, by label — person, or a role type as relation:role.

string

TypeDBLiteValue


static value(valueType, value): TypeDBLiteValue

Defined in: libs/runtime/src/interpreter.ts:184

A value cell: the result of an expression or a reducer, with its value type and its value as text.

string

string

TypeDBLiteValue

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.