Node.js driver API reference
Connection
TypeDB
Name |
---|
|
cloudDriver
cloudDriver(addresses, credential): Promise<TypeDBDriver>
Creates a connection to TypeDB Cloud, authenticating with the provided credentials.
Name | Description | Type |
---|---|---|
|
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. |
|
|
The credentials to log in, and encryption settings. See |
|
Promise<TypeDBDriver>
TypeDBDriver
Name | Type | Description |
---|---|---|
|
|
The DatabaseManager for this connection, providing access to database management methods. |
|
|
The UserManager instance for this connection, providing access to user management methods. Only for TypeDB Cloud. |
close
close(): Promise<void>
Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed.
Promise<void>
driver.close()
isOpen
isOpen(): boolean
Checks whether this connection is presently open.
boolean
driver.isOpen()
TypeDBCredential
User credentials and TLS encryption settings for connecting to TypeDB Cloud.
new TypeDBCredential
new TypeDBCredential(username, password, tlsRootCAPath?): TypeDBCredential
Name | Description | Type |
---|---|---|
|
The name of the user to connect as |
|
|
The password for the user |
|
|
Path to the CA certificate to use for authenticating server certificates. |
|
TypeDBCredential
DatabaseManager
Provides access to all database management methods.
all
all(): Promise<Database[]>
Retrieves all databases present on the TypeDB server
Promise<Database[]>
driver.databases().all()
contains
contains(name): Promise<boolean>
Checks if a database with the given name exists
Name | Description | Type |
---|---|---|
|
The database name to be checked |
|
Promise<boolean>
driver.databases().contains(name)
Database
Name | Type | Description |
---|---|---|
|
|
The database name as a string. |
|
|
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 |
|
|
The primary replica for this database. Only works in TypeDB Cloud |
|
|
The Replica instances for this database. Only works in TypeDB Cloud |
Replica
The metadata and state of an individual raft replica of a database.
Name | Type | Description |
---|---|---|
|
|
The database for which this is a replica. |
|
|
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. |
|
|
Checks whether this is the primary replica of the raft cluster. |
|
|
The server hosting this replica |
|
|
The raft protocol ‘term’ of this replica. |
UserManager
Provides access to all user management methods.
all
all(): Promise<User[]>
Retrieves all users which exist on the TypeDB server.
Promise<User[]>
driver.users.all()
contains
contains(name): Promise<boolean>
Checks if a user with the given name exists.
Name | Description | Type |
---|---|---|
|
|
Promise<boolean>
driver.users.contains(username)
create
create(name, password): Promise<void>
Create a user with the given name & password.
Name | Description | Type |
---|---|---|
|
|
|
|
The password of the user to be created |
|
Promise<void>
driver.users.create(username, password)
delete
delete(name): Promise<void>
Deletes a user with the given name.
Name | Description | Type |
---|---|---|
|
|
Promise<void>
driver.users.delete(username)
get
get(name): Promise<User>
Retrieve a user with the given name.
Name | Description | Type |
---|---|---|
|
|
Promise<User>
driver.users.get(username)
passwordSet
passwordSet(name, password): Promise<void>
Sets a new password for a user. This operation can only be performed by administrators.
Name | Description | Type |
---|---|---|
|
|
|
|
The new password |
|
Promise<void>
driver.users.passwordSet(username, password)
Session
TypeDBSession
Name | Type | Description |
---|---|---|
|
|
The database of the session. Examples session.database() Copy |
|
|
Gets the options for the session |
|
|
The current session’s type (SCHEMA or DATA) |
close
close(): Promise<void>
Closes the session. Before opening a new session, the session currently open should first be closed.
Promise<void>
session.close()
isOpen
isOpen(): boolean
Checks whether this session is open.
boolean
session.isOpen()
onClose
onClose(callback): void
Registers a callback function which will be executed when this session is closed.
Name | Description | Type |
---|---|---|
|
The callback function. |
|
void
session.onClose(function)
onReopen
onReopen(callback): void
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.
Name | Description | Type |
---|---|---|
|
The callback function. |
|
void
session.onReopen(function)
transaction
transaction(type, options?): Promise<TypeDBTransaction>
Opens a transaction to perform read or write queries on the database connected to the session.
Name | Description | Type |
---|---|---|
|
|
|
|
Options for the session |
|
Promise<TypeDBTransaction>
session.transaction(transactionType, options)
SessionType
This class is used to specify the type of the session.
Name |
---|
|
|
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
If set to True
, enables explanations for queries. Only affects read transactions.
boolean
explain
set explain(value): void
If set to True
, enables explanations for queries. Only affects read transactions.
void
infer
get infer(): boolean
If set to True
, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.
boolean
infer
set infer(value): void
If set to True
, enables inference for queries. Only settable at transaction level and above. Only affects read transactions.
void
parallel
get parallel(): boolean
If set to True
, the server uses parallel instead of single-threaded execution.
boolean
parallel
set parallel(value): void
If set to True
, the server uses parallel instead of single-threaded execution.
void
prefetch
get prefetch(): boolean
If set to True
, the first batch of answers is streamed to the driver even without an explicit request for it.
boolean
prefetch
set prefetch(value): void
If set to True
, the first batch of answers is streamed to the driver even without an explicit request for it.
void
prefetchSize
get prefetchSize(): number
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
number
prefetchSize
set prefetchSize(value): void
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
void
readAnyReplica
get readAnyReplica(): boolean
If set to True
, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.
boolean
readAnyReplica
set readAnyReplica(value): void
If set to True
, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.
void
schemaLockAcquireTimeoutMillis
get schemaLockAcquireTimeoutMillis(): number
If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.
number
schemaLockAcquireTimeoutMillis
set schemaLockAcquireTimeoutMillis(value): void
If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.
void
sessionIdleTimeoutMillis
get sessionIdleTimeoutMillis(): number
If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.
number
sessionIdleTimeoutMillis
set sessionIdleTimeoutMillis(millis): void
If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.
void
traceInference
get traceInference(): boolean
If set to True
, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False
.
boolean
traceInference
set traceInference(value): void
If set to True
, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False
.
void
transactionTimeoutMillis
get transactionTimeoutMillis(): number
If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
number
transactionTimeoutMillis
set transactionTimeoutMillis(millis): void
If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
void
new TypeDBOptions
new TypeDBOptions(obj?): TypeDBOptions
Name | Description | Type |
---|---|---|
|
If set to |
|
TypeDBOptions
Opts
Interface for TypeDBOptions. Use TypeDBOptions instead.
Name | Type | Description |
---|---|---|
|
|
If set to True, enables explanations for queries. Only affects read transactions. |
|
|
If set to True, enables inference for queries. Only settable at transaction level and above. Only affects read transactions. |
|
|
If set to True, the server uses parallel instead of single-threaded execution. |
|
|
If set to True, the first batch of answers is streamed to the driver even without an explicit request for it. |
|
|
If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request. |
|
|
If set to True, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud. |
|
|
If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock. |
|
|
If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive. |
|
|
If set to True, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False. |
|
|
If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions. |
Transaction
TypeDBTransaction
Name | Type | Description |
---|---|---|
|
|
The ConceptManager for this transaction, providing access to all Concept API methods. |
|
|
The LogicManager for this Transaction, providing access to all Concept API - Logic methods. |
|
|
The options for the transaction. |
|
|
TheQueryManager for this Transaction, from which any TypeQL query can be executed. |
|
|
The transaction’s type (READ or WRITE) |
close
close(): Promise<void>
Closes the transaction.
Promise<void>
transaction.close()
commit
commit(): Promise<void>
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.
Promise<void>
transaction.commit()
isOpen
isOpen(): boolean
Checks whether this transaction is open.
boolean
transaction.isOpen()
TransactionType
This class is used to specify the type of transaction.
Name |
---|
|
|
QueryManager
Provides methods for executing TypeQL queries in the transaction.
define
define(query, options?): Promise<void>
Performs a TypeQL Define query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Define query to be executed |
|
|
Specify query options |
|
Promise<void>
transaction.query.define(query, options)
delete
delete(query, options?): Promise<void>
Performs a TypeQL Delete query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Delete query to be executed |
|
|
Specify query options |
|
Promise<void>
transaction.query.delete(query, options)
explain
explain(explainable, options?): Stream<Explanation>
Performs a TypeQL Explain query in the transaction.
Name | Description | Type |
---|---|---|
|
The Explainable to be explained |
|
|
Specify query options |
|
Stream<Explanation>
transaction.query.explain(explainable, options)
fetch
fetch(query, options?): Stream<JSONObject>
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.
Name | Description | Type |
---|---|---|
|
The TypeQL Fetch query to be executed |
|
|
Specify query options |
|
Stream<JSONObject>
transaction.query.fetch(query, options)
get
get(query, options?): Stream<ConceptMap>
Performs a TypeQL Get query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Get query to be executed |
|
|
Specify query options |
|
Stream<ConceptMap>
transaction.query.get(query, options)
getAggregate
getAggregate(query, options?): Promise<Value>
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).
Name | Description | Type |
---|---|---|
|
The TypeQL Get Aggregate query to be executed |
|
|
Specify query options |
|
Promise<Value>
transaction.query.getAggregate(query, options)
getGroup
getGroup(query, options?): Stream<ConceptMapGroup>
Performs a TypeQL Get Group query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Get Group query to be executed |
|
|
Specify query options |
|
Stream<ConceptMapGroup>
transaction.query.getGroup(query, options)
getGroupAggregate
getGroupAggregate(query, options?): Stream<ValueGroup>
Performs a TypeQL Get Group Aggregate query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Get Group Aggregate query to be executed |
|
|
Specify query options |
|
Stream<ValueGroup>
transaction.query.getGroupAggregate(query, options)
insert
insert(query, options?): Stream<ConceptMap>
Performs a TypeQL Insert query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Insert query to be executed |
|
|
Specify query options |
|
Stream<ConceptMap>
transaction.query.insert(query, options)
undefine
undefine(query, options?): Promise<void>
Performs a TypeQL Undefine query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Undefine query to be executed |
|
|
Specify query options |
|
Promise<void>
transaction.query.undefine(query, options)
update
update(query, options?): Stream<ConceptMap>
Performs a TypeQL Update query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Update query to be executed |
|
|
Specify query options |
|
Stream<ConceptMap>
transaction.query.update(query, options)
Answer
ConceptMapGroup
Contains an element of the group query result.
Name | Type | Description |
---|---|---|
|
|
The ConceptMaps of the group. |
|
|
The concept that is the group owner. |
ConceptMap
Contains a mapping of variables to concepts.
Name | Type | Description |
---|---|---|
|
|
The Explainables object for this ConceptMap, exposing which of the concepts in this ConceptMap are explainable. |
concepts
concepts(): IterableIterator<Concept>
Produces an iterator over all concepts in this ConceptMap
.
IterableIterator<Concept>
conceptMap.concepts()
get
get(variable): Concept
Retrieves a concept for a given variable name.
Name | Description | Type |
---|---|---|
|
The string representation of a variable |
|
Concept
conceptMap.get(variable)
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>
AsyncIterator<T, any, undefined>
collect
collect(): Promise<T[]>
Collects all the answers from this stream into an array
Promise<T[]>
results = transaction.query.match(query).collect().await;
every
every(callbackFn): Promise<boolean>
Checks whether a condition is satisfied by ALL answers in this stream.
Name | Description | Type |
---|---|---|
|
|
Promise<boolean>
filter
filter(filter): Stream<T>
Returns a new stream from this stream consisting only of elements which satisfy a given condition.
Name | Description | Type |
---|---|---|
|
The condition to evaluate.
Examples
|
|
Stream<T>
flatMap
flatMap<U>(mapper): Stream<U>
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
Name | Description | Type |
---|---|---|
|
The mapping function to apply. Must return a stream. |
|
Stream<U>
forEach
forEach(fn): Promise<void>
Executes the given function for each element in the stream.
Name | Description | Type |
---|---|---|
|
The function to evaluate for each element. |
|
Promise<void>
ValueGroup
Contains an element of the group aggregate query result.
Name | Type | Description |
---|---|---|
|
|
Retrieves the concept that is the group owner. Examples valueGroup.owner Copy |
|
|
Retrieves the Value answer of the group, if there is one. Examples valueGroup.value Copy |
Explainables
Contains explainable objects.
Name | Type | Description |
---|---|---|
|
|
All of this ConceptMap’s explainable attributes. |
|
|
All of this ConceptMap’s explainable ownerships. |
|
|
All of this ConceptMap’s explainable relations. |
attribute
attribute(variable): Explainable
Retrieves the explainable attribute with the given variable name.
Name | Description | Type |
---|---|---|
|
The string representation of a variable |
|
Explainable
conceptMap.explainables.attribute(variable)
ownership
ownership(owner, attribute): Explainable
Retrieves the explainable attribute ownership with the pair of (owner, attribute) variable names.
Name | Description | Type |
---|---|---|
|
The string representation of the owner variable |
|
|
The string representation of the attribute variable |
|
Explainable
conceptMap.explainables.ownership(owner, attribute)
Explainable
Contains an explainable object.
Name | Type | Description |
---|---|---|
|
|
The subquery of the original query that is actually being explained. |
|
|
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.
Name | Type | Description |
---|---|---|
|
|
The Conclusion for this Explanation. |
|
|
The Condition for this Explanation. |
|
|
Retrieves the Rule for this Explanation. |
|
|
Retrieves the query variables for this Explanation. |
Concept
ConceptManager
Provides access for all Concept API methods.
getAttribute
getAttribute(iid): Promise<Attribute>
Retrieves an Attribute
by its iid.
Name | Description | Type |
---|---|---|
|
The iid of the |
|
Promise<Attribute>
transaction.concepts().getAttribute(iid)
getAttributeType
getAttributeType(label): Promise<AttributeType>
Retrieves an AttributeType
by its label.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise<AttributeType>
transaction.concepts().getAttributeType(label)
getEntity
getEntity(iid): Promise<Entity>
Retrieves an Entity
by its iid.
Name | Description | Type |
---|---|---|
|
The iid of the |
|
Promise<Entity>
transaction.concepts().getEntity(iid)
getEntityType
getEntityType(label): Promise<EntityType>
Retrieves an EntityType
by its label.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise<EntityType>
transaction.concepts().getEntityType(label)
getRelation
getRelation(iid): Promise<Relation>
Retrieves a Relation
by its iid.
Name | Description | Type |
---|---|---|
|
The iid of the |
|
Promise<Relation>
transaction.concepts().getRelation(iid)
getRelationType
getRelationType(label): Promise<RelationType>
Retrieves a RelationType
by its label.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise<RelationType>
transaction.concepts().getRelationType(label)
getRootAttributeType
getRootAttributeType(): Promise<AttributeType>
Retrieve the root AttributeType
, “attribute”.
Promise<AttributeType>
transaction.concepts().getRootAttributeType()
getRootEntityType
getRootEntityType(): Promise<EntityType>
Retrieves the root EntityType
, “entity”.
Promise<EntityType>
transaction.concepts().getRootEntityType()
getRootRelationType
getRootRelationType(): Promise<RelationType>
Retrieve the root RelationType
, “relation”.
Promise<RelationType>
transaction.concepts().getRootRelationType()
getRootThingType
getRootThingType(): Promise<ThingType>
Retrieves the root ThingType
, “thing”.
Promise<ThingType>
transaction.concepts().getRootThingType()
getSchemaExceptions
getSchemaExceptions(): Promise<TypeDBDriverError[]>
Retrieves a list of all schema exceptions for the current transaction.
Promise<TypeDBDriverError[]>
transaction.concepts().getSchemaException()
putAttributeType
putAttributeType(label, valueType): Promise<AttributeType>
Creates a new AttributeType
if none exists with the given label, or retrieves the existing one. or retrieve. :return:
Name | Description | Type |
---|---|---|
|
The label of the |
|
|
The value type of the |
|
Promise<AttributeType>
await transaction.concepts().putAttributeType(label, valueType)
putEntityType
putEntityType(label): Promise<EntityType>
Creates a new EntityType
if none exists with the given label, otherwise retrieves the existing one.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise<EntityType>
transaction.concepts().putEntityType(label)
putRelationType
putRelationType(label): Promise<RelationType>
Creates a new RelationType
if none exists with the given label, otherwise retrieves the existing one.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise<RelationType>
transaction.concepts().putRelationType(label)
Concept
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
Schema
Type
Supertypes:
-
Concept
Name | Type | Description |
---|---|---|
|
|
Whether the type is prevented from having data instances (i.e., abstract). |
|
|
The unique label of the type. |
|
|
Whether the type is a root type. |
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
type.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getSubtypes
getSubtypes(transaction): Stream<Type>
Retrieves all direct and indirect (or direct only) subtypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Type>
type.getSubtypes(transaction) type.getSubtypes(transaction, Transitivity.EXPLICIT)
getSubtypes
getSubtypes(transaction, transitivity): Stream<Type>
Retrieves all direct and indirect (or direct only) subtypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Type>
type.getSubtypes(transaction) type.getSubtypes(transaction, Transitivity.EXPLICIT)
getSupertype
getSupertype(transaction): Promise<Type>
Retrieves the most immediate supertype of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<Type>
type.getSupertype(transaction)
getSupertypes
getSupertypes(transaction): Stream<Type>
Retrieves all supertypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Type>
type.getSupertypes(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Check if the concept has been deleted
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setLabel
setLabel(transaction, label): Promise<void>
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
Promise<void>
type.setLabel(transaction, label)
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.
scopedName
get scopedName(): string
Returns the string representation of the scoped name.
string
ThingType
Supertypes:
-
Type
Name |
---|
|
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
type.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getInstances
getInstances(transaction): Stream<Thing>
Retrieves all direct and indirect Thing
objects that are instances of this ThingType
. Equivalent to getInstances(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Thing>
thingType.getInstances(transaction)
getInstances
getInstances(transaction, transitivity): Stream<Thing>
Retrieves all direct and indirect (or direct only) Thing
objects that are instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Thing>
thingType.getInstances(transaction, Transitivity.EXPLICIT)
getOwns
getOwns(transaction): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
|
|
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwnsOverridden
getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
Retrieves an AttributeType
, ownership of which is overridden for this ThingType
by a given attribute_type
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<AttributeType>
thingType.getOwnsOverridden(transaction, attributeType)
getPlays
getPlays(transaction): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlays
getPlays(transaction, transitivity): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlaysOverridden
getPlaysOverridden(transaction, role): Promise<RoleType>
Retrieves a RoleType
that is overridden by the given role_type
for this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<RoleType>
thingType.getPlaysOverridden(transaction, role)
getSubtypes
getSubtypes(transaction): Stream<ThingType>
Retrieves all direct and indirect subtypes of the ThingType
. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<ThingType>
thingType.getSubtypes(transaction)
getSubtypes
getSubtypes(transaction, transitivity): Stream<ThingType>
Retrieves all direct and indirect (or direct only) subtypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<ThingType>
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
getSupertype
getSupertype(transaction): Promise<ThingType>
Retrieves the most immediate supertype of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<ThingType>
thingType.getSupertype(transaction)
getSupertypes
getSupertypes(transaction): Stream<ThingType>
Retrieves all supertypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<ThingType>
thingType.getSupertypes(transaction)
getSyntax
getSyntax(transaction): Promise<string>
Produces a pattern for creating this ThingType
in a define
query.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<string>
thingType.getSyntax(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Check if the concept has been deleted
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setAbstract
setAbstract(transaction): Promise<void>
Set a ThingType
to be abstract, meaning it cannot have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.setAbstract(transaction)
setLabel
setLabel(transaction, label): Promise<void>
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
Promise<void>
type.setLabel(transaction, label)
setOwns
setOwns(transaction, attributeType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
|
Adds annotations to the ownership. |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setPlays
setPlays(transaction, role): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setPlays
setPlays(transaction, role, overriddenType): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
|
The role type that this role overrides, if applicable |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
unsetAbstract
unsetAbstract(transaction): Promise<void>
Set a ThingType
to be non-abstract, meaning it can have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.unsetAbstract(transaction)
unsetOwns
unsetOwns(transaction, attributeType): Promise<void>
Disallows the instances of this ThingType
from owning the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.unsetOwns(transaction, attributeType)
unsetPlays
unsetPlays(transaction, role): Promise<void>
Disallows the instances of this ThingType
from playing the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not be played by the instances of this type. |
|
Promise<void>
thingType.unsetPlays(transaction, role)
EntityType
Supertypes:
-
ThingType
Name |
---|
|
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
create
create(transaction): Promise<Entity>
Name | Description | Type |
---|---|---|
|
|
Promise<Entity>
delete
delete(transaction): Promise<void>
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
type.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getInstances
getInstances(transaction): Stream<Entity>
Retrieves all direct and indirect Thing
objects that are instances of this ThingType
. Equivalent to getInstances(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Entity>
thingType.getInstances(transaction)
getInstances
getInstances(transaction, transitivity): Stream<Entity>
Retrieves all direct and indirect (or direct only) Thing
objects that are instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Entity>
thingType.getInstances(transaction, Transitivity.EXPLICIT)
getOwns
getOwns(transaction): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
|
|
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwnsOverridden
getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
Retrieves an AttributeType
, ownership of which is overridden for this ThingType
by a given attribute_type
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<AttributeType>
thingType.getOwnsOverridden(transaction, attributeType)
getPlays
getPlays(transaction): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlays
getPlays(transaction, transitivity): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlaysOverridden
getPlaysOverridden(transaction, role): Promise<RoleType>
Retrieves a RoleType
that is overridden by the given role_type
for this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<RoleType>
thingType.getPlaysOverridden(transaction, role)
getSubtypes
getSubtypes(transaction): Stream<EntityType>
Retrieves all direct and indirect subtypes of the ThingType
. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<EntityType>
thingType.getSubtypes(transaction)
getSubtypes
getSubtypes(transaction, transitivity): Stream<EntityType>
Retrieves all direct and indirect (or direct only) subtypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<EntityType>
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
getSupertype
getSupertype(transaction): Promise<EntityType>
Retrieves the most immediate supertype of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<EntityType>
thingType.getSupertype(transaction)
getSupertypes
getSupertypes(transaction): Stream<EntityType>
Retrieves all supertypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<EntityType>
thingType.getSupertypes(transaction)
getSyntax
getSyntax(transaction): Promise<string>
Produces a pattern for creating this ThingType
in a define
query.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<string>
thingType.getSyntax(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Check if the concept has been deleted
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setAbstract
setAbstract(transaction): Promise<void>
Set a ThingType
to be abstract, meaning it cannot have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.setAbstract(transaction)
setLabel
setLabel(transaction, label): Promise<void>
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
Promise<void>
type.setLabel(transaction, label)
setOwns
setOwns(transaction, attributeType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
|
Adds annotations to the ownership. |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setPlays
setPlays(transaction, role): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setPlays
setPlays(transaction, role, overriddenType): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
|
The role type that this role overrides, if applicable |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setSupertype
setSupertype(transaction, superEntityType): Promise<void>
Sets the supplied EntityType
as the supertype of the current EntityType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
entityType.setSupertype(transaction, superEntityType).resolve();
unsetAbstract
unsetAbstract(transaction): Promise<void>
Set a ThingType
to be non-abstract, meaning it can have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.unsetAbstract(transaction)
unsetOwns
unsetOwns(transaction, attributeType): Promise<void>
Disallows the instances of this ThingType
from owning the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.unsetOwns(transaction, attributeType)
unsetPlays
unsetPlays(transaction, role): Promise<void>
Disallows the instances of this ThingType
from playing the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not be played by the instances of this type. |
|
Promise<void>
thingType.unsetPlays(transaction, role)
RelationType
Supertypes:
-
ThingType
Name |
---|
|
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
create
create(transaction): Promise<Relation>
Creates and returns an instance of this RelationType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<Relation>
relationType.create(transaction)
delete
delete(transaction): Promise<void>
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
type.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getInstances
getInstances(transaction): Stream<Relation>
Retrieves all direct and indirect Thing
objects that are instances of this ThingType
. Equivalent to getInstances(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Relation>
thingType.getInstances(transaction)
getInstances
getInstances(transaction, transitivity): Stream<Relation>
Retrieves all direct and indirect (or direct only) Thing
objects that are instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Relation>
thingType.getInstances(transaction, Transitivity.EXPLICIT)
getOwns
getOwns(transaction): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
|
|
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwnsOverridden
getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
Retrieves an AttributeType
, ownership of which is overridden for this ThingType
by a given attribute_type
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<AttributeType>
thingType.getOwnsOverridden(transaction, attributeType)
getPlays
getPlays(transaction): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlays
getPlays(transaction, transitivity): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlaysOverridden
getPlaysOverridden(transaction, role): Promise<RoleType>
Retrieves a RoleType
that is overridden by the given role_type
for this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<RoleType>
thingType.getPlaysOverridden(transaction, role)
getRelates
getRelates(transaction): Stream<RoleType>
RelationType#getRelates:(1)
Name | Description | Type |
---|---|---|
|
|
Stream<RoleType>
getRelates
getRelates(transaction, transitivity): Stream<RoleType>
Retrieves roles that this RelationType
relates to directly or via inheritance. If role_label
is given, returns a corresponding RoleType
or None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<RoleType>
relationType.getRelates(transaction, roleLabel, transitivity)
getRelatesForRoleLabel
getRelatesForRoleLabel(transaction, roleLabel): Promise<RoleType>
Name | Description | Type |
---|---|---|
|
|
|
|
|
Promise<RoleType>
getRelatesOverridden
getRelatesOverridden(transaction, roleLabel): Promise<RoleType>
Retrieves a RoleType
that is overridden by the role with the role_label
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Label of the role that overrides an inherited role |
|
Promise<RoleType>
relationType.getRelatesOverridden(transaction, roleLabel)
getSubtypes
getSubtypes(transaction): Stream<RelationType>
Retrieves all direct and indirect subtypes of the ThingType
. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RelationType>
thingType.getSubtypes(transaction)
getSubtypes
getSubtypes(transaction, transitivity): Stream<RelationType>
Retrieves all direct and indirect (or direct only) subtypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<RelationType>
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
getSupertype
getSupertype(transaction): Promise<RelationType>
Retrieves the most immediate supertype of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<RelationType>
thingType.getSupertype(transaction)
getSupertypes
getSupertypes(transaction): Stream<RelationType>
Retrieves all supertypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RelationType>
thingType.getSupertypes(transaction)
getSyntax
getSyntax(transaction): Promise<string>
Produces a pattern for creating this ThingType
in a define
query.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<string>
thingType.getSyntax(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Check if the concept has been deleted
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setAbstract
setAbstract(transaction): Promise<void>
Set a ThingType
to be abstract, meaning it cannot have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.setAbstract(transaction)
setLabel
setLabel(transaction, label): Promise<void>
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
Promise<void>
type.setLabel(transaction, label)
setOwns
setOwns(transaction, attributeType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
|
Adds annotations to the ownership. |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setPlays
setPlays(transaction, role): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setPlays
setPlays(transaction, role, overriddenType): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
|
The role type that this role overrides, if applicable |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setRelates
setRelates(transaction, roleLabel, overriddenLabel?): Promise<void>
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.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new role for the |
|
|
The label being overridden, if applicable |
|
Promise<void>
relationType.setRelates(transaction, roleLabel) relationType.setRelates(transaction, roleLabel, overriddenLabel)
setSupertype
setSupertype(transaction, type): Promise<void>
Sets the supplied RelationType
as the supertype of the current RelationType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
Promise<void>
relationType.setSupertype(transaction, superRelationType).resolve();
unsetAbstract
unsetAbstract(transaction): Promise<void>
Set a ThingType
to be non-abstract, meaning it can have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.unsetAbstract(transaction)
unsetOwns
unsetOwns(transaction, attributeType): Promise<void>
Disallows the instances of this ThingType
from owning the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.unsetOwns(transaction, attributeType)
unsetPlays
unsetPlays(transaction, role): Promise<void>
Disallows the instances of this ThingType
from playing the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not be played by the instances of this type. |
|
Promise<void>
thingType.unsetPlays(transaction, role)
unsetRelates
unsetRelates(transaction, roleLabel): Promise<void>
Disallows this RelationType
from relating to the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not relate to the relation type. |
|
Promise<void>
relationType.unsetRelates(transaction, roleLabel)
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.
Name |
---|
|
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
type.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getPlayerInstances
getPlayerInstances(transaction): Stream<Thing>
Retrieves the Thing
instances that play this role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Thing>
roleType.getPlayerInstances(transaction, transitivity)
getPlayerInstances
getPlayerInstances(transaction, transitivity): Stream<Thing>
Retrieves the Thing
instances that play this role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Thing>
roleType.getPlayerInstances(transaction, transitivity)
getPlayerTypes
getPlayerTypes(transaction): Stream<ThingType>
Retrieves the ThingType
s whose instances play this role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<ThingType>
roleType.getPlayerTypes(transaction, transitivity)
getPlayerTypes
getPlayerTypes(transaction, transitivity): Stream<ThingType>
Retrieves the ThingType
s whose instances play this role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<ThingType>
roleType.getPlayerTypes(transaction, transitivity)
getRelationInstances
getRelationInstances(transaction): Stream<Relation>
Retrieves the Relation
instances that this role is related to.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Relation>
roleType.getRelationInstances(transaction, transitivity)
getRelationInstances
getRelationInstances(transaction, transitivity): Stream<Relation>
Retrieves the Relation
instances that this role is related to.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Relation>
roleType.getRelationInstances(transaction, transitivity)
getRelationType
getRelationType(transaction): Promise<RelationType>
Retrieves the RelationType
that this role is directly related to.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<RelationType>
roleType.getRelationType(transaction)
getRelationTypes
getRelationTypes(transaction): Stream<RelationType>
Retrieves RelationType
s that this role is related to (directly or indirectly).
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RelationType>
roleType.getRelationTypes(transaction)
getSubtypes
getSubtypes(transaction): Stream<RoleType>
Retrieves all direct and indirect (or direct only) subtypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
type.getSubtypes(transaction) type.getSubtypes(transaction, Transitivity.EXPLICIT)
getSupertype
getSupertype(transaction): Promise<RoleType>
Retrieves the most immediate supertype of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<RoleType>
type.getSupertype(transaction)
getSupertypes
getSupertypes(transaction): Stream<RoleType>
Retrieves all supertypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
type.getSupertypes(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Check if the concept has been deleted
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setLabel
setLabel(transaction, label): Promise<void>
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
Promise<void>
type.setLabel(transaction, label)
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.
Name |
---|
|
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
type.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
get
get(transaction, value): Promise<Attribute>
Retrieves an Attribute
of this AttributeType
with the given value if such Attribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise<Attribute>
attribute = attributeType.get(transaction, value)
getBoolean
getBoolean(transaction, value): Promise<Attribute>
Retrieves an Attribute
of this AttributeType
with the given value if such Attribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise<Attribute>
attribute = attributeType.get(transaction, value)
getDateTime
getDateTime(transaction, value): Promise<Attribute>
Retrieves an Attribute
of this AttributeType
with the given value if such Attribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise<Attribute>
attribute = attributeType.get(transaction, value)
getDouble
getDouble(transaction, value): Promise<Attribute>
Retrieves an Attribute
of this AttributeType
with the given value if such Attribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise<Attribute>
attribute = attributeType.get(transaction, value)
getInstances
getInstances(transaction, transitivity): Stream<Attribute>
Retrieves all direct and indirect (or direct only) Attributes
that are instances of this AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<Attribute>
attributeType.getInstances(transaction) attributeType.getInstances(transaction, Transitivity.EXPLICIT)
getInstances
getInstances(transaction): Stream<Attribute>
Retrieves all direct and indirect (or direct only) Thing
objects that are instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Attribute>
thingType.getInstances(transaction, Transitivity.EXPLICIT)
getLong
getLong(transaction, value): Promise<Attribute>
Retrieves an Attribute
of this AttributeType
with the given value if such Attribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise<Attribute>
attribute = attributeType.get(transaction, value)
getOwners
getOwners(transaction, annotations, transitivity): Stream<ThingType>
Retrieve all Things
that own an attribute of this AttributeType
. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Only retrieve |
|
|
|
|
Stream<ThingType>
attributeType.getOwners(transaction) attributeType.getOwners(transaction, [Annotation.UNIQUE]) attributeType.getOwners(transaction, Transitivity.TRANSITIVE) attributeType.getOwners(transaction, [Annotation.UNIQUE], Transitivity.TRANSITIVE)
getOwners
getOwners(transaction): Stream<ThingType>
Name | Description | Type |
---|---|---|
|
|
Stream<ThingType>
getOwners
getOwners(transaction, annotations): Stream<ThingType>
Name | Description | Type |
---|---|---|
|
|
|
|
|
Stream<ThingType>
getOwners
getOwners(transaction, transitivity): Stream<ThingType>
Name | Description | Type |
---|---|---|
|
|
|
|
|
Stream<ThingType>
getOwns
getOwns(transaction): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwns
getOwns(transaction, valueType, annotations, transitivity): Stream<AttributeType>
Retrieves AttributeType
that the instances of this ThingType
are allowed to own directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, only attribute types of this |
|
|
Only retrieve attribute types owned with annotations. |
|
|
|
|
Stream<AttributeType>
thingType.getOwns(transaction) thingType.getOwns(transaction, valueType, Transitivity.EXPLICIT,[Annotation.KEY])
getOwnsOverridden
getOwnsOverridden(transaction, attributeType): Promise<AttributeType>
Retrieves an AttributeType
, ownership of which is overridden for this ThingType
by a given attribute_type
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<AttributeType>
thingType.getOwnsOverridden(transaction, attributeType)
getPlays
getPlays(transaction): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlays
getPlays(transaction, transitivity): Stream<RoleType>
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<RoleType>
thingType.getPlays(transaction) thingType.getPlays(transaction, Transitivity.EXPLICIT)
getPlaysOverridden
getPlaysOverridden(transaction, role): Promise<RoleType>
Retrieves a RoleType
that is overridden by the given role_type
for this ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<RoleType>
thingType.getPlaysOverridden(transaction, role)
getRegex
getRegex(transaction): Promise<string>
Retrieves the regular expression that is defined for this AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<string>
attributeType.getRegex(transaction)
getString
getString(transaction, value): Promise<Attribute>
Retrieves an Attribute
of this AttributeType
with the given value if such Attribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise<Attribute>
attribute = attributeType.get(transaction, value)
getSubtypes
getSubtypes(transaction): Stream<AttributeType>
Retrieves all direct and indirect subtypes of the ThingType
. Equivalent to getSubtypes(transaction, Transitivity.TRANSITIVE)
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<AttributeType>
thingType.getSubtypes(transaction)
getSubtypes
getSubtypes(transaction, valueType): Stream<AttributeType>
Retrieves all direct and indirect (or direct only) subtypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Stream<AttributeType>
thingType.getSubtypes(transaction, Transitivity.EXPLICIT)
getSubtypes
getSubtypes(transaction, transitivity): Stream<AttributeType>
Name | Description | Type |
---|---|---|
|
|
|
|
|
Stream<AttributeType>
getSubtypes
getSubtypes(transaction, valueType, transitivity): Stream<AttributeType>
Name | Description | Type |
---|---|---|
|
|
|
|
|
|
|
|
Stream<AttributeType>
getSupertype
getSupertype(transaction): Promise<AttributeType>
Retrieves the most immediate supertype of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<AttributeType>
thingType.getSupertype(transaction)
getSupertypes
getSupertypes(transaction): Stream<AttributeType>
Retrieves all supertypes of the ThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<AttributeType>
thingType.getSupertypes(transaction)
getSyntax
getSyntax(transaction): Promise<string>
Produces a pattern for creating this ThingType
in a define
query.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<string>
thingType.getSyntax(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Check if the concept has been deleted
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
put
put(transaction, value): Promise<Attribute>
Adds and returns an Attribute
of this AttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise<Attribute>
attribute = attributeType.put(transaction, value)
putBoolean
putBoolean(transaction, value): Promise<Attribute>
Adds and returns an Attribute
of this AttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise<Attribute>
attribute = attributeType.put(transaction, value)
putDateTime
putDateTime(transaction, value): Promise<Attribute>
Adds and returns an Attribute
of this AttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise<Attribute>
attribute = attributeType.put(transaction, value)
putDouble
putDouble(transaction, value): Promise<Attribute>
Adds and returns an Attribute
of this AttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise<Attribute>
attribute = attributeType.put(transaction, value)
putLong
putLong(transaction, value): Promise<Attribute>
Adds and returns an Attribute
of this AttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise<Attribute>
attribute = attributeType.put(transaction, value)
putString
putString(transaction, value): Promise<Attribute>
Adds and returns an Attribute
of this AttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise<Attribute>
attribute = attributeType.put(transaction, value)
setAbstract
setAbstract(transaction): Promise<void>
Set a ThingType
to be abstract, meaning it cannot have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.setAbstract(transaction)
setLabel
setLabel(transaction, label): Promise<void>
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
Promise<void>
type.setLabel(transaction, label)
setOwns
setOwns(transaction, attributeType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setOwns
setOwns(transaction, attributeType, overriddenType, annotations): Promise<void>
Allows the instances of this ThingType
to own the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
|
Adds annotations to the ownership. |
|
Promise<void>
thingType.setOwns(transaction, attributeType) thingType.setOwns(transaction, attributeType, overriddenType,[Annotation.KEY])
setPlays
setPlays(transaction, role): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setPlays
setPlays(transaction, role, overriddenType): Promise<void>
Allows the instances of this ThingType
to play the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the instances of this type |
|
|
The role type that this role overrides, if applicable |
|
Promise<void>
thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, overriddenType)
setRegex
setRegex(transaction, regex): Promise<void>
Sets a regular expression as a constraint for this AttributeType
. Values
of all Attribute
s of this type (inserted earlier or later) should match this regex. Can only be applied for AttributeType
s with a string
value type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Regular expression |
|
Promise<void>
attributeType.setRegex(transaction, regex)
setSupertype
setSupertype(transaction, type): Promise<void>
Sets the supplied AttributeType
as the supertype of the current AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
Promise<void>
attributeType.setSupertype(transaction, superAttributeType).resolve();
unsetAbstract
unsetAbstract(transaction): Promise<void>
Set a ThingType
to be non-abstract, meaning it can have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thingType.unsetAbstract(transaction)
unsetOwns
unsetOwns(transaction, attributeType): Promise<void>
Disallows the instances of this ThingType
from owning the given AttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thingType.unsetOwns(transaction, attributeType)
unsetPlays
unsetPlays(transaction, role): Promise<void>
Disallows the instances of this ThingType
from playing the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not be played by the instances of this type. |
|
Promise<void>
thingType.unsetPlays(transaction, role)
Annotation
Annotations for ownership declarations.
Name | Type | Description |
---|---|---|
|
|
Annotation to specify the attribute owned is a KEY |
|
|
Annotation to specify the owned is UNIQUE |
Data
Thing
Supertypes:
-
Concept
Name | Type | Description |
---|---|---|
|
|
Retrieves the unique id of the Thing. |
|
|
Checks if this Thing is inferred by a [Reasoning Rule]. |
|
|
Retrieves the type which this Thing belongs to. |
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thing.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getHas
getHas(transaction): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeType): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
Only retrieve attributes with all given |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getPlaying
getPlaying(transaction): Stream<RoleType>
Retrieves the roles that this Thing
is currently playing.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thing.getPlaying(transaction)
getRelations
getRelations(transaction): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
getRelations
getRelations(transaction, roleTypes): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The list of roles to filter the relations by. |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Checks if this Thing
is deleted.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
thing.isDeleted(transaction)
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setHas
setHas(transaction, attribute): Promise<void>
Assigns an Attribute
to be owned by this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.setHas(transaction, attribute)
unsetHas
unsetHas(transaction, attribute): Promise<void>
Unassigns an Attribute
from this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.unsetHas(transaction, attribute)
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.
Name | Type | Description |
---|---|---|
|
|
Retrieves the unique id of the Thing. |
|
|
Checks if this Thing is inferred by a [Reasoning Rule]. |
|
|
The type which this Entity belongs to. |
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thing.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getHas
getHas(transaction): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeType): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
Only retrieve attributes with all given |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getPlaying
getPlaying(transaction): Stream<RoleType>
Retrieves the roles that this Thing
is currently playing.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thing.getPlaying(transaction)
getRelations
getRelations(transaction): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
getRelations
getRelations(transaction, roleTypes): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The list of roles to filter the relations by. |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Checks if this Thing
is deleted.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
thing.isDeleted(transaction)
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setHas
setHas(transaction, attribute): Promise<void>
Assigns an Attribute
to be owned by this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.setHas(transaction, attribute)
unsetHas
unsetHas(transaction, attribute): Promise<void>
Unassigns an Attribute
from this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.unsetHas(transaction, attribute)
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.
Name | Type | Description |
---|---|---|
|
|
Retrieves the unique id of the Thing. |
|
|
Checks if this Thing is inferred by a [Reasoning Rule]. |
|
|
The type which this Relation belongs to. |
addRolePlayer
addRolePlayer(transaction, roleType, player): Promise<void>
Adds a new role player to play the given role in this Relation
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the |
|
|
The thing to play the role |
|
Promise<void>
relation.addRolePlayer(transaction, roleType, player)
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thing.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getHas
getHas(transaction): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeType): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
Only retrieve attributes with all given |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getPlayersByRoleType
getPlayersByRoleType(transaction): Stream<Thing>
Retrieves all role players of this Relation
, optionally filtered by given role types.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Thing>
relation.getPlayersByRoleType(transaction) relation.getPlayersByRoleType(transaction, [roleType1, roleType2])
getPlayersByRoleType
getPlayersByRoleType(transaction, roleTypes): Stream<Thing>
Retrieves all role players of this Relation
, optionally filtered by given role types.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
0 or more role types |
|
Stream<Thing>
relation.getPlayersByRoleType(transaction) relation.getPlayersByRoleType(transaction, [roleType1, roleType2])
getPlaying
getPlaying(transaction): Stream<RoleType>
Retrieves the roles that this Thing
is currently playing.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thing.getPlaying(transaction)
getRelating
getRelating(transaction): Stream<RoleType>
Retrieves all role types currently played in this Relation
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
relation.getRelating(transaction)
getRelations
getRelations(transaction): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
getRelations
getRelations(transaction, roleTypes): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The list of roles to filter the relations by. |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
getRolePlayers
getRolePlayers(transaction): Promise<Map<RoleType, Thing[]>>
Retrieves a mapping of all instances involved in the Relation
and the role each play.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<Map<RoleType, Thing[]>>
relation.getRolePlayers(transaction)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Checks if this Thing
is deleted.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
thing.isDeleted(transaction)
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
removeRolePlayer
removeRolePlayer(transaction, roleType, player): Promise<void>
Removes the association of the given instance that plays the given role in this Relation
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to no longer be played by the thing in this |
|
|
The instance to no longer play the role in this |
|
Promise<void>
relation.removeRolePlayer(transaction, roleType, player)
setHas
setHas(transaction, attribute): Promise<void>
Assigns an Attribute
to be owned by this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.setHas(transaction, attribute)
unsetHas
unsetHas(transaction, attribute): Promise<void>
Unassigns an Attribute
from this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.unsetHas(transaction, attribute)
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.
Name | Type | Description |
---|---|---|
|
|
Retrieves the unique id of the Thing. |
|
|
Checks if this Thing is inferred by a [Reasoning Rule]. |
|
|
The type which this Attribute belongs to. |
|
|
The value which the Attribute instance holds. |
|
|
The type of the value which the Attribute instance holds. |
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
delete
delete(transaction): Promise<void>
Deletes this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<void>
thing.delete(transaction)
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
getHas
getHas(transaction): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeType): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getHas
getHas(transaction, attributeTypes, annotations): Stream<Attribute>
Retrieves the Attribute
s that this Thing
owns. Optionally, filtered by an AttributeType
or a list of AttributeType
s. Optionally, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
Only retrieve attributes with all given |
|
Stream<Attribute>
thing.getHas(transaction) thing.getHas(transaction, attributeType, [Annotation.KEY])
getOwners
getOwners(transaction, ownerType?): Stream<Thing>
Retrieves the instances that own this Attribute
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
If specified, filter results for only owners of the given type |
|
Stream<Thing>
attribute.getOwners(transaction) attribute.getOwners(transaction, ownerType)
getPlaying
getPlaying(transaction): Stream<RoleType>
Retrieves the roles that this Thing
is currently playing.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<RoleType>
thing.getPlaying(transaction)
getRelations
getRelations(transaction): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
getRelations
getRelations(transaction, roleTypes): Stream<Relation>
Retrieves all the Relations
which this Thing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The list of roles to filter the relations by. |
|
Stream<Relation>
thing.getRelations(transaction, roleTypes)
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isDeleted
isDeleted(transaction): Promise<boolean>
Checks if this Thing
is deleted.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise<boolean>
thing.isDeleted(transaction)
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
isType
isType(): boolean
Checks if the concept is a Type
.
boolean
concept.isType()
isValue
isValue(): boolean
Checks if the concept is a Value
.
boolean
concept.isValue()
setHas
setHas(transaction, attribute): Promise<void>
Assigns an Attribute
to be owned by this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.setHas(transaction, attribute)
unsetHas
unsetHas(transaction, attribute): Promise<void>
Unassigns an Attribute
from this Thing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise<void>
thing.unsetHas(transaction, attribute)
Value
Supertypes:
-
Concept
Name | Type | Description |
---|---|---|
|
|
Retrieves the value which this value concept holds. |
|
|
The ValueType of this value concept |
asAttribute
asAttribute(): Attribute
Casts the concept to Attribute
.
Attribute
concept.asAttribute()
asAttributeType
asAttributeType(): AttributeType
Casts the concept to AttributeType
.
AttributeType
concept.asAttributeType()
asBoolean
asBoolean(): boolean
Returns a boolean
value of this value concept. If the value has another type, raises an exception.
boolean
value.asBoolean()
asDateTime
asDateTime(): Date
Returns a datetime
value of this value concept. If the value has another type, raises an exception.
Date
value.asDatetime()
asDouble
asDouble(): number
Returns a number
value of this value concept. If the value has another type, raises an exception.
number
value.asDouble()
asEntity
asEntity(): Entity
Casts the concept to Entity
.
Entity
concept.asEntity()
asEntityType
asEntityType(): EntityType
Casts the concept to EntityType
.
EntityType
concept.asEntityType()
asLong
asLong(): number
Returns a number
value of this value concept. If the value has another type, raises an exception.
number
value.asLong()
asRelation
asRelation(): Relation
Casts the concept to Relation
.
Relation
concept.asRelation()
asRelationType
asRelationType(): RelationType
Casts the concept to RelationType
.
RelationType
concept.asRelationType()
asRoleType
asRoleType(): RoleType
Casts the concept to RoleType
.
RoleType
concept.asRoleType()
asString
asString(): string
Returns a string
value of this value concept. If the value has another type, raises an exception.
string
value.asString()
asThingType
asThingType(): ThingType
Casts the concept to ThingType
.
ThingType
concept.asThingType()
equals
equals(concept): boolean
Checks if this concept is equal to the argument concept
.
Name | Description | Type |
---|---|---|
|
The concept to compare to. |
|
boolean
isAttribute
isAttribute(): boolean
Checks if the concept is an Attribute
.
boolean
concept.isAttribute()
isAttributeType
isAttributeType(): boolean
Checks if the concept is an AttributeType
.
boolean
concept.isAttributeType()
isBoolean
isBoolean(): boolean
Returns True
if the value which this value concept holds is of type boolean
. Otherwise, returns False
.
boolean
value.isBoolean()
isDateTime
isDateTime(): boolean
Returns True
if the value which this value concept holds is of type datetime
. Otherwise, returns False
.
boolean
value.isDatetime()
isDouble
isDouble(): boolean
Returns True
if the value which this value concept holds is of type double
. Otherwise, returns False
.
boolean
value.isDouble()
isEntity
isEntity(): boolean
Checks if the concept is an Entity
.
boolean
concept.isEntity()
isEntityType
isEntityType(): boolean
Checks if the concept is an EntityType
.
boolean
concept.isEntityType()
isLong
isLong(): boolean
Returns True
if the value which this value concept holds is of type long
. Otherwise, returns False
.
boolean
value.isLong()
isRelation
isRelation(): boolean
Checks if the concept is a Relation
.
boolean
concept.isRelation()
isRelationType
isRelationType(): boolean
Checks if the concept is a RelationType
.
boolean
concept.isRelationType()
isRoleType
isRoleType(): boolean
Checks if the concept is a RoleType
.
boolean
concept.isRoleType()
isString
isString(): boolean
Returns True
if the value which this value concept holds is of type string
. Otherwise, returns False
.
boolean
value.isString()
isThing
isThing(): boolean
Checks if the concept is a Thing
.
boolean
concept.isThing()
isThingType
isThingType(): boolean
Checks if the concept is a ThingType
.
boolean
concept.isThingType()
Logic
LogicManager
Provides methods for manipulating rules in the database.
getRule
getRule(label): Promise<Rule>
Retrieves the Rule that has the given label.
Name | Description | Type |
---|---|---|
|
The label of the Rule to create or retrieve |
|
Promise<Rule>
transaction.logic.getRule(label)
getRules
getRules(): Stream<Rule>
Retrieves all rules.
Stream<Rule>
transaction.logic.getRules()
putRule
putRule(label, when, then): Promise<Rule>
Creates a new Rule if none exists with the given label, or replaces the existing one.
Name | Description | Type |
---|---|---|
|
The label of the Rule to create or replace |
|
|
The when body of the rule to create |
|
|
The then body of the rule to create |
|
Promise<Rule>
transaction.logic.putRule(label, when, then)
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.
Name | Type | Description |
---|---|---|
|
|
The unique label of the rule. |
|
|
The single statement that constitutes the ‘then’ of the rule. |
|
|
The statements that constitute the ‘when’ of the rule. |
delete
delete(transaction): Promise<void>
Deletes this rule.
Name | Description | Type |
---|---|---|
|
The current |
|
Promise<void>
rule.delete(transaction)
Errors
TypeDBDriverError
Supertypes:
-
Error
Errors encountered when interacting with TypeDB
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
messageTemplate
get messageTemplate(): ErrorMessage
Returns the message template for this error.
ErrorMessage
ErrorMessage
Class defining the error-code and message template for TypeDBDriverError
s
message
message(...args): string
Generates the error message by substituting args
into the messageTemplate
Name | Description | Type |
---|---|---|
|
The format arguments to the message-template. |
|
string