TypeDB 3.0 is live! Get started for free.

Node.js driver API reference

Connection

TypeDB

Namespace variables
Name

DEFAULT_ADDRESS

cloudDriver

cloudDriver(addresses, credential): Promise<TypeDBDriver>
nodejs

Creates a connection to TypeDB Cloud, authenticating with the provided credentials.

Input parameters
Name Description Type

addresses

List of addresses of the individual TypeDB Cloud servers. As long one specified address is provided, the driver will discover the other addresses from that server. Alternatively, a translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s) may be provided.

string | string[] | Record<string, string>

credential

The credentials to log in, and encryption settings. See TypeDBCredential Examples const driver = TypeDB.cloudDriver(["127.0.0.1:11729"], new TypeDBCredential(username, password)); Copy

TypeDBCredential

Returns

Promise<TypeDBDriver>

coreDriver

coreDriver(address?): Promise<TypeDBDriver>
nodejs

Creates a connection to TypeDB.

Input parameters
Name Description Type

address

Address of the TypeDB server. Examples const driver = TypeDB.coreDriver("127.0.0.1:11729"); Copy

string = DEFAULT_ADDRESS

Returns

Promise<TypeDBDriver>

TypeDBDriver

Fields
Name Type Description

databases

DatabaseManager

The DatabaseManager for this connection, providing access to database management methods.

users

UserManager

The UserManager instance for this connection, providing access to user management methods. Only for TypeDB Cloud.

close

close(): Promise<void>
nodejs

Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed.

Returns

Promise<void>

Code examples
driver.close()
nodejs

isOpen

isOpen(): boolean
nodejs

Checks whether this connection is presently open.

Returns

boolean

Code examples
driver.isOpen()
nodejs

session

session(database, type, options?): Promise<TypeDBSession>
nodejs
Input parameters
Name Description Type

database

string

type

SessionType

options

TypeDBOptions

Returns

Promise<TypeDBSession>

user

user(): Promise<User>
nodejs

Returns the logged-in user for the connection. Only for TypeDB Cloud.

Returns

Promise<User>

Code examples
driver.user()
nodejs

TypeDBCredential

User credentials and TLS encryption settings for connecting to TypeDB Cloud.

password

get password(): string
nodejs
Returns

string

tlsRootCAPath

get tlsRootCAPath(): string
nodejs
Returns

string

username

get username(): string
nodejs
Returns

string

new TypeDBCredential

new TypeDBCredential(username, password, tlsRootCAPath?): TypeDBCredential
nodejs
Input parameters
Name Description Type

username

The name of the user to connect as

string

password

The password for the user

string

tlsRootCAPath

Path to the CA certificate to use for authenticating server certificates.

string

Returns

TypeDBCredential

DatabaseManager

Provides access to all database management methods.

all

all(): Promise<Database[]>
nodejs

Retrieves all databases present on the TypeDB server

Returns

Promise<Database[]>

Code examples
driver.databases().all()
nodejs

contains

contains(name): Promise<boolean>
nodejs

Checks if a database with the given name exists

Input parameters
Name Description Type

name

The database name to be checked

string

Returns

Promise<boolean>

Code examples
driver.databases().contains(name)
nodejs

create

create(name): Promise<void>
nodejs

Create a database with the given name

Input parameters
Name Description Type

name

The name of the database to be created

string

Returns

Promise<void>

Code examples
driver.databases().create(name)
nodejs

get

get(name): Promise<Database>
nodejs

Retrieve the database with the given name.

Input parameters
Name Description Type

name

The name of the database to retrieve

string

Returns

Promise<Database>

Code examples
driver.databases().get(name)
nodejs

Database

Fields
Name Type Description

name

string

The database name as a string.

preferredReplica

Replica

The preferred replica for this database. Operations which can be run on any replica will prefer to use this replica. Only works in TypeDB Cloud

primaryReplica

Replica

The primary replica for this database. Only works in TypeDB Cloud

replicas

Replica

The Replica instances for this database. Only works in TypeDB Cloud

delete

delete(): Promise<void>
nodejs

Deletes this database.

Returns

Promise<void>

Code examples
database.delete()
nodejs

schema

schema(): Promise<string>
nodejs

Returns a full schema text as a valid TypeQL define query string.

Returns

Promise<string>

Code examples
database.schema()
nodejs

Replica

The metadata and state of an individual raft replica of a database.

Fields
Name Type Description

databaseName

string

The database for which this is a replica.

preferred

boolean

Checks whether this is the preferred replica of the raft cluster. If true, Operations which can be run on any replica will prefer to use this replica.

primary

boolean

Checks whether this is the primary replica of the raft cluster.

server

string

The server hosting this replica

term

number

The raft protocol ‘term’ of this replica.

UserManager

Provides access to all user management methods.

all

all(): Promise<User[]>
nodejs

Retrieves all users which exist on the TypeDB server.

Returns

Promise<User[]>

Code examples
driver.users.all()
nodejs

contains

contains(name): Promise<boolean>
nodejs

Checks if a user with the given name exists.

Input parameters
Name Description Type

name

string

Returns

Promise<boolean>

Code examples
driver.users.contains(username)
nodejs

create

create(name, password): Promise<void>
nodejs

Create a user with the given name & password.

Input parameters
Name Description Type

name

string

password

The password of the user to be created

string

Returns

Promise<void>

Code examples
driver.users.create(username, password)
nodejs

delete

delete(name): Promise<void>
nodejs

Deletes a user with the given name.

Input parameters
Name Description Type

name

string

Returns

Promise<void>

Code examples
driver.users.delete(username)
nodejs

get

get(name): Promise<User>
nodejs

Retrieve a user with the given name.

Input parameters
Name Description Type

name

string

Returns

Promise<User>

Code examples
driver.users.get(username)
nodejs

passwordSet

passwordSet(name, password): Promise<void>
nodejs

Sets a new password for a user. This operation can only be performed by administrators.

Input parameters
Name Description Type

name

string

password

The new password

string

Returns

Promise<void>

Code examples
driver.users.passwordSet(username, password)
nodejs

User

User class

Fields
Name Type Description

passwordExpirySeconds

number

The number of seconds remaining till this user’s current password expires.

username

string

The name of this user.

passwordUpdate

passwordUpdate(oldPassword, newPassword): Promise<void>
nodejs

Updates the user’s password.

Input parameters
Name Description Type

oldPassword

Old password

string

newPassword

New password

string

Returns

Promise<void>

Code examples
user.passwordUpdate("oldpassword", "nEwp@ssw0rd");
nodejs

Session

TypeDBSession

Fields
Name Type Description

database

Database

The database of the session. Examples session.database() Copy

options

TypeDBOptions

Gets the options for the session

type

SessionType

The current session’s type (SCHEMA or DATA)

close

close(): Promise<void>
nodejs

Closes the session. Before opening a new session, the session currently open should first be closed.

Returns

Promise<void>

Code examples
session.close()
nodejs

isOpen

isOpen(): boolean
nodejs

Checks whether this session is open.

Returns

boolean

Code examples
session.isOpen()
nodejs

onClose

onClose(callback): void
nodejs

Registers a callback function which will be executed when this session is closed.

Input parameters
Name Description Type

callback

The callback function.

(() ⇒ Promise<void>)

Returns

void

Code examples
session.onClose(function)
nodejs

onReopen

onReopen(callback): void
nodejs

Registers a callback function which will be executed when this session is reopened. A session may be closed if it times out, or loses the connection to the database. In such situations, the session is reopened automatically when opening a new transaction.

Input parameters
Name Description Type

callback

The callback function.

(() ⇒ Promise<void>)

Returns

void

Code examples
session.onReopen(function)
nodejs

transaction

transaction(type, options?): Promise<TypeDBTransaction>
nodejs

Opens a transaction to perform read or write queries on the database connected to the session.

Input parameters
Name Description Type

type

TransactionType

options

Options for the session

TypeDBOptions

Returns

Promise<TypeDBTransaction>

Code examples
session.transaction(transactionType, options)
nodejs

SessionType

This class is used to specify the type of the session.

Namespace variables
Name

DATA

SCHEMA

isData

isData(): boolean
nodejs
Returns

boolean

isSchema

isSchema(): boolean
nodejs
Returns

boolean

TypeDBOptions

TypeDB session and transaction options. TypeDBOptions object can be used to override the default server behaviour. Options could be specified either as constructor arguments or using setters.

explain

get explain(): boolean
nodejs

If set to True, enables explanations for queries. Only affects read transactions.

Returns

boolean

explain

set explain(value): void
nodejs

If set to True, enables explanations for queries. Only affects read transactions.

Returns

void

infer

get infer(): boolean
nodejs

If set to True, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.

Returns

boolean

infer

set infer(value): void
nodejs

If set to True, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.

Returns

void

parallel

get parallel(): boolean
nodejs

If set to True, the server uses parallel instead of single-threaded execution.

Returns

boolean

parallel

set parallel(value): void
nodejs

If set to True, the server uses parallel instead of single-threaded execution.

Returns

void

prefetch

get prefetch(): boolean
nodejs

If set to True, the first batch of answers is streamed to the driver even without an explicit request for it.

Returns

boolean

prefetch

set prefetch(value): void
nodejs

If set to True, the first batch of answers is streamed to the driver even without an explicit request for it.

Returns

void

prefetchSize

get prefetchSize(): number
nodejs

If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.

Returns

number

prefetchSize

set prefetchSize(value): void
nodejs

If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.

Returns

void

readAnyReplica

get readAnyReplica(): boolean
nodejs

If set to True, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.

Returns

boolean

readAnyReplica

set readAnyReplica(value): void
nodejs

If set to True, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.

Returns

void

schemaLockAcquireTimeoutMillis

get schemaLockAcquireTimeoutMillis(): number
nodejs

If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.

Returns

number

schemaLockAcquireTimeoutMillis

set schemaLockAcquireTimeoutMillis(value): void
nodejs

If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.

Returns

void

sessionIdleTimeoutMillis

get sessionIdleTimeoutMillis(): number
nodejs

If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.

Returns

number

sessionIdleTimeoutMillis

set sessionIdleTimeoutMillis(millis): void
nodejs

If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.

Returns

void

traceInference

get traceInference(): boolean
nodejs

If set to True, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False.

Returns

boolean

traceInference

set traceInference(value): void
nodejs

If set to True, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False.

Returns

void

transactionTimeoutMillis

get transactionTimeoutMillis(): number
nodejs

If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Returns

number

transactionTimeoutMillis

set transactionTimeoutMillis(millis): void
nodejs

If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Returns

void

new TypeDBOptions

new TypeDBOptions(obj?): TypeDBOptions
nodejs
Input parameters
Name Description Type

obj

If set to True, enables explanations for queries. Only affects read transactions.

{ explain?: boolean; infer?: boolean; parallel?: boolean; prefetch?: boolean; prefetchSize?: number; readAnyReplica?: boolean; schemaLockAcquireTimeoutMillis?: number; sessionIdleTimeoutMillis?: number; traceInference?: boolean; transactionTimeoutMillis?: number; } = {}

Returns

TypeDBOptions

Opts

Interface for TypeDBOptions. Use TypeDBOptions instead.

Fields
Name Type Description

explain

boolean

If set to True, enables explanations for queries. Only affects read transactions.

infer

boolean

If set to True, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.

parallel

boolean

If set to True, the server uses parallel instead of single-threaded execution.

prefetch

boolean

If set to True, the first batch of answers is streamed to the driver even without an explicit request for it.

prefetchSize

number

If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.

readAnyReplica

boolean

If set to True, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.

schemaLockAcquireTimeoutMillis

number

If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.

sessionIdleTimeoutMillis

number

If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.

traceInference

boolean

If set to True, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False.

transactionTimeoutMillis

number

If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Transaction

TypeDBTransaction

Fields
Name Type Description

concepts

ConceptManager

The ConceptManager for this transaction, providing access to all Concept API methods.

logic

LogicManager

The LogicManager for this Transaction, providing access to all Concept API - Logic methods.

options

TypeDBOptions

The options for the transaction.

query

QueryManager

TheQueryManager for this Transaction, from which any TypeQL query can be executed.

type

TransactionType

The transaction’s type (READ or WRITE)

close

close(): Promise<void>
nodejs

Closes the transaction.

Returns

Promise<void>

Code examples
transaction.close()
nodejs

commit

commit(): Promise<void>
nodejs

Commits the changes made via this transaction to the TypeDB database. Whether or not the transaction is commited successfully, it gets closed after the commit call.

Returns

Promise<void>

Code examples
transaction.commit()
nodejs

isOpen

isOpen(): boolean
nodejs

Checks whether this transaction is open.

Returns

boolean

Code examples
transaction.isOpen()
nodejs

onClose

onClose(callback): void
nodejs

Registers a callback function which will be executed when this transaction is closed.

Input parameters
Name Description Type

callback

The callback function.

((error?) ⇒ Promise<void>)

Returns

void

Code examples
transaction.onClose(function);
nodejs

rollback

rollback(): Promise<void>
nodejs

Rolls back the uncommitted changes made via this transaction.

Returns

Promise<void>

Code examples
transaction.rollback()
nodejs

TransactionType

This class is used to specify the type of transaction.

Namespace variables
Name

READ

WRITE

isRead

isRead(): boolean
nodejs

Checks whether this is the READ TransactionType

Returns

boolean

isWrite

isWrite(): boolean
nodejs

Checks whether this is the WRITE TransactionType

Returns

boolean

QueryManager

Provides methods for executing TypeQL queries in the transaction.

define

define(query, options?): Promise<void>
nodejs

Performs a TypeQL Define query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Define query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Promise<void>

Code examples
transaction.query.define(query, options)
nodejs

delete

delete(query, options?): Promise<void>
nodejs

Performs a TypeQL Delete query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Delete query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Promise<void>

Code examples
transaction.query.delete(query, options)
nodejs

explain

explain(explainable, options?): Stream<Explanation>
nodejs

Performs a TypeQL Explain query in the transaction.

Input parameters
Name Description Type

explainable

The Explainable to be explained

Explainable

options

Specify query options

TypeDBOptions

Returns

Stream<Explanation>

Code examples
transaction.query.explain(explainable, options)
nodejs

fetch

fetch(query, options?): Stream<JSONObject>
nodejs

Performs a TypeQL Fetch query in the transaction.

Returns a stream of JSON Objects of strings to JSON. JSON can be: Arrays of JSON, Objects of strings to JSON, or primitives such as strings or numbers or booleans.

Input parameters
Name Description Type

query

The TypeQL Fetch query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Stream<JSONObject>

Code examples
transaction.query.fetch(query, options)
nodejs

get

get(query, options?): Stream<ConceptMap>
nodejs

Performs a TypeQL Get query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Get query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Stream<ConceptMap>

Code examples
transaction.query.get(query, options)
nodejs

getAggregate

getAggregate(query, options?): Promise<Value>
nodejs

Performs a TypeQL Get Aggregate query in the transaction. Returns an empty promise if the aggregate was not well-defined (such as stddev of 0 elements).

Input parameters
Name Description Type

query

The TypeQL Get Aggregate query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Promise<Value>

Code examples
transaction.query.getAggregate(query, options)
nodejs

getGroup

getGroup(query, options?): Stream<ConceptMapGroup>
nodejs

Performs a TypeQL Get Group query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Get Group query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Stream<ConceptMapGroup>

Code examples
transaction.query.getGroup(query, options)
nodejs

getGroupAggregate

getGroupAggregate(query, options?): Stream<ValueGroup>
nodejs

Performs a TypeQL Get Group Aggregate query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Get Group Aggregate query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Stream<ValueGroup>

Code examples
transaction.query.getGroupAggregate(query, options)
nodejs

insert

insert(query, options?): Stream<ConceptMap>
nodejs

Performs a TypeQL Insert query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Insert query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Stream<ConceptMap>

Code examples
transaction.query.insert(query, options)
nodejs

undefine

undefine(query, options?): Promise<void>
nodejs

Performs a TypeQL Undefine query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Undefine query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Promise<void>

Code examples
transaction.query.undefine(query, options)
nodejs

update

update(query, options?): Stream<ConceptMap>
nodejs

Performs a TypeQL Update query in the transaction.

Input parameters
Name Description Type

query

The TypeQL Update query to be executed

string

options

Specify query options

TypeDBOptions

Returns

Stream<ConceptMap>

Code examples
transaction.query.update(query, options)
nodejs

Answer

ConceptMapGroup

Contains an element of the group query result.

Fields
Name Type Description

conceptMaps

ConceptMap

The ConceptMaps of the group.

owner

Concept

The concept that is the group owner.

ConceptMap

Contains a mapping of variables to concepts.

Fields
Name Type Description

explainables

Explainables

The Explainables object for this ConceptMap, exposing which of the concepts in this ConceptMap are explainable.

concepts

concepts(): IterableIterator<Concept>
nodejs

Produces an iterator over all concepts in this ConceptMap.

Returns

IterableIterator<Concept>

Code examples
conceptMap.concepts()
nodejs

get

get(variable): Concept
nodejs

Retrieves a concept for a given variable name.

Input parameters
Name Description Type

variable

The string representation of a variable

string

Returns

Concept

Code examples
conceptMap.get(variable)
nodejs

map

map(): Map<string, Concept>
nodejs

Returns the inner Map where keys are query variables, and values are concepts.

Returns

Map<string, Concept>

Code examples
conceptMap.map()
nodejs

variables

variables(): IterableIterator<string>
nodejs

Produces an iterator over all variables in this ConceptMap.

Returns

IterableIterator<string>

Code examples
conceptMap.variables()
nodejs

Stream<T>

A stream of elements offering a functional interface to manipulate elements. Typically the elements are generated/retrieved lazily.

[asyncIterator]

[asyncIterator](): AsyncIterator<T, any, undefined>
nodejs
Returns

AsyncIterator<T, any, undefined>

collect

collect(): Promise<T[]>
nodejs

Collects all the answers from this stream into an array

Returns

Promise<T[]>

Code examples
results = transaction.query.match(query).collect().await;
nodejs

every

every(callbackFn): Promise<boolean>
nodejs

Checks whether a condition is satisfied by ALL answers in this stream.

Input parameters
Name Description Type

callbackFn

((value) ⇒ unknown)

Returns

Promise<boolean>

filter

filter(filter): Stream<T>
nodejs

Returns a new stream from this stream consisting only of elements which satisfy a given condition.

Input parameters
Name Description Type

filter

The condition to evaluate. Examples // For a query "match $p isa person, has age $a;", only retrieve results having $a >= 60.results = transaction.query.match(query).filter(cm => cm.get("a").value > 60).collect(); Copy

((value) ⇒ boolean)

Returns

Stream<T>

first

first(): Promise<T>
nodejs

Returns the first element in the stream.

Returns

Promise<T>

flatMap

flatMap<U>(mapper): Stream<U>
nodejs

Given a function which accepts a single element of this stream and returns a new stream, This function returns a new stream obtained by applying the function to each element in the stream, and concatenating each result thus obtained

Input parameters
Name Description Type

mapper

The mapping function to apply. Must return a stream.

((value) ⇒ Stream<U>)

Returns

Stream<U>

forEach

forEach(fn): Promise<void>
nodejs

Executes the given function for each element in the stream.

Input parameters
Name Description Type

fn

The function to evaluate for each element.

((value) ⇒ void)

Returns

Promise<void>

iterator

iterator(): AsyncIterator<T, any, undefined>
nodejs
Returns

AsyncIterator<T, any, undefined>

map

map<U>(mapper): Stream<U>
nodejs
Input parameters
Name Description Type

mapper

The mapping function to apply. Returns a new stream from this stream by applying the mapper function to each element.

((value) ⇒ U)

Returns

Stream<U>

new Stream

new Stream<T>(): Stream<T>
nodejs
Returns

Stream<T>

some

some(callbackFn): Promise<boolean>
nodejs

Checks whether a condition is satisfied by ANY answer in this stream.

Input parameters
Name Description Type

callbackFn

((value) ⇒ unknown)

Returns

Promise<boolean>

ValueGroup

Contains an element of the group aggregate query result.

Fields
Name Type Description

owner

Concept

Retrieves the concept that is the group owner. Examples valueGroup.owner Copy

value

Value

Retrieves the Value answer of the group, if there is one. Examples valueGroup.value Copy

Explainables

Contains explainable objects.

Fields
Name Type Description

attributes

Map

All of this ConceptMap’s explainable attributes.

ownerships

Map

All of this ConceptMap’s explainable ownerships.

relations

Map

All of this ConceptMap’s explainable relations.

attribute

attribute(variable): Explainable
nodejs

Retrieves the explainable attribute with the given variable name.

Input parameters
Name Description Type

variable

The string representation of a variable

string

Returns

Explainable

Code examples
conceptMap.explainables.attribute(variable)
nodejs

ownership

ownership(owner, attribute): Explainable
nodejs

Retrieves the explainable attribute ownership with the pair of (owner, attribute) variable names.

Input parameters
Name Description Type

owner

The string representation of the owner variable

string

attribute

The string representation of the attribute variable

string

Returns

Explainable

Code examples
conceptMap.explainables.ownership(owner, attribute)
nodejs

relation

relation(variable): Explainable
nodejs

Retrieves the explainable relation with the given variable name.

Input parameters
Name Description Type

variable

The string representation of a variable

string

Returns

Explainable

Code examples
conceptMap.explainables.relation(variable)
nodejs

Explainable

Contains an explainable object.

Fields
Name Type Description

conjunction

string

The subquery of the original query that is actually being explained.

id

number

A unique ID that identifies this Explainable.

Explanation

An explanation of which rule was used for inferring the explained concept, the condition of the rule, the conclusion of the rule, and the mapping of variables between the query and the rule’s conclusion.

Fields
Name Type Description

conclusion

ConceptMap

The Conclusion for this Explanation.

condition

ConceptMap

The Condition for this Explanation.

rule

Rule

Retrieves the Rule for this Explanation.

variableMapping

Map

Retrieves the query variables for this Explanation.

Concept

ConceptManager

Provides access for all Concept API methods.

getAttribute

getAttribute(iid): Promise<Attribute>
nodejs

Retrieves an Attribute by its iid.

Input parameters
Name Description Type

iid

The iid of the Attribute to retrieve

string

Returns

Promise<Attribute>

Code examples
transaction.concepts().getAttribute(iid)
nodejs

getAttributeType

getAttributeType(label): Promise<AttributeType>
nodejs

Retrieves an AttributeType by its label.

Input parameters
Name Description Type

label

The label of the AttributeType to retrieve

string

Returns

Promise<AttributeType>

Code examples
transaction.concepts().getAttributeType(label)
nodejs

getEntity

getEntity(iid): Promise<Entity>
nodejs

Retrieves an Entity by its iid.

Input parameters
Name Description Type

iid

The iid of the Entity to retrieve

string

Returns

Promise<Entity>

Code examples
transaction.concepts().getEntity(iid)
nodejs

getEntityType

getEntityType(label): Promise<EntityType>
nodejs

Retrieves an EntityType by its label.

Input parameters
Name Description Type

label

The label of the EntityType to retrieve

string

Returns

Promise<EntityType>

Code examples
transaction.concepts().getEntityType(label)
nodejs

getRelation

getRelation(iid): Promise<Relation>
nodejs

Retrieves a Relation by its iid.

Input parameters
Name Description Type

iid

The iid of the Relation to retrieve

string

Returns

Promise<Relation>

Code examples
transaction.concepts().getRelation(iid)
nodejs

getRelationType

getRelationType(label): Promise<RelationType>
nodejs

Retrieves a RelationType by its label.

Input parameters
Name Description Type

label

The label of the RelationType to retrieve

string

Returns

Promise<RelationType>

Code examples
transaction.concepts().getRelationType(label)
nodejs

getRootAttributeType

getRootAttributeType(): Promise<AttributeType>
nodejs

Retrieve the root AttributeType, “attribute”.

Returns

Promise<AttributeType>

Code examples
transaction.concepts().getRootAttributeType()
nodejs

getRootEntityType

getRootEntityType(): Promise<EntityType>
nodejs

Retrieves the root EntityType, “entity”.

Returns

Promise<EntityType>

Code examples
transaction.concepts().getRootEntityType()
nodejs

getRootRelationType

getRootRelationType(): Promise<RelationType>
nodejs

Retrieve the root RelationType, “relation”.

Returns

Promise<RelationType>

Code examples
transaction.concepts().getRootRelationType()
nodejs

getRootThingType

getRootThingType(): Promise<ThingType>
nodejs

Retrieves the root ThingType, “thing”.

Returns

Promise<ThingType>

Code examples
transaction.concepts().getRootThingType()
nodejs

getSchemaExceptions

getSchemaExceptions(): Promise<TypeDBDriverError[]>
nodejs

Retrieves a list of all schema exceptions for the current transaction.

Returns

Promise<TypeDBDriverError[]>

Code examples
transaction.concepts().getSchemaException()
nodejs

putAttributeType

putAttributeType(label, valueType): Promise<AttributeType>
nodejs

Creates a new AttributeType if none exists with the given label, or retrieves the existing one. or retrieve. :return:

Input parameters
Name Description Type

label

The label of the AttributeType to create or retrieve

string

valueType

The value type of the AttributeType to create

ValueType

Returns

Promise<AttributeType>

Code examples
await transaction.concepts().putAttributeType(label, valueType)
nodejs

putEntityType

putEntityType(label): Promise<EntityType>
nodejs

Creates a new EntityType if none exists with the given label, otherwise retrieves the existing one.

Input parameters
Name Description Type

label

The label of the EntityType to create or retrieve

string

Returns

Promise<EntityType>

Code examples
transaction.concepts().putEntityType(label)
nodejs

putRelationType

putRelationType(label): Promise<RelationType>
nodejs

Creates a new RelationType if none exists with the given label, otherwise retrieves the existing one.

Input parameters
Name Description Type

label

The label of the RelationType to create or retrieve

string

Returns

Promise<RelationType>

Code examples
transaction.concepts().putRelationType(label)
nodejs

Concept

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

Schema

Type

Supertypes:

  • Concept

Fields
Name Type Description

abstract

boolean

Whether the type is prevented from having data instances (i.e., abstract).

label

Label

The unique label of the type.

root

boolean

Whether the type is a root type.

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this type from the database.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
type.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getSubtypes

getSubtypes(transaction): Stream<Type>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Type>

Code examples
type.getSubtypes(transaction) type.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSubtypes

getSubtypes(transaction, transitivity): Stream<Type>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only

Transitivity

Returns

Stream<Type>

Code examples
type.getSubtypes(transaction) type.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSupertype

getSupertype(transaction): Promise<Type>
nodejs

Retrieves the most immediate supertype of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<Type>

Code examples
type.getSupertype(transaction)
nodejs

getSupertypes

getSupertypes(transaction): Stream<Type>
nodejs

Retrieves all supertypes of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Type>

Code examples
type.getSupertypes(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if the concept has been deleted

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the type. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

label

The new Label to be given to the type.

string

Returns

Promise<void>

Code examples
type.setLabel(transaction, label)
nodejs

Label

A Label holds the uniquely identifying name of a type.

It consists of an optional 'scope', and a 'name', represented "scope:name". The scope is used only used to distinguish between role-types of the same name declared in different relation types.

name

get name(): string
nodejs

Returns the name part of the label.

Returns

string

scope

get scope(): string
nodejs

Returns the (possibly null) scope part of the label.

Returns

string

scopedName

get scopedName(): string
nodejs

Returns the string representation of the scoped name.

Returns

string

equals

equals(that): boolean
nodejs

Compares this label to that label.

Input parameters
Name Description Type

that

The label to compare to.

Label

Returns

boolean

toString

toString(): string
nodejs

Printable string

Returns

string

ThingType

Supertypes:

  • Type

Namespace variables
Name

NAME

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this type from the database.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
type.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getInstances

getInstances(transaction): Stream<Thing>
nodejs

Retrieves all direct and indirect Thing objects that are instances of this ThingType. Equivalent to getInstances(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Thing>

Code examples
thingType.getInstances(transaction)
nodejs

getInstances

getInstances(transaction, transitivity): Stream<Thing>
nodejs

Retrieves all direct and indirect (or direct only) Thing objects that are instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect instances, Transitivity.EXPLICIT for direct instances only

Transitivity

Returns

Stream<Thing>

Code examples
thingType.getInstances(transaction, Transitivity.EXPLICIT)
nodejs

getOwns

getOwns(transaction): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

If specified, only attribute types of this ValueType will be retrieved.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

transitivity

Transitivity.TRANSITIVE for direct and inherited ownership, Transitivity.EXPLICIT for direct ownership only

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwnsOverridden

getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
nodejs

Retrieves an AttributeType, ownership of which is overridden for this ThingType by a given attribute_type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType that overrides requested AttributeType

AttributeType

Returns

Promise<AttributeType>

Code examples
thingType.getOwnsOverridden(transaction, attributeType)
nodejs

getPlays

getPlays(transaction): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlays

getPlays(transaction, transitivity): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect playing, Transitivity.EXPLICIT for direct playing only

Transitivity

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlaysOverridden

getPlaysOverridden(transaction, role): Promise<RoleType>
nodejs

Retrieves a RoleType that is overridden by the given role_type for this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The RoleType that overrides an inherited role

RoleType

Returns

Promise<RoleType>

Code examples
thingType.getPlaysOverridden(transaction, role)
nodejs

getSubtypes

getSubtypes(transaction): Stream<ThingType>
nodejs

Retrieves all direct and indirect subtypes of the ThingType. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<ThingType>

Code examples
thingType.getSubtypes(transaction)
nodejs

getSubtypes

getSubtypes(transaction, transitivity): Stream<ThingType>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only

Transitivity

Returns

Stream<ThingType>

Code examples
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSupertype

getSupertype(transaction): Promise<ThingType>
nodejs

Retrieves the most immediate supertype of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<ThingType>

Code examples
thingType.getSupertype(transaction)
nodejs

getSupertypes

getSupertypes(transaction): Stream<ThingType>
nodejs

Retrieves all supertypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<ThingType>

Code examples
thingType.getSupertypes(transaction)
nodejs

getSyntax

getSyntax(transaction): Promise<string>
nodejs

Produces a pattern for creating this ThingType in a define query.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<string>

Code examples
thingType.getSyntax(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if the concept has been deleted

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setAbstract

setAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be abstract, meaning it cannot have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.setAbstract(transaction)
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the type. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

label

The new Label to be given to the type.

string

Returns

Promise<void>

Code examples
type.setLabel(transaction, label)
nodejs

setOwns

setOwns(transaction, attributeType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

annotations

The AttributeType that this attribute ownership overrides, if applicable.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

annotations

Adds annotations to the ownership.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setPlays

setPlays(transaction, role): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setPlays

setPlays(transaction, role, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

overriddenType

The role type that this role overrides, if applicable

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

unsetAbstract

unsetAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be non-abstract, meaning it can have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.unsetAbstract(transaction)
nodejs

unsetOwns

unsetOwns(transaction, attributeType): Promise<void>
nodejs

Disallows the instances of this ThingType from owning the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to not be owned by the type.

AttributeType

Returns

Promise<void>

Code examples
thingType.unsetOwns(transaction, attributeType)
nodejs

unsetPlays

unsetPlays(transaction, role): Promise<void>
nodejs

Disallows the instances of this ThingType from playing the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to not be played by the instances of this type.

RoleType

Returns

Promise<void>

Code examples
thingType.unsetPlays(transaction, role)
nodejs

EntityType

Supertypes:

  • ThingType

Namespace variables
Name

NAME

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

create

create(transaction): Promise<Entity>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

Returns

Promise<Entity>

delete

delete(transaction): Promise<void>
nodejs

Deletes this type from the database.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
type.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getInstances

getInstances(transaction): Stream<Entity>
nodejs

Retrieves all direct and indirect Thing objects that are instances of this ThingType. Equivalent to getInstances(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Entity>

Code examples
thingType.getInstances(transaction)
nodejs

getInstances

getInstances(transaction, transitivity): Stream<Entity>
nodejs

Retrieves all direct and indirect (or direct only) Thing objects that are instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect instances, Transitivity.EXPLICIT for direct instances only

Transitivity

Returns

Stream<Entity>

Code examples
thingType.getInstances(transaction, Transitivity.EXPLICIT)
nodejs

getOwns

getOwns(transaction): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

If specified, only attribute types of this ValueType will be retrieved.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

transitivity

Transitivity.TRANSITIVE for direct and inherited ownership, Transitivity.EXPLICIT for direct ownership only

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwnsOverridden

getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
nodejs

Retrieves an AttributeType, ownership of which is overridden for this ThingType by a given attribute_type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType that overrides requested AttributeType

AttributeType

Returns

Promise<AttributeType>

Code examples
thingType.getOwnsOverridden(transaction, attributeType)
nodejs

getPlays

getPlays(transaction): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlays

getPlays(transaction, transitivity): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect playing, Transitivity.EXPLICIT for direct playing only

Transitivity

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlaysOverridden

getPlaysOverridden(transaction, role): Promise<RoleType>
nodejs

Retrieves a RoleType that is overridden by the given role_type for this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The RoleType that overrides an inherited role

RoleType

Returns

Promise<RoleType>

Code examples
thingType.getPlaysOverridden(transaction, role)
nodejs

getSubtypes

getSubtypes(transaction): Stream<EntityType>
nodejs

Retrieves all direct and indirect subtypes of the ThingType. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<EntityType>

Code examples
thingType.getSubtypes(transaction)
nodejs

getSubtypes

getSubtypes(transaction, transitivity): Stream<EntityType>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only

Transitivity

Returns

Stream<EntityType>

Code examples
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSupertype

getSupertype(transaction): Promise<EntityType>
nodejs

Retrieves the most immediate supertype of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<EntityType>

Code examples
thingType.getSupertype(transaction)
nodejs

getSupertypes

getSupertypes(transaction): Stream<EntityType>
nodejs

Retrieves all supertypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<EntityType>

Code examples
thingType.getSupertypes(transaction)
nodejs

getSyntax

getSyntax(transaction): Promise<string>
nodejs

Produces a pattern for creating this ThingType in a define query.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<string>

Code examples
thingType.getSyntax(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if the concept has been deleted

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setAbstract

setAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be abstract, meaning it cannot have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.setAbstract(transaction)
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the type. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

label

The new Label to be given to the type.

string

Returns

Promise<void>

Code examples
type.setLabel(transaction, label)
nodejs

setOwns

setOwns(transaction, attributeType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

annotations

The AttributeType that this attribute ownership overrides, if applicable.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

annotations

Adds annotations to the ownership.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setPlays

setPlays(transaction, role): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setPlays

setPlays(transaction, role, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

overriddenType

The role type that this role overrides, if applicable

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setSupertype

setSupertype(transaction, superEntityType): Promise<void>
nodejs

Sets the supplied EntityType as the supertype of the current EntityType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

superEntityType

The EntityType to set as the supertype of this EntityType

EntityType

Returns

Promise<void>

Code examples
entityType.setSupertype(transaction, superEntityType).resolve();
nodejs

unsetAbstract

unsetAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be non-abstract, meaning it can have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.unsetAbstract(transaction)
nodejs

unsetOwns

unsetOwns(transaction, attributeType): Promise<void>
nodejs

Disallows the instances of this ThingType from owning the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to not be owned by the type.

AttributeType

Returns

Promise<void>

Code examples
thingType.unsetOwns(transaction, attributeType)
nodejs

unsetPlays

unsetPlays(transaction, role): Promise<void>
nodejs

Disallows the instances of this ThingType from playing the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to not be played by the instances of this type.

RoleType

Returns

Promise<void>

Code examples
thingType.unsetPlays(transaction, role)
nodejs

RelationType

Supertypes:

  • ThingType

Namespace variables
Name

NAME

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

create

create(transaction): Promise<Relation>
nodejs

Creates and returns an instance of this RelationType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<Relation>

Code examples
relationType.create(transaction)
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this type from the database.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
type.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getInstances

getInstances(transaction): Stream<Relation>
nodejs

Retrieves all direct and indirect Thing objects that are instances of this ThingType. Equivalent to getInstances(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Relation>

Code examples
thingType.getInstances(transaction)
nodejs

getInstances

getInstances(transaction, transitivity): Stream<Relation>
nodejs

Retrieves all direct and indirect (or direct only) Thing objects that are instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect instances, Transitivity.EXPLICIT for direct instances only

Transitivity

Returns

Stream<Relation>

Code examples
thingType.getInstances(transaction, Transitivity.EXPLICIT)
nodejs

getOwns

getOwns(transaction): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

If specified, only attribute types of this ValueType will be retrieved.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

transitivity

Transitivity.TRANSITIVE for direct and inherited ownership, Transitivity.EXPLICIT for direct ownership only

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwnsOverridden

getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
nodejs

Retrieves an AttributeType, ownership of which is overridden for this ThingType by a given attribute_type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType that overrides requested AttributeType

AttributeType

Returns

Promise<AttributeType>

Code examples
thingType.getOwnsOverridden(transaction, attributeType)
nodejs

getPlays

getPlays(transaction): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlays

getPlays(transaction, transitivity): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect playing, Transitivity.EXPLICIT for direct playing only

Transitivity

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlaysOverridden

getPlaysOverridden(transaction, role): Promise<RoleType>
nodejs

Retrieves a RoleType that is overridden by the given role_type for this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The RoleType that overrides an inherited role

RoleType

Returns

Promise<RoleType>

Code examples
thingType.getPlaysOverridden(transaction, role)
nodejs

getRelates

getRelates(transaction): Stream<RoleType>
nodejs

RelationType#getRelates:(1)

Input parameters
Name Description Type

transaction

TypeDBTransaction

Returns

Stream<RoleType>

getRelates

getRelates(transaction, transitivity): Stream<RoleType>
nodejs

Retrieves roles that this RelationType relates to directly or via inheritance. If role_label is given, returns a corresponding RoleType or None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and inherited relates, Transitivity.EXPLICIT for direct relates only

Transitivity

Returns

Stream<RoleType>

Code examples
relationType.getRelates(transaction, roleLabel, transitivity)
nodejs

getRelatesForRoleLabel

getRelatesForRoleLabel(transaction, roleLabel): Promise<RoleType>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

roleLabel

string

Returns

Promise<RoleType>

getRelatesOverridden

getRelatesOverridden(transaction, roleLabel): Promise<RoleType>
nodejs

Retrieves a RoleType that is overridden by the role with the role_label.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleLabel

Label of the role that overrides an inherited role

string

Returns

Promise<RoleType>

Code examples
relationType.getRelatesOverridden(transaction, roleLabel)
nodejs

getSubtypes

getSubtypes(transaction): Stream<RelationType>
nodejs

Retrieves all direct and indirect subtypes of the ThingType. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RelationType>

Code examples
thingType.getSubtypes(transaction)
nodejs

getSubtypes

getSubtypes(transaction, transitivity): Stream<RelationType>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only

Transitivity

Returns

Stream<RelationType>

Code examples
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSupertype

getSupertype(transaction): Promise<RelationType>
nodejs

Retrieves the most immediate supertype of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<RelationType>

Code examples
thingType.getSupertype(transaction)
nodejs

getSupertypes

getSupertypes(transaction): Stream<RelationType>
nodejs

Retrieves all supertypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RelationType>

Code examples
thingType.getSupertypes(transaction)
nodejs

getSyntax

getSyntax(transaction): Promise<string>
nodejs

Produces a pattern for creating this ThingType in a define query.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<string>

Code examples
thingType.getSyntax(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if the concept has been deleted

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setAbstract

setAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be abstract, meaning it cannot have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.setAbstract(transaction)
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the type. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

label

The new Label to be given to the type.

string

Returns

Promise<void>

Code examples
type.setLabel(transaction, label)
nodejs

setOwns

setOwns(transaction, attributeType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

annotations

The AttributeType that this attribute ownership overrides, if applicable.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

annotations

Adds annotations to the ownership.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setPlays

setPlays(transaction, role): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setPlays

setPlays(transaction, role, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

overriddenType

The role type that this role overrides, if applicable

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setRelates

setRelates(transaction, roleLabel, overriddenLabel?): Promise<void>
nodejs

Sets the new role that this RelationType relates to. If we are setting an overriding type this way, we have to also pass the overridden type as a second argument.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleLabel

The new role for the RelationType to relate to

string

overriddenLabel

The label being overridden, if applicable

string

Returns

Promise<void>

Code examples
relationType.setRelates(transaction, roleLabel) relationType.setRelates(transaction, roleLabel, overriddenLabel)
nodejs

setSupertype

setSupertype(transaction, type): Promise<void>
nodejs

Sets the supplied RelationType as the supertype of the current RelationType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

type

RelationType

Returns

Promise<void>

Code examples
relationType.setSupertype(transaction, superRelationType).resolve();
nodejs

unsetAbstract

unsetAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be non-abstract, meaning it can have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.unsetAbstract(transaction)
nodejs

unsetOwns

unsetOwns(transaction, attributeType): Promise<void>
nodejs

Disallows the instances of this ThingType from owning the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to not be owned by the type.

AttributeType

Returns

Promise<void>

Code examples
thingType.unsetOwns(transaction, attributeType)
nodejs

unsetPlays

unsetPlays(transaction, role): Promise<void>
nodejs

Disallows the instances of this ThingType from playing the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to not be played by the instances of this type.

RoleType

Returns

Promise<void>

Code examples
thingType.unsetPlays(transaction, role)
nodejs

unsetRelates

unsetRelates(transaction, roleLabel): Promise<void>
nodejs

Disallows this RelationType from relating to the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleLabel

The role to not relate to the relation type.

string

Returns

Promise<void>

Code examples
relationType.unsetRelates(transaction, roleLabel)
nodejs

RoleType

Supertypes:

  • Type

Roles are special internal types used by relations. We can not create an instance of a role in a database. But we can set an instance of another type (role player) to play a role in a particular instance of a relation type. Roles allow a schema to enforce logical constraints on types of role players.

Namespace variables
Name

NAME

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this type from the database.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
type.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getPlayerInstances

getPlayerInstances(transaction): Stream<Thing>
nodejs

Retrieves the Thing instances that play this role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Thing>

Code examples
roleType.getPlayerInstances(transaction, transitivity)
nodejs

getPlayerInstances

getPlayerInstances(transaction, transitivity): Stream<Thing>
nodejs

Retrieves the Thing instances that play this role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect playing, Transitivity.EXPLICIT for direct playing only

Transitivity

Returns

Stream<Thing>

Code examples
roleType.getPlayerInstances(transaction, transitivity)
nodejs

getPlayerTypes

getPlayerTypes(transaction): Stream<ThingType>
nodejs

Retrieves the ThingTypes whose instances play this role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<ThingType>

Code examples
roleType.getPlayerTypes(transaction, transitivity)
nodejs

getPlayerTypes

getPlayerTypes(transaction, transitivity): Stream<ThingType>
nodejs

Retrieves the ThingTypes whose instances play this role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect playing, Transitivity.EXPLICIT for direct playing only

Transitivity

Returns

Stream<ThingType>

Code examples
roleType.getPlayerTypes(transaction, transitivity)
nodejs

getRelationInstances

getRelationInstances(transaction): Stream<Relation>
nodejs

Retrieves the Relation instances that this role is related to.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Relation>

Code examples
roleType.getRelationInstances(transaction, transitivity)
nodejs

getRelationInstances

getRelationInstances(transaction, transitivity): Stream<Relation>
nodejs

Retrieves the Relation instances that this role is related to.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect relation, Transitivity.EXPLICIT for direct relation only

Transitivity

Returns

Stream<Relation>

Code examples
roleType.getRelationInstances(transaction, transitivity)
nodejs

getRelationType

getRelationType(transaction): Promise<RelationType>
nodejs

Retrieves the RelationType that this role is directly related to.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<RelationType>

Code examples
roleType.getRelationType(transaction)
nodejs

getRelationTypes

getRelationTypes(transaction): Stream<RelationType>
nodejs

Retrieves RelationTypes that this role is related to (directly or indirectly).

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RelationType>

Code examples
roleType.getRelationTypes(transaction)
nodejs

getSubtypes

getSubtypes(transaction): Stream<RoleType>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
type.getSubtypes(transaction) type.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSupertype

getSupertype(transaction): Promise<RoleType>
nodejs

Retrieves the most immediate supertype of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<RoleType>

Code examples
type.getSupertype(transaction)
nodejs

getSupertypes

getSupertypes(transaction): Stream<RoleType>
nodejs

Retrieves all supertypes of the type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
type.getSupertypes(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if the concept has been deleted

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the type. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

label

The new Label to be given to the type.

string

Returns

Promise<void>

Code examples
type.setLabel(transaction, label)
nodejs

AttributeType

Supertypes:

  • ThingType

Attribute types represent properties that other types can own. Attribute types have a value type. This value type is fixed and unique for every given instance of the attribute type. Other types can own an attribute type. That means that instances of these other types can own an instance of this attribute type. This usually means that an object in our domain has a property with the matching value. Multiple types can own the same attribute type, and different instances of the same type or different types can share ownership of the same attribute instance.

Namespace variables
Name

NAME

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this type from the database.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
type.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

get

get(transaction, value): Promise<Attribute>
nodejs

Retrieves an Attribute of this AttributeType with the given value if such Attribute exists. Otherwise, returns None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

Attribute’s value

Value

Returns

Promise<Attribute>

Code examples
attribute = attributeType.get(transaction, value)
nodejs

getBoolean

getBoolean(transaction, value): Promise<Attribute>
nodejs

Retrieves an Attribute of this AttributeType with the given value if such Attribute exists. Otherwise, returns None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

Attribute’s value

boolean

Returns

Promise<Attribute>

Code examples
attribute = attributeType.get(transaction, value)
nodejs

getDateTime

getDateTime(transaction, value): Promise<Attribute>
nodejs

Retrieves an Attribute of this AttributeType with the given value if such Attribute exists. Otherwise, returns None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

Attribute’s value

Date

Returns

Promise<Attribute>

Code examples
attribute = attributeType.get(transaction, value)
nodejs

getDouble

getDouble(transaction, value): Promise<Attribute>
nodejs

Retrieves an Attribute of this AttributeType with the given value if such Attribute exists. Otherwise, returns None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

Attribute’s value

number

Returns

Promise<Attribute>

Code examples
attribute = attributeType.get(transaction, value)
nodejs

getInstances

getInstances(transaction, transitivity): Stream<Attribute>
nodejs

Retrieves all direct and indirect (or direct only) Attributes that are instances of this AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only

Transitivity

Returns

Stream<Attribute>

Code examples
attributeType.getInstances(transaction) attributeType.getInstances(transaction, Transitivity.EXPLICIT)
nodejs

getInstances

getInstances(transaction): Stream<Attribute>
nodejs

Retrieves all direct and indirect (or direct only) Thing objects that are instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Attribute>

Code examples
thingType.getInstances(transaction, Transitivity.EXPLICIT)
nodejs

getLong

getLong(transaction, value): Promise<Attribute>
nodejs

Retrieves an Attribute of this AttributeType with the given value if such Attribute exists. Otherwise, returns None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

Attribute’s value

number

Returns

Promise<Attribute>

Code examples
attribute = attributeType.get(transaction, value)
nodejs

getOwners

getOwners(transaction, annotations, transitivity): Stream<ThingType>
nodejs

Retrieve all Things that own an attribute of this AttributeType. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

Only retrieve ThingTypes that have an attribute of this AttributeType with all given Annotations

Annotation[]

transitivity

Transitivity.TRANSITIVE for direct and inherited ownership, Transitivity.EXPLICIT for direct ownership only

Transitivity

Returns

Stream<ThingType>

Code examples
attributeType.getOwners(transaction) attributeType.getOwners(transaction, [Annotation.UNIQUE]) attributeType.getOwners(transaction, Transitivity.TRANSITIVE) attributeType.getOwners(transaction, [Annotation.UNIQUE], Transitivity.TRANSITIVE)
nodejs

getOwners

getOwners(transaction): Stream<ThingType>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

Returns

Stream<ThingType>

getOwners

getOwners(transaction, annotations): Stream<ThingType>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

annotations

Annotation[]

Returns

Stream<ThingType>

getOwners

getOwners(transaction, transitivity): Stream<ThingType>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

transitivity

Transitivity

Returns

Stream<ThingType>

getOwns

getOwns(transaction): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

If specified, only attribute types of this ValueType will be retrieved.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

If specified, only attribute types of this ValueType will be retrieved.

Annotation[]

transitivity

Only retrieve attribute types owned with annotations.

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwns

getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
nodejs

Retrieves AttributeType that the instances of this ThingType are allowed to own directly or via inheritance.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

If specified, only attribute types of this ValueType will be retrieved.

ValueType

annotations

Only retrieve attribute types owned with annotations.

Annotation[]

transitivity

Transitivity.TRANSITIVE for direct and inherited ownership, Transitivity.EXPLICIT for direct ownership only

Transitivity

Returns

Stream<AttributeType>

Code examples
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
nodejs

getOwnsOverridden

getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
nodejs

Retrieves an AttributeType, ownership of which is overridden for this ThingType by a given attribute_type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType that overrides requested AttributeType

AttributeType

Returns

Promise<AttributeType>

Code examples
thingType.getOwnsOverridden(transaction, attributeType)
nodejs

getPlays

getPlays(transaction): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlays

getPlays(transaction, transitivity): Stream<RoleType>
nodejs

Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

transitivity

Transitivity.TRANSITIVE for direct and indirect playing, Transitivity.EXPLICIT for direct playing only

Transitivity

Returns

Stream<RoleType>

Code examples
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
nodejs

getPlaysOverridden

getPlaysOverridden(transaction, role): Promise<RoleType>
nodejs

Retrieves a RoleType that is overridden by the given role_type for this ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The RoleType that overrides an inherited role

RoleType

Returns

Promise<RoleType>

Code examples
thingType.getPlaysOverridden(transaction, role)
nodejs

getRegex

getRegex(transaction): Promise<string>
nodejs

Retrieves the regular expression that is defined for this AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<string>

Code examples
attributeType.getRegex(transaction)
nodejs

getString

getString(transaction, value): Promise<Attribute>
nodejs

Retrieves an Attribute of this AttributeType with the given value if such Attribute exists. Otherwise, returns None.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

Attribute’s value

string

Returns

Promise<Attribute>

Code examples
attribute = attributeType.get(transaction, value)
nodejs

getSubtypes

getSubtypes(transaction): Stream<AttributeType>
nodejs

Retrieves all direct and indirect subtypes of the ThingType. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<AttributeType>

Code examples
thingType.getSubtypes(transaction)
nodejs

getSubtypes

getSubtypes(transaction, valueType): Stream<AttributeType>
nodejs

Retrieves all direct and indirect (or direct only) subtypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

valueType

Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only

ValueType

Returns

Stream<AttributeType>

Code examples
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
nodejs

getSubtypes

getSubtypes(transaction, transitivity): Stream<AttributeType>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

transitivity

Transitivity

Returns

Stream<AttributeType>

getSubtypes

getSubtypes(transaction, valueType, transitivity): Stream<AttributeType>
nodejs
Input parameters
Name Description Type

transaction

TypeDBTransaction

valueType

ValueType

transitivity

Transitivity

Returns

Stream<AttributeType>

getSupertype

getSupertype(transaction): Promise<AttributeType>
nodejs

Retrieves the most immediate supertype of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<AttributeType>

Code examples
thingType.getSupertype(transaction)
nodejs

getSupertypes

getSupertypes(transaction): Stream<AttributeType>
nodejs

Retrieves all supertypes of the ThingType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<AttributeType>

Code examples
thingType.getSupertypes(transaction)
nodejs

getSyntax

getSyntax(transaction): Promise<string>
nodejs

Produces a pattern for creating this ThingType in a define query.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<string>

Code examples
thingType.getSyntax(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if the concept has been deleted

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

put

put(transaction, value): Promise<Attribute>
nodejs

Adds and returns an Attribute of this AttributeType with the given value.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

New Attribute’s value

Value

Returns

Promise<Attribute>

Code examples
attribute = attributeType.put(transaction, value)
nodejs

putBoolean

putBoolean(transaction, value): Promise<Attribute>
nodejs

Adds and returns an Attribute of this AttributeType with the given value.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

New Attribute’s value

boolean

Returns

Promise<Attribute>

Code examples
attribute = attributeType.put(transaction, value)
nodejs

putDateTime

putDateTime(transaction, value): Promise<Attribute>
nodejs

Adds and returns an Attribute of this AttributeType with the given value.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

New Attribute’s value

Date

Returns

Promise<Attribute>

Code examples
attribute = attributeType.put(transaction, value)
nodejs

putDouble

putDouble(transaction, value): Promise<Attribute>
nodejs

Adds and returns an Attribute of this AttributeType with the given value.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

New Attribute’s value

number

Returns

Promise<Attribute>

Code examples
attribute = attributeType.put(transaction, value)
nodejs

putLong

putLong(transaction, value): Promise<Attribute>
nodejs

Adds and returns an Attribute of this AttributeType with the given value.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

New Attribute’s value

number

Returns

Promise<Attribute>

Code examples
attribute = attributeType.put(transaction, value)
nodejs

putString

putString(transaction, value): Promise<Attribute>
nodejs

Adds and returns an Attribute of this AttributeType with the given value.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

value

New Attribute’s value

string

Returns

Promise<Attribute>

Code examples
attribute = attributeType.put(transaction, value)
nodejs

setAbstract

setAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be abstract, meaning it cannot have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.setAbstract(transaction)
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the type. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

label

The new Label to be given to the type.

string

Returns

Promise<void>

Code examples
type.setLabel(transaction, label)
nodejs

setOwns

setOwns(transaction, attributeType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

annotations

The AttributeType that this attribute ownership overrides, if applicable.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setOwns

setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
nodejs

Allows the instances of this ThingType to own the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to be owned by the instances of this type.

AttributeType

overriddenType

The AttributeType that this attribute ownership overrides, if applicable.

AttributeType

annotations

Adds annotations to the ownership.

Annotation[]

Returns

Promise<void>

Code examples
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
nodejs

setPlays

setPlays(transaction, role): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setPlays

setPlays(transaction, role, overriddenType): Promise<void>
nodejs

Allows the instances of this ThingType to play the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to be played by the instances of this type

RoleType

overriddenType

The role type that this role overrides, if applicable

RoleType

Returns

Promise<void>

Code examples
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
nodejs

setRegex

setRegex(transaction, regex): Promise<void>
nodejs

Sets a regular expression as a constraint for this AttributeType. Values of all Attributes of this type (inserted earlier or later) should match this regex. Can only be applied for AttributeTypes with a string value type.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

regex

Regular expression

string

Returns

Promise<void>

Code examples
attributeType.setRegex(transaction, regex)
nodejs

setSupertype

setSupertype(transaction, type): Promise<void>
nodejs

Sets the supplied AttributeType as the supertype of the current AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

type

AttributeType

Returns

Promise<void>

Code examples
attributeType.setSupertype(transaction, superAttributeType).resolve();
nodejs

unsetAbstract

unsetAbstract(transaction): Promise<void>
nodejs

Set a ThingType to be non-abstract, meaning it can have instances.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thingType.unsetAbstract(transaction)
nodejs

unsetOwns

unsetOwns(transaction, attributeType): Promise<void>
nodejs

Disallows the instances of this ThingType from owning the given AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeType to not be owned by the type.

AttributeType

Returns

Promise<void>

Code examples
thingType.unsetOwns(transaction, attributeType)
nodejs

unsetPlays

unsetPlays(transaction, role): Promise<void>
nodejs

Disallows the instances of this ThingType from playing the given role.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

role

The role to not be played by the instances of this type.

RoleType

Returns

Promise<void>

Code examples
thingType.unsetPlays(transaction, role)
nodejs

unsetRegex

unsetRegex(transaction): Promise<void>
nodejs

Removes the regular expression that is defined for this AttributeType.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
attributeType.unsetRegex(transaction)
nodejs

Annotation

Annotations for ownership declarations.

Fields
Name Type Description

KEY

Annotation

Annotation to specify the attribute owned is a KEY

UNIQUE

Annotation

Annotation to specify the owned is UNIQUE

parse

parse(string): Annotation
nodejs

Returns the relevant Annotation given the name as a string

Input parameters
Name Description Type

string

name of the attribute as a string. e.g.: "key", "unique"

string

Returns

Annotation

toString

toString(): string
nodejs

Printable string

Returns

string

Transitivity

Namespace variables
Name

EXPLICIT

TRANSITIVE

new Transitivity

new Transitivity(transitivity): Transitivity
nodejs
Input parameters
Name Description Type

transitivity

TypeTransitivity

Returns

Transitivity

ValueType

TypeQL value types for attributes & value concepts.

Namespace variables
Name

BOOLEAN

DATETIME

DOUBLE

LONG

OBJECT

STRING

name

name(): string
nodejs
Returns

string

new ValueType

new ValueType(type, name): ValueType
nodejs
Input parameters
Name Description Type

type

ValueType

name

string

Returns

ValueType

toString

toString(): string
nodejs
Returns

string

Data

Thing

Supertypes:

  • Concept

Fields
Name Type Description

iid

string

Retrieves the unique id of the Thing.

inferred

boolean

Checks if this Thing is inferred by a [Reasoning Rule].

type

ThingType

Retrieves the type which this Thing belongs to.

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thing.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getHas

getHas(transaction): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

The AttributeTypes to filter the attributes by

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeType): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeTypes to filter the attributes by

AttributeType

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

annotations

Only retrieve attributes with all given Annotations

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getPlaying

getPlaying(transaction): Stream<RoleType>
nodejs

Retrieves the roles that this Thing is currently playing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thing.getPlaying(transaction)
nodejs

getRelations

getRelations(transaction): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

getRelations

getRelations(transaction, roleTypes): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleTypes

The list of roles to filter the relations by.

RoleType[]

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Checks if this Thing is deleted.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

Code examples
thing.isDeleted(transaction)
nodejs

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setHas

setHas(transaction, attribute): Promise<void>
nodejs

Assigns an Attribute to be owned by this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be owned by this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.setHas(transaction, attribute)
nodejs

unsetHas

unsetHas(transaction, attribute): Promise<void>
nodejs

Unassigns an Attribute from this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be disowned from this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.unsetHas(transaction, attribute)
nodejs

Entity

Supertypes:

  • Thing

Instance of data of an entity type, representing a standalone object that exists in the data model independently. Entity does not have a value. It is usually addressed by its ownership over attribute instances and/or roles played in relation instances.

Fields
Name Type Description

iid

string

Retrieves the unique id of the Thing.

inferred

boolean

Checks if this Thing is inferred by a [Reasoning Rule].

type

EntityType

The type which this Entity belongs to.

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thing.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getHas

getHas(transaction): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

The AttributeTypes to filter the attributes by

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeType): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeTypes to filter the attributes by

AttributeType

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

annotations

Only retrieve attributes with all given Annotations

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getPlaying

getPlaying(transaction): Stream<RoleType>
nodejs

Retrieves the roles that this Thing is currently playing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thing.getPlaying(transaction)
nodejs

getRelations

getRelations(transaction): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

getRelations

getRelations(transaction, roleTypes): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleTypes

The list of roles to filter the relations by.

RoleType[]

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Checks if this Thing is deleted.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

Code examples
thing.isDeleted(transaction)
nodejs

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setHas

setHas(transaction, attribute): Promise<void>
nodejs

Assigns an Attribute to be owned by this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be owned by this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.setHas(transaction, attribute)
nodejs

unsetHas

unsetHas(transaction, attribute): Promise<void>
nodejs

Unassigns an Attribute from this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be disowned from this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.unsetHas(transaction, attribute)
nodejs

Relation

Supertypes:

  • Thing

Relation is an instance of a relation type and can be uniquely addressed by a combination of its type, owned attributes and role players.

Fields
Name Type Description

iid

string

Retrieves the unique id of the Thing.

inferred

boolean

Checks if this Thing is inferred by a [Reasoning Rule].

type

RelationType

The type which this Relation belongs to.

addRolePlayer

addRolePlayer(transaction, roleType, player): Promise<void>
nodejs

Adds a new role player to play the given role in this Relation.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleType

The role to be played by the player

RoleType

player

The thing to play the role

Thing

Returns

Promise<void>

Code examples
relation.addRolePlayer(transaction, roleType, player)
nodejs

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thing.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getHas

getHas(transaction): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

The AttributeTypes to filter the attributes by

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeType): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeTypes to filter the attributes by

AttributeType

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

annotations

Only retrieve attributes with all given Annotations

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getPlayersByRoleType

getPlayersByRoleType(transaction): Stream<Thing>
nodejs

Retrieves all role players of this Relation, optionally filtered by given role types.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Thing>

Code examples
relation.getPlayersByRoleType(transaction) relation.getPlayersByRoleType(transaction, [roleType1, roleType2])
nodejs

getPlayersByRoleType

getPlayersByRoleType(transaction, roleTypes): Stream<Thing>
nodejs

Retrieves all role players of this Relation, optionally filtered by given role types.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleTypes

0 or more role types

RoleType[]

Returns

Stream<Thing>

Code examples
relation.getPlayersByRoleType(transaction) relation.getPlayersByRoleType(transaction, [roleType1, roleType2])
nodejs

getPlaying

getPlaying(transaction): Stream<RoleType>
nodejs

Retrieves the roles that this Thing is currently playing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thing.getPlaying(transaction)
nodejs

getRelating

getRelating(transaction): Stream<RoleType>
nodejs

Retrieves all role types currently played in this Relation.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
relation.getRelating(transaction)
nodejs

getRelations

getRelations(transaction): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

getRelations

getRelations(transaction, roleTypes): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleTypes

The list of roles to filter the relations by.

RoleType[]

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

getRolePlayers

getRolePlayers(transaction): Promise<Map<RoleType, Thing[]>>
nodejs

Retrieves a mapping of all instances involved in the Relation and the role each play.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<Map<RoleType, Thing[]>>

Code examples
relation.getRolePlayers(transaction)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Checks if this Thing is deleted.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

Code examples
thing.isDeleted(transaction)
nodejs

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

removeRolePlayer

removeRolePlayer(transaction, roleType, player): Promise<void>
nodejs

Removes the association of the given instance that plays the given role in this Relation.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleType

The role to no longer be played by the thing in this Relation

RoleType

player

The instance to no longer play the role in this Relation

Thing

Returns

Promise<void>

Code examples
relation.removeRolePlayer(transaction, roleType, player)
nodejs

setHas

setHas(transaction, attribute): Promise<void>
nodejs

Assigns an Attribute to be owned by this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be owned by this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.setHas(transaction, attribute)
nodejs

unsetHas

unsetHas(transaction, attribute): Promise<void>
nodejs

Unassigns an Attribute from this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be disowned from this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.unsetHas(transaction, attribute)
nodejs

Attribute

Supertypes:

  • Thing

Attribute is an instance of the attribute type and has a value. This value is fixed and unique for every given instance of the attribute type. Attributes can be uniquely addressed by their type and value.

Fields
Name Type Description

iid

string

Retrieves the unique id of the Thing.

inferred

boolean

Checks if this Thing is inferred by a [Reasoning Rule].

type

AttributeType

The type which this Attribute belongs to.

value

string

The value which the Attribute instance holds.

valueType

ValueType

The type of the value which the Attribute instance holds.

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

delete

delete(transaction): Promise<void>
nodejs

Deletes this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
thing.delete(transaction)
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

getHas

getHas(transaction): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

annotations

The AttributeTypes to filter the attributes by

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeType): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeType

The AttributeTypes to filter the attributes by

AttributeType

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getHas

getHas(transaction, attributeTypes, annotations): Stream<Attribute>
nodejs

Retrieves the Attributes that this Thing owns. Optionally, filtered by an AttributeType or a list of AttributeTypes. Optionally, filtered by Annotations.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attributeTypes

The AttributeTypes to filter the attributes by

AttributeType[]

annotations

Only retrieve attributes with all given Annotations

Annotation[]

Returns

Stream<Attribute>

Code examples
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
nodejs

getOwners

getOwners(transaction, ownerType?): Stream<Thing>
nodejs

Retrieves the instances that own this Attribute.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

ownerType

If specified, filter results for only owners of the given type

ThingType

Returns

Stream<Thing>

Code examples
attribute.getOwners(transaction) attribute.getOwners(transaction, ownerType)
nodejs

getPlaying

getPlaying(transaction): Stream<RoleType>
nodejs

Retrieves the roles that this Thing is currently playing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<RoleType>

Code examples
thing.getPlaying(transaction)
nodejs

getRelations

getRelations(transaction): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

getRelations

getRelations(transaction, roleTypes): Stream<Relation>
nodejs

Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

roleTypes

The list of roles to filter the relations by.

RoleType[]

Returns

Stream<Relation>

Code examples
thing.getRelations(transaction, roleTypes)
nodejs

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Checks if this Thing is deleted.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

Returns

Promise<boolean>

Code examples
thing.isDeleted(transaction)
nodejs

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

setHas

setHas(transaction, attribute): Promise<void>
nodejs

Assigns an Attribute to be owned by this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be owned by this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.setHas(transaction, attribute)
nodejs

unsetHas

unsetHas(transaction, attribute): Promise<void>
nodejs

Unassigns an Attribute from this Thing.

Input parameters
Name Description Type

transaction

The current transaction

TypeDBTransaction

attribute

The Attribute to be disowned from this Thing.

Attribute

Returns

Promise<void>

Code examples
thing.unsetHas(transaction, attribute)
nodejs

Value

Supertypes:

  • Concept

Fields
Name Type Description

value

string

Retrieves the value which this value concept holds.

valueType

ValueType

The ValueType of this value concept

asAttribute

asAttribute(): Attribute
nodejs

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute()
nodejs

asAttributeType

asAttributeType(): AttributeType
nodejs

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType()
nodejs

asBoolean

asBoolean(): boolean
nodejs

Returns a boolean value of this value concept. If the value has another type, raises an exception.

Returns

boolean

Code examples
value.asBoolean()
nodejs

asDateTime

asDateTime(): Date
nodejs

Returns a datetime value of this value concept. If the value has another type, raises an exception.

Returns

Date

Code examples
value.asDatetime()
nodejs

asDouble

asDouble(): number
nodejs

Returns a number value of this value concept. If the value has another type, raises an exception.

Returns

number

Code examples
value.asDouble()
nodejs

asEntity

asEntity(): Entity
nodejs

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity()
nodejs

asEntityType

asEntityType(): EntityType
nodejs

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType()
nodejs

asLong

asLong(): number
nodejs

Returns a number value of this value concept. If the value has another type, raises an exception.

Returns

number

Code examples
value.asLong()
nodejs

asRelation

asRelation(): Relation
nodejs

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation()
nodejs

asRelationType

asRelationType(): RelationType
nodejs

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType()
nodejs

asRoleType

asRoleType(): RoleType
nodejs

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType()
nodejs

asString

asString(): string
nodejs

Returns a string value of this value concept. If the value has another type, raises an exception.

Returns

string

Code examples
value.asString()
nodejs

asThing

asThing(): Thing
nodejs

Casts the concept to Thing.

Returns

Thing

Code examples
concept.asThing()
nodejs

asThingType

asThingType(): ThingType
nodejs

Casts the concept to ThingType.

Returns

ThingType

Code examples
concept.asThingType()
nodejs

asType

asType(): Type
nodejs

Casts the concept to Type.

Returns

Type

Code examples
concept.asType()
nodejs

asValue

asValue(): Value
nodejs

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue()
nodejs

equals

equals(concept): boolean
nodejs

Checks if this concept is equal to the argument concept.

Input parameters
Name Description Type

concept

The concept to compare to.

Concept

Returns

boolean

isAttribute

isAttribute(): boolean
nodejs

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute()
nodejs

isAttributeType

isAttributeType(): boolean
nodejs

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType()
nodejs

isBoolean

isBoolean(): boolean
nodejs

Returns True if the value which this value concept holds is of type boolean. Otherwise, returns False.

Returns

boolean

Code examples
value.isBoolean()
nodejs

isDateTime

isDateTime(): boolean
nodejs

Returns True if the value which this value concept holds is of type datetime. Otherwise, returns False.

Returns

boolean

Code examples
value.isDatetime()
nodejs

isDouble

isDouble(): boolean
nodejs

Returns True if the value which this value concept holds is of type double. Otherwise, returns False.

Returns

boolean

Code examples
value.isDouble()
nodejs

isEntity

isEntity(): boolean
nodejs

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity()
nodejs

isEntityType

isEntityType(): boolean
nodejs

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType()
nodejs

isLong

isLong(): boolean
nodejs

Returns True if the value which this value concept holds is of type long. Otherwise, returns False.

Returns

boolean

Code examples
value.isLong()
nodejs

isRelation

isRelation(): boolean
nodejs

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation()
nodejs

isRelationType

isRelationType(): boolean
nodejs

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType()
nodejs

isRoleType

isRoleType(): boolean
nodejs

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType()
nodejs

isString

isString(): boolean
nodejs

Returns True if the value which this value concept holds is of type string. Otherwise, returns False.

Returns

boolean

Code examples
value.isString()
nodejs

isThing

isThing(): boolean
nodejs

Checks if the concept is a Thing.

Returns

boolean

Code examples
concept.isThing()
nodejs

isThingType

isThingType(): boolean
nodejs

Checks if the concept is a ThingType.

Returns

boolean

Code examples
concept.isThingType()
nodejs

isType

isType(): boolean
nodejs

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType()
nodejs

isValue

isValue(): boolean
nodejs

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue()
nodejs

Logic

LogicManager

Provides methods for manipulating rules in the database.

getRule

getRule(label): Promise<Rule>
nodejs

Retrieves the Rule that has the given label.

Input parameters
Name Description Type

label

The label of the Rule to create or retrieve

string

Returns

Promise<Rule>

Code examples
transaction.logic.getRule(label)
nodejs

getRules

getRules(): Stream<Rule>
nodejs

Retrieves all rules.

Returns

Stream<Rule>

Code examples
transaction.logic.getRules()
nodejs

putRule

putRule(label, when, then): Promise<Rule>
nodejs

Creates a new Rule if none exists with the given label, or replaces the existing one.

Input parameters
Name Description Type

label

The label of the Rule to create or replace

string

when

The when body of the rule to create

string

then

The then body of the rule to create

string

Returns

Promise<Rule>

Code examples
transaction.logic.putRule(label, when, then)
nodejs

Rule

Rules are a part of schema and define embedded logic. The reasoning engine uses rules as a set of logic to infer new data. A rule consists of a condition and a conclusion, and is uniquely identified by a label.

Fields
Name Type Description

label

string

The unique label of the rule.

then

string

The single statement that constitutes the ‘then’ of the rule.

when

string

The statements that constitute the ‘when’ of the rule.

delete

delete(transaction): Promise<void>
nodejs

Deletes this rule.

Input parameters
Name Description Type

transaction

The current Transaction

TypeDBTransaction

Returns

Promise<void>

Code examples
rule.delete(transaction)
nodejs

isDeleted

isDeleted(transaction): Promise<boolean>
nodejs

Check if this rule has been deleted.

Input parameters
Name Description Type

transaction

The current Transaction

TypeDBTransaction

Returns

Promise<boolean>

Code examples
rule.isDeleted(transaction)
nodejs

setLabel

setLabel(transaction, label): Promise<void>
nodejs

Renames the label of the rule. The new label must remain unique.

Input parameters
Name Description Type

transaction

The current Transaction

TypeDBTransaction

label

string

Returns

Promise<void>

Code examples
rule.setLabel(transaction, newLabel)
nodejs

Errors

TypeDBDriverError

Supertypes:

  • Error

Errors encountered when interacting with TypeDB

Fields
Name Type Description

message

string

name

string

prepareStackTrace

any

stack

string

stackTraceLimit

number

messageTemplate

get messageTemplate(): ErrorMessage
nodejs

Returns the message template for this error.

Returns

ErrorMessage

captureStackTrace

captureStackTrace(targetObject, constructorOpt?): void
nodejs

Create .stack property on a target object

Input parameters
Name Description Type

targetObject

object

constructorOpt

Function

Returns

void

new TypeDBDriverError

new TypeDBDriverError(error): TypeDBDriverError
nodejs
Input parameters
Name Description Type

error

string | ErrorMessage | Error | ServiceError

Returns

TypeDBDriverError

ErrorMessage

Class defining the error-code and message template for TypeDBDriverErrors

code

code(): string
nodejs

Retrieves the error-code for this ErrorMessage

Returns

string

message

message(...args): string
nodejs

Generates the error message by substituting args into the messageTemplate

Input parameters
Name Description Type

args

The format arguments to the message-template.

Stringable[]

Returns

string

new ErrorMessage

new ErrorMessage(codePrefix, codeNumber, messagePrefix, messageBody): ErrorMessage
nodejs
Input parameters
Name Description Type

codePrefix

string

codeNumber

number

messagePrefix

string

messageBody

((args) ⇒ string)

Returns

ErrorMessage

toString

toString(): string
nodejs

Summarises the error into a string

Returns

string