C# driver API reference
Connection
Drivers
Package: TypeDB.Driver
CloudDriver
static ITypeDBDriver CloudDriver(string address, TypeDBCredential credential)
Open a TypeDB Driver to a TypeDB Cloud server available at the provided address, using the provided credential.
Name | Description | Type |
---|---|---|
|
The address of the TypeDB server |
|
|
The credential to connect with |
|
ITypeDBDriver
Drivers.CloudDriver(address, credential);
CloudDriver
static ITypeDBDriver CloudDriver(ICollection< string > addresses, TypeDBCredential credential)
Open a TypeDB Driver to TypeDB Cloud server(s) available at the provided addresses, using the provided credential.
Name | Description | Type |
---|---|---|
|
The address(es) of the TypeDB server(s) or translation map from addresses to be used by the driver for connection to addresses received from the TypeDB server(s) |
|
|
The credential to connect with |
|
ITypeDBDriver
Drivers.CloudDriver(addresses, credential);
ITypeDBDriver
Package: TypeDB.Driver.Api
Close
void Close()
Closes the driver. Before instantiating a new driver, the driver that’s currently open should first be closed.
void
driver.Close();
Databases
IDatabaseManager TypeDB.Driver.Api.ITypeDBDriver.Databases
The IDatabaseManager
for this connection, providing access to database management methods.
IDatabaseManager
driver.Databases;
GetCurrentUser
IUser GetCurrentUser()
Returns the logged-in user for the connection. Only for TypeDB Cloud.
IUser
driver.GetCurrentUser();
IsOpen
bool IsOpen()
Checks whether this connection is presently open.
bool
driver.IsOpen();
Session
ITypeDBSession Session(string database, SessionType type)
Opens a session to the given database with default options.
See also
ITypeDBDriver::Session(string, SessionType, TypeDBOptions);
ITypeDBSession
Session
ITypeDBSession Session(string database, SessionType type, TypeDBOptions options)
Opens a communication tunnel (session) to the given database on the running TypeDB server. For more information on the methods, available with sessions, see the ITypeDBSession
section.
Name | Description | Type |
---|---|---|
|
The name of the database with which the session connects |
|
|
The type of session to be created (Data or Schema) |
|
|
|
|
ITypeDBSession
driver.Session(database, sessionType, options);
TypeDBCredential
Package: TypeDB.Driver.Api
User credentials and TLS encryption settings for connecting to TypeDB Cloud.
// Creates a credential as above, but the connection will be made over TLS.
TypeDBCredential credential = new TypeDBCredential(username, password, true);
// Creates a credential as above, but TLS will use the specified CA to authenticate server certificates.
TypeDBCredential credential = new TypeDBCredential(username, password, Environment.GetEnvironmentVariable("ROOT_CA")!);
TypeDBCredential
TypeDBCredential(string username, string password, bool tlsEnabled)
Name | Description | Type |
---|---|---|
|
The name of the user to connect as |
|
|
The password for the user |
|
|
Specify whether the connection to TypeDB Cloud must be done over TLS |
|
TypeDBCredential
TypeDBCredential
TypeDBCredential(string username, string password, string? tlsRootCAPath)
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
IDatabaseManager
Package: TypeDB.Driver.Api
Provides access to all database management methods.
Contains
bool Contains(string name)
Checks if a database with the given name exists.
Name | Description | Type |
---|---|---|
|
The database name to be checked |
|
bool
driver.Databases.Contains(name);
Create
void Create(string name)
Create a database with the given name.
Name | Description | Type |
---|---|---|
|
The name of the database to be created |
|
void
driver.Databases.Create(name);
IDatabase
Package: TypeDB.Driver.Api
GetReplicas
ISet< IReplica > GetReplicas()
Set of Replica
instances for this database. Only works in TypeDB Cloud
ISet< IReplica >
database.GetReplicas();
GetRuleSchema
string GetRuleSchema()
The rules in the schema as a valid TypeQL define query string.
string
database.GetRuleSchema();
GetSchema
string GetSchema()
A full schema text as a valid TypeQL define query string.
string
database.GetSchema();
GetTypeSchema
string GetTypeSchema()
The types in the schema as a valid TypeQL define query string.
string
database.GetTypeSchema();
Name
string TypeDB.Driver.Api.IDatabase.Name
The database name as a string.
string
database.Name;
IReplica
Package: TypeDB.Driver.Api.IDatabase
The metadata and state of an individual raft replica of a database.
IsPreferred
bool IsPreferred()
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.
bool
IsPrimary
bool IsPrimary()
Checks whether this is the primary replica of the raft cluster.
bool
IUserManager
Package: TypeDB.Driver.Api
Provides access to all user management methods.
Contains
bool Contains(string username)
Checks if a user with the given name exists.
Name | Description | Type |
---|---|---|
|
The user name to be checked |
|
bool
driver.Users.Contains(username);
Create
void Create(string username, string password)
Creates a user with the given name & password.
Name | Description | Type |
---|---|---|
|
The name of the user to be created |
|
|
The password of the user to be created |
|
void
driver.Users.Create(username, password);
Delete
void Delete(string username)
Deletes a user with the given name.
Name | Description | Type |
---|---|---|
|
The name of the user to be deleted |
|
void
driver.Users.Delete(username);
Get
IUser? Get(string username)
Retrieves a user with the given name.
Name | Description | Type |
---|---|---|
|
The name of the user to retrieve |
|
IUser?
driver.Users.Get(username);
GetAll
ISet< IUser > GetAll()
Retrieves all users which exist on the TypeDB server.
ISet< IUser >
driver.Users.GetAll();
SetPassword
void SetPassword(string username, string password)
Sets a new password for a user. This operation can only be performed by administrators.
Name | Description | Type |
---|---|---|
|
The name of the user to set the password of |
|
|
The new password |
|
void
driver.Users.SetPassword(username, password);
IUser
Package: TypeDB.Driver.Api
TypeDB user information
PasswordExpirySeconds
long? TypeDB.Driver.Api.IUser.PasswordExpirySeconds
Returns the number of seconds remaining till this user’s current password expires.
long?
Session
ITypeDBSession
Package: TypeDB.Driver.Api
Close
void Close()
Closes the session. Before opening a new session, the session currently open should first be closed.
void
session.Close();
DatabaseName
string TypeDB.Driver.Api.ITypeDBSession.DatabaseName
Returns the name of the database of the session.
string
session.DatabaseName;
IsOpen
bool IsOpen()
Checks whether this session is open.
bool
session.IsOpen();
OnClose
void OnClose(Action function)
Registers a callback function which will be executed when this session is closed.
Name | Description | Type |
---|---|---|
|
The callback function. |
|
void
session.OnClose(function);
OnReopen
void OnReopen(Action function)
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);
Options
TypeDBOptions TypeDB.Driver.Api.ITypeDBSession.Options
Gets the options for the session.
TypeDBOptions
session.Options;
Transaction
ITypeDBTransaction Transaction(TransactionType type)
Opens a transaction on the database connected to the session with default options.
See also
ITypeDBSession::Transaction(TransactionType, TypeDBOptions)
ITypeDBTransaction
Transaction
ITypeDBTransaction Transaction(TransactionType type, TypeDBOptions options)
Opens a transaction to perform read or write queries on the database connected to the session.
Name | Description | Type |
---|---|---|
|
The type of transaction to be created (Read or Write) |
|
|
Options for the session |
|
ITypeDBTransaction
session.Transaction(transactionType, options);
SessionType
Package: TypeDB.Driver.Api
Used to specify the type of the session.
driver.Session(database, SessionType.Schema);
Name |
---|
|
|
TypeDBOptions
Package: TypeDB.Driver.Api
TypeDB session and transaction options. TypeDBOptions
object can be used to override the default server behaviour.
Explain
bool? Explain()
Returns the value set for the explanation in this TypeDBOptions
object. If set to true
, explanations for queries are enabled.
bool?
options.Explain();
Explain
TypeDBOptions Explain(bool explain)
Explicitly enables or disables explanations. If set to true
, enables explanations for queries. Only affects read transactions.
Name | Description | Type |
---|---|---|
|
Explicitly enable or disable explanations |
|
TypeDBOptions
options.Explain(explain);
Infer
bool? Infer()
Returns the value set for the inference in this TypeDBOptions
object.
bool?
options.Infer();
Infer
TypeDBOptions Infer(bool infer)
Explicitly enables or disables inference. Only settable at transaction level and above. Only affects read transactions.
Name | Description | Type |
---|---|---|
|
Explicitly enable or disable inference |
|
TypeDBOptions
options.Infer(infer);
Parallel
bool? Parallel()
Returns the value set for the parallel execution in this TypeDBOptions
object. If set to true
, the server uses parallel instead of single-threaded execution.
bool?
options.Parallel();
Parallel
TypeDBOptions Parallel(bool parallel)
Explicitly enables or disables parallel execution. If set to true
, the server uses parallel instead of single-threaded execution.
Name | Description | Type |
---|---|---|
|
Explicitly enable or disable parallel execution |
|
TypeDBOptions
options.Parallel(parallel);
Prefetch
bool? Prefetch()
Returns the value set for the prefetching in this TypeDBOptions
object. If set to true
, the first batch of answers is streamed to the driver even without an explicit request for it.
bool?
options.Prefetch();
Prefetch
TypeDBOptions Prefetch(bool prefetch)
Explicitly enables or disables prefetching. If set to true
, the first batch of answers is streamed to the driver even without an explicit request for it.
Name | Description | Type |
---|---|---|
|
Explicitly enable or disable prefetching |
|
TypeDBOptions
options.Prefetch(prefetch);
PrefetchSize
int? PrefetchSize()
Returns the value set for the prefetch size in this TypeDBOptions
object. If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
int?
options.PrefetchSize();
PrefetchSize
TypeDBOptions PrefetchSize(int prefetchSize)
Explicitly sets a prefetch size. If set, specifies a guideline number of answers that the server should send before the driver issues a fresh request.
Name | Description | Type |
---|---|---|
|
Number of answers that the server should send before the driver issues a fresh request |
|
TypeDBOptions
options.PrefetchSize(prefetchSize);
ReadAnyReplica
bool? ReadAnyReplica()
Returns the value set for reading data from any replica in this TypeDBOptions
object. If set to True
, enables reading data from any replica, potentially boosting read throughput.
bool?
options.ReadAnyReplica();
ReadAnyReplica
TypeDBOptions ReadAnyReplica(bool readAnyReplica)
Explicitly enables or disables reading data from any replica. If set to True
, enables reading data from any replica, potentially boosting read throughput. Only settable in TypeDB Cloud.
Name | Description | Type |
---|---|---|
|
Explicitly enable or disable reading data from any replica |
|
TypeDBOptions
options.ReadAnyReplica(readAnyReplica);
SchemaLockAcquireTimeoutMillis
int? SchemaLockAcquireTimeoutMillis()
Returns the value set for the schema lock acquire timeout in this TypeDBOptions
object. If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.
int?
options.SchemaLockAcquireTimeoutMillis();
SchemaLockAcquireTimeoutMillis
TypeDBOptions SchemaLockAcquireTimeoutMillis(int schemaLockAcquireTimeoutMillis)
Explicitly sets schema lock acquire timeout. If set, specifies how long the driver should wait if opening a session or transaction is blocked by a schema write lock.
Name | Description | Type |
---|---|---|
|
How long the driver should wait if opening a session or transaction is blocked by a schema write lock. |
|
TypeDBOptions
options.SchemaLockAcquireTimeoutMillis(schemaLockAcquireTimeoutMillis);
SessionIdleTimeoutMillis
int? SessionIdleTimeoutMillis()
Returns the value set for the session idle timeout in this TypeDBOptions
object. If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.
int?
options.SessionIdleTimeoutMillis();
SessionIdleTimeoutMillis
TypeDBOptions SessionIdleTimeoutMillis(int sessionIdleTimeoutMillis)
Explicitly sets a session idle timeout. If set, specifies a timeout that allows the server to close sessions if the driver terminates or becomes unresponsive.
Name | Description | Type |
---|---|---|
|
timeout that allows the server to close sessions if the driver terminates or becomes unresponsive. |
|
TypeDBOptions
options.SessionIdleTimeoutMillis(sessionIdleTimeoutMillis);
TraceInference
bool? TraceInference()
Returns the value set for reasoning tracing in this TypeDBOptions
object. If set to true
, reasoning tracing graphs are output in the logging directory.
bool?
options.TraceInference();
TraceInference
TypeDBOptions TraceInference(bool traceInference)
Explicitly enables or disables reasoning tracing. If set to true
, reasoning tracing graphs are output in the logging directory. Should be used with parallel = False
.
Name | Description | Type |
---|---|---|
|
Explicitly enable or disable reasoning tracing |
|
TypeDBOptions
options.TraceInference(traceInference);
TransactionTimeoutMillis
int? TransactionTimeoutMillis()
Returns the value set for the transaction timeout in this TypeDBOptions
object. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
int?
options.TransactionTimeoutMillis();
TransactionTimeoutMillis
TypeDBOptions TransactionTimeoutMillis(int transactionTimeoutMillis)
Explicitly set a transaction timeout. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.
Name | Description | Type |
---|---|---|
|
Timeout for killing transactions automatically. |
|
TypeDBOptions
options.TransactionTimeoutMillis(transactionTimeoutMillis);
Transaction
ITypeDBTransaction
Package: TypeDB.Driver.Api
Commit
void Commit()
Commits the changes made via this transaction to the TypeDB database. Whether or not the transaction is committed successfully, it gets closed after the commit call.
void
transaction.Commit();
Concepts
IConceptManager TypeDB.Driver.Api.ITypeDBTransaction.Concepts
The ConceptManager
for this transaction, providing access to all Concept API methods.
IConceptManager
transaction.Concepts;
IsOpen
bool IsOpen()
Checks whether this transaction is open.
bool
transaction.IsOpen();
Logic
ILogicManager TypeDB.Driver.Api.ITypeDBTransaction.Logic
The LogicManager
for this Transaction, providing access to all Concept API - Logic methods.
ILogicManager
transaction.Logic;
OnClose
void OnClose(Action< Exception > function)
Registers a callback function which will be executed when this transaction is closed.
Name | Description | Type |
---|---|---|
|
The callback function. |
|
void
transaction.OnClose(function);
Options
TypeDBOptions TypeDB.Driver.Api.ITypeDBTransaction.Options
The options for the transaction.
TypeDBOptions
transaction.Options;
Query
IQueryManager TypeDB.Driver.Api.ITypeDBTransaction.Query
The
for this Transaction, from which any TypeQL query can be executed.`QueryManager
`
IQueryManager
transaction.Query;
TransactionType
Package: TypeDB.Driver.Api
Used to specify the type of transaction.
session.Transaction(TransactionType.Read);
Name |
---|
|
|
IQueryManager
Package: TypeDB.Driver.Api
Provides methods for executing TypeQL queries in the transaction.
Define
VoidPromise Define(string query)
Performs a TypeQL Define query with default options.
See also
IQueryManager::Define(string, TypeDBOptions)
VoidPromise
Define
VoidPromise Define(string query, TypeDBOptions options)
Performs a TypeQL Define query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Define query to be executed |
|
|
Specify query options |
|
VoidPromise
transaction.Query.Define(query, options).Resolve()
Delete
VoidPromise Delete(string query)
Performs a TypeQL Delete query with default options.
See also
IQueryManager::Delete(string, TypeDBOptions)
VoidPromise
Delete
VoidPromise Delete(string query, TypeDBOptions options)
Performs a TypeQL Delete query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Delete query to be executed |
|
|
Specify query options |
|
VoidPromise
transaction.Query.Delete(query, options).Resolve()
Explain
IEnumerable< IExplanation > IExplainable explainable)
Performs a TypeQL Explain query with default options.
See also
IQueryManager::Explain(IConceptMap.IExplainable, TypeDBOptions)
IEnumerable< IExplanation > IExplainable
Explain
IEnumerable< IExplanation > IExplainable explainable, TypeDBOptions options)
Performs a TypeQL Explain query in the transaction.
Name | Description | Type |
---|---|---|
|
The IExplainable to be explained |
|
|
Specify query options |
|
IEnumerable< IExplanation > IExplainable explainable, TypeDBOptions
transaction.Query.Explain(explainable, options)
Fetch
IEnumerable< JObject > Fetch(string query)
Performs a TypeQL Fetch (Fetch) with default options.
See also
IQueryManager::Fetch(string, TypeDBOptions)
IEnumerable< JObject >
Fetch
IEnumerable< JObject > Fetch(string query, TypeDBOptions options)
Performs a TypeQL Fetch (Fetch) query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Fetch (Fetch) query to be executed |
|
|
Specify query options |
|
IEnumerable< JObject >
transaction.Query.Fetch(query, options)
Get
IEnumerable< IConceptMap > Get(string query)
Performs a TypeQL Get (Get) with default options.
See also
IQueryManager::Get(string, TypeDBOptions)
IEnumerable< IConceptMap >
Get
IEnumerable< IConceptMap > Get(string query, TypeDBOptions options)
Performs a TypeQL Get (Get) query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Get (Get) query to be executed |
|
|
Specify query options |
|
IEnumerable< IConceptMap >
transaction.Query.Get(query, options);
GetAggregate
Promise< IValue > GetAggregate(string query)
Performs a TypeQL Get Aggregate query with default options.
See also
IQueryManager::GetAggregate(string, TypeDBOptions)
Promise< IValue >
GetAggregate
Promise< IValue > GetAggregate(string query, TypeDBOptions options)
Performs a TypeQL Get Aggregate query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Get Aggregate query to be executed |
|
|
Specify query options |
|
Promise< IValue >
transaction.Query.GetAggregate(query, options).Resolve()
GetGroup
IEnumerable< IConceptMapGroup > GetGroup(string query)
Performs a TypeQL Get Group query with default options.
See also
IQueryManager::GetGroup(string, TypeDBOptions)
IEnumerable< IConceptMapGroup >
GetGroup
IEnumerable< IConceptMapGroup > GetGroup(string query, TypeDBOptions options)
Performs a TypeQL Get Group query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Get Group query to be executed |
|
|
Specify query options |
|
IEnumerable< IConceptMapGroup >
transaction.Query.GetGroup(query, options)
GetGroupAggregate
IEnumerable< IValueGroup > GetGroupAggregate(string query)
Performs a TypeQL Get Group Aggregate query with default options.
See also
IQueryManager::GetGroupAggregate(string, TypeDBOptions)
IEnumerable< IValueGroup >
GetGroupAggregate
IEnumerable< IValueGroup > GetGroupAggregate(string query, TypeDBOptions options)
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 |
|
IEnumerable< IValueGroup >
transaction.Query.GetGroupAggregate(query, options)
Insert
IEnumerable< IConceptMap > Insert(string query)
Performs a TypeQL Insert query with default options.
See also
IQueryManager::Insert(string, TypeDBOptions)
IEnumerable< IConceptMap >
Insert
IEnumerable< IConceptMap > Insert(string query, TypeDBOptions options)
Performs a TypeQL Insert query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Insert query to be executed |
|
|
Specify query options |
|
IEnumerable< IConceptMap >
transaction.Query.Insert(query, options)
Undefine
VoidPromise Undefine(string query)
Performs a TypeQL Undefine query with default options.
See also
IQueryManager::Undefine(string, TypeDBOptions)
VoidPromise
Undefine
VoidPromise Undefine(string query, TypeDBOptions options)
Performs a TypeQL Undefine query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Undefine query to be executed |
|
|
Specify query options |
|
VoidPromise
transaction.Query.Undefine(query, options).Resolve()
Update
IEnumerable< IConceptMap > Update(string query)
Performs a TypeQL Update query with default options.
See also
IQueryManager::Update(string, TypeDBOptions)
IEnumerable< IConceptMap >
Update
IEnumerable< IConceptMap > Update(string query, TypeDBOptions options)
Performs a TypeQL Update query in the transaction.
Name | Description | Type |
---|---|---|
|
The TypeQL Update query to be executed |
|
|
Specify query options |
|
IEnumerable< IConceptMap >
transaction.Query.Update(query, options)
Answer
IConceptMap
Package: TypeDB.Driver.Api
Contains a mapping of variables to concepts.
AllExplainables
IExplainables TypeDB.Driver.Api.IConceptMap.AllExplainables
Gets the IExplainables
object for this IConceptMap
, exposing which of the concepts in this IConceptMap
are explainable.
IExplainables
conceptMap.AllExplainables;
Get
IConcept Get(string variable)
Retrieves a concept for a given variable name.
Name | Description | Type |
---|---|---|
|
The string representation of a variable |
|
IConcept
conceptMap.Get(variable);
GetConcepts
IEnumerable< IConcept > GetConcepts()
Returns a collection of all concepts in this IConceptMap
.
IEnumerable< IConcept >
conceptMap.GetConcepts();
IConceptMapGroup
Package: TypeDB.Driver.Api
Contains an element of the group query result.
IValueGroup
Package: TypeDB.Driver.Api
Contains an element of the group aggregate query result.
IExplainables
Package: TypeDB.Driver.Api.IConceptMap
Contains explainable objects.
Attribute
IExplainable Attribute(string variable)
Retrieves the explainable attribute with the given variable name.
Name | Description | Type |
---|---|---|
|
The string representation of a variable |
|
IExplainable
conceptMap.AllExplainables.Attribute(variable);
GetAttributes
IEnumerable< KeyValuePair< string, IExplainable > > GetAttributes()
Retrieves all of this IConceptMap
’s explainable attributes.
IEnumerable< KeyValuePair< string, IExplainable > >
conceptMap.AllExplainables.GetAttributes();
GetOwnerships
IEnumerable< KeyValuePair< KeyValuePair< string, string >, IExplainable > > GetOwnerships()
Retrieves all of this IConceptMap
’s explainable ownerships.
IEnumerable< KeyValuePair< KeyValuePair< string, string >, IExplainable > >
conceptMap.AllExplainables.GetOwnerships();
GetRelations
IEnumerable< KeyValuePair< string, IExplainable > > GetRelations()
Retrieves all of this IConceptMap
’s explainable relations.
IEnumerable< KeyValuePair< string, IExplainable > >
conceptMap.AllExplainables.GetRelations();
Ownership
IExplainable Ownership(string owner, string attribute)
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 |
|
IExplainable
conceptMap.AllExplainables.Ownership(owner, attribute);
IExplainable
Package: TypeDB.Driver.Api.IConceptMap
Contains an explainable object.
IExplanation
Package: TypeDB.Driver.Api
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.
Conclusion
IConceptMap TypeDB.Driver.Api.IExplanation.Conclusion
Retrieves the Conclusion for this Explanation.
IConceptMap
explanation.Conclusion
Condition
IConceptMap TypeDB.Driver.Api.IExplanation.Condition
Retrieves the Condition for this Explanation.
IConceptMap
explanation.Condition
GetQueryVariables
ISet< string > GetQueryVariables()
Retrieves the query variables for this Explanation
.
ISet< string >
explanation.GetQueryVariables()
QueryVariableMapping
ISet< string > QueryVariableMapping(string variable)
Retrieves the rule variables corresponding to the query variable var for this Explanation
.
Name | Description | Type |
---|---|---|
|
The query variable to map to rule variables. |
|
ISet< string >
explanation.VariableMapping(variable)
Promise< T >
Package: TypeDB.Driver.Common
A Promise
represents an asynchronous network operation.
The request it represents is performed immediately. The response is only retrieved once the Promise
is Resolve
d.
Map< TFrom, TTo >
static Promise< TTo > TypeDB.Driver.Common.Promise< T >.Map< TFrom, TTo >(Func< TFrom? > resolver, Func< TFrom, TTo > selector)
Helper function to map promises.
Name | Description | Type |
---|---|---|
|
The function to wrap into the promise |
|
|
The mapping (like Select from Linq) function |
|
Promise< TTo >
Promise<TFrom>.Map<TFrom, TTo>(resolver, selector);
Concept
IConceptManager
Package: TypeDB.Driver.Api
Provides access for all Concept API methods.
GetAttribute
Promise< IAttribute > GetAttribute(string iid)
Retrieves an IAttribute
by its iid.
Name | Description | Type |
---|---|---|
|
The iid of the |
|
Promise< IAttribute >
transaction.Concepts.GetAttribute(iid).Resolve();
GetAttributeType
Promise< IAttributeType > GetAttributeType(string label)
Retrieves an IAttributeType
by its label.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise< IAttributeType >
transaction.Concepts.GetAttributeType(label).Resolve();
GetEntity
Promise< IEntity > GetEntity(string iid)
Retrieves an IEntity
by its iid.
Name | Description | Type |
---|---|---|
|
The iid of the |
|
Promise< IEntity >
transaction.Concepts.GetEntity(iid).Resolve();
GetEntityType
Promise< IEntityType > GetEntityType(string label)
Retrieves an IEntityType
by its label.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise< IEntityType >
transaction.Concepts.GetEntityType(label).Resolve();
GetRelation
Promise< IRelation > GetRelation(string iid)
Retrieves a IRelation
by its iid.
Name | Description | Type |
---|---|---|
|
The iid of the |
|
Promise< IRelation >
transaction.Concepts.GetRelation(iid).Resolve();
GetRelationType
Promise< IRelationType > GetRelationType(string label)
Retrieves a IRelationType
by its label.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise< IRelationType >
transaction.Concepts.GetRelationType(label).Resolve();
GetSchemaExceptions
IList< TypeDBException > GetSchemaExceptions()
A list of all schema exceptions for the current transaction.
IList< TypeDBException >
transaction.Concepts.GetSchemaExceptions();
PutAttributeType
Promise< IAttributeType > PutAttributeType(string label, IValue.ValueType valueType)
Creates a new IAttributeType
if none exists with the given label, or retrieves the existing one.
Name | Description | Type |
---|---|---|
|
The label of the |
|
|
The value type of the |
|
Promise< IAttributeType >
await transaction.Concepts.PutAttributeType(label, valueType).Resolve();
PutEntityType
Promise< IEntityType > PutEntityType(string label)
Creates a new IEntityType
if none exists with the given label, otherwise retrieves the existing one.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise< IEntityType >
transaction.Concepts.PutEntityType(label).Resolve();
PutRelationType
Promise< IRelationType > PutRelationType(string label)
Creates a new IRelationType
if none exists with the given label, otherwise retrieves the existing one.
Name | Description | Type |
---|---|---|
|
The label of the |
|
Promise< IRelationType >
transaction.Concepts.PutRelationType(label).Resolve();
RootAttributeType
IAttributeType TypeDB.Driver.Api.IConceptManager.RootAttributeType
The root IAttributeType
, “attribute”.
IAttributeType
transaction.Concepts.RootAttributeType;
IConcept
Package: TypeDB.Driver.Api
AsAttribute
IAttribute AsAttribute()
Casts the concept to IAttribute
.
Implemented in TypeDB.Driver.Api.IAttribute.
IAttribute
concept.AsAttribute();
AsAttributeType
IAttributeType AsAttributeType()
Casts the concept to IAttributeType
.
Implemented in TypeDB.Driver.Api.IAttributeType.
IAttributeType
concept.AsAttributeType();
AsEntity
IEntity AsEntity()
Casts the concept to IEntity
.
Implemented in TypeDB.Driver.Api.IEntity.
IEntity
concept.AsEntity();
AsEntityType
IEntityType AsEntityType()
Casts the concept to IEntityType
.
Implemented in TypeDB.Driver.Api.IEntityType.
IEntityType
concept.AsEntityType();
AsRelation
IRelation AsRelation()
Casts the concept to IRelation
.
Implemented in TypeDB.Driver.Api.IRelation.
IRelation
concept.AsRelation();
AsRelationType
IRelationType AsRelationType()
Casts the concept to IRelationType
.
Implemented in TypeDB.Driver.Api.IRelationType.
IRelationType
concept.AsRelationType();
AsRoleType
IRoleType AsRoleType()
Casts the concept to IRoleType
.
Implemented in TypeDB.Driver.Api.IRoleType.
IRoleType
concept.AsRoleType();
AsThing
IThing AsThing()
Casts the concept to IThing
.
Implemented in TypeDB.Driver.Api.IThing.
IThing
concept.AsThing();
AsThingType
IThingType AsThingType()
Casts the concept to IThingType
.
Implemented in TypeDB.Driver.Api.IThingType.
IThingType
concept.AsThingType();
AsType
IType AsType()
Casts the concept to IType
.
Implemented in TypeDB.Driver.Api.IType.
IType
concept.AsType();
AsValue
IValue AsValue()
Casts the concept to IValue
.
Implemented in TypeDB.Driver.Api.IValue.
IValue
concept.AsValue();
IsAttribute
bool IsAttribute()
Checks if the concept is an IAttribute
.
Implemented in TypeDB.Driver.Api.IAttribute.
bool
concept.IsAttribute();
IsAttributeType
bool IsAttributeType()
Checks if the concept is an IAttributeType
.
Implemented in TypeDB.Driver.Api.IAttributeType.
bool
concept.IsAttributeType();
IsEntity
bool IsEntity()
Checks if the concept is an IEntity
.
Implemented in TypeDB.Driver.Api.IEntity.
bool
concept.IsEntity();
IsEntityType
bool IsEntityType()
Checks if the concept is an IEntityType
.
Implemented in TypeDB.Driver.Api.IEntityType.
bool
concept.IsEntityType();
IsRelation
bool IsRelation()
Checks if the concept is a IRelation
.
Implemented in TypeDB.Driver.Api.IRelation.
bool
concept.IsRelation();
IsRelationType
bool IsRelationType()
Checks if the concept is a IRelationType
.
Implemented in TypeDB.Driver.Api.IRelationType.
bool
concept.IsRelationType();
IsRoleType
bool IsRoleType()
Checks if the concept is a IRoleType
.
Implemented in TypeDB.Driver.Api.IRoleType.
bool
concept.IsRoleType();
IsThing
bool IsThing()
Checks if the concept is a IThing
.
Implemented in TypeDB.Driver.Api.IThing.
bool
concept.IsThing();
IsThingType
bool IsThingType()
Checks if the concept is a IThingType
.
Implemented in TypeDB.Driver.Api.IThingType.
bool
concept.IsThingType();
Schema
IType
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IConcept
AsType
IType IConcept. AsType()
Casts the concept to IType
.
Implements TypeDB.Driver.Api.IConcept.
IType IConcept.
concept.AsType();
Delete
VoidPromise Delete(ITypeDBTransaction transaction)
Deletes this type from the database.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
VoidPromise
type.Delete(transaction).Resolve();
GetSubtypes
IEnumerable< IType > GetSubtypes(ITypeDBTransaction transaction)
Retrieves all direct and indirect subtypes of the type. Equivalent to GetSubtypes(transaction, Transitive)
See also
IType::GetSubtypes(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IType >
GetSubtypes
IEnumerable< IType > GetSubtypes(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves all direct and indirect (or direct only) subtypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IType >
type.GetSubtypes(transaction);
type.GetSubtypes(transaction, Explicit);
GetSupertype
Promise< IType > GetSupertype(ITypeDBTransaction transaction)
Retrieves the most immediate supertype of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< IType >
type.GetSupertype(transaction).Resolve();
GetSupertypes
IEnumerable< IType > GetSupertypes(ITypeDBTransaction transaction)
Retrieves all supertypes of the type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
IEnumerable< IType >
type.GetSupertypes(transaction);
IsAbstract
bool IsAbstract()
Checks if the type is prevented from having data instances (i.e., abstract
).
bool
type.IsAbstract();
IsDeleted
Promise< bool > IsDeleted(ITypeDBTransaction transaction)
Check if the concept has been deleted.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< bool >
type.IsDeleted(transaction).Resolve();
IsType
bool IConcept. IsType()
Checks if the concept is a IType
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
concept.IsType();
Label
Label TypeDB.Driver.Api.IType.Label
The unique label of the type.
Label
type.Label;
SetLabel
VoidPromise SetLabel(ITypeDBTransaction transaction, string label)
Renames the label of the type. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The new |
|
VoidPromise
type.SetLabel(transaction, newLabel).Resolve();
IThingType
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IType
-
TypeDB.Driver.Api.IConcept
AsThingType
IThingType IConcept. AsThingType()
Casts the concept to IThingType
.
Implements TypeDB.Driver.Api.IConcept.
IThingType IConcept.
concept.AsThingType();
GetInstances
IEnumerable< IThing > GetInstances(ITypeDBTransaction transaction)
Retrieves all IThing
objects that are instances of this IThingType
or its subtypes. Equivalent to GetInstances(transaction, Transitive)
See also
IThingType::GetInstances(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IThing >
GetInstances
IEnumerable< IThing > GetInstances(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves IThing
objects that are instances of this exact IThingType
, OR this IThingType
and any of its subtypes
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IThing >
thingType.GetInstances(transaction);
thingType.GetInstances(transaction, Explicit);
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, IValue.ValueType valueType)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, ICollection< Annotation > annotations)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, IValue.ValueType? valueType, ICollection< Annotation > annotations)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType?, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, IValue.ValueType? valueType, IConcept.Transitivity transitivity)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType?, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, ICollection< Annotation > annotations, IConcept.Transitivity transitivity)
Retrieves IAttributeType
that the instances of this IThingType
are allowed to own directly or via inheritance.
See also
IThingType::GetOwns(ITypeDBTransaction, IValue.ValueType, ICollection<Annotation>, IConcept.Transitivity)
IEnumerable< IAttributeType >
GetOwns
IEnumerable< IAttributeType > GetOwns(ITypeDBTransaction transaction, IValue.ValueType? valueType, ICollection< Annotation > annotations, IConcept.Transitivity transitivity)
Retrieves IAttributeType
that the instances of this IThingType
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. |
|
IEnumerable< IAttributeType >
thingType.GetOwns(transaction);
thingType.GetOwns(transaction, valueType, Explicit, new []{NewKey()}));
GetOwnsOverridden
Promise< IAttributeType > GetOwnsOverridden(ITypeDBTransaction transaction, IAttributeType attributeType)
Retrieves an IAttributeType
, ownership of which is overridden for this IThingType
by a given IAttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise< IAttributeType >
thingType.GetOwnsOverridden(transaction, attributeType).Resolve();
GetPlays
IEnumerable< IRoleType > GetPlays(ITypeDBTransaction transaction)
Retrieves all direct and inherited roles that are allowed to be played by the instances of this IThingType
.
See also
IThingType::GetPlays(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IRoleType >
GetPlays
IEnumerable< IRoleType > GetPlays(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves all direct and inherited (or direct only) roles that are allowed to be played by the instances of this IThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
transitivity: |
|
IEnumerable< IRoleType >
thingType.GetPlays(transaction).Resolve();
thingType.GetPlays(transaction, Explicit).Resolve();
GetPlaysOverridden
Promise< IRoleType > GetPlaysOverridden(ITypeDBTransaction transaction, IRoleType roleType)
Retrieves a IRoleType
that is overridden by the given role_type
for this IThingType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
Promise< IRoleType >
thingType.GetPlaysOverridden(transaction, roleType).Resolve();
GetSyntax
Promise< string > GetSyntax(ITypeDBTransaction transaction)
Produces a pattern for creating this IThingType
in a define
query.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< string >
thingType.GetSyntax(transaction).Resolve();
IsThingType
bool IConcept. IsThingType()
Checks if the concept is a IThingType
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
concept.IsThingType();
SetAbstract
VoidPromise SetAbstract(ITypeDBTransaction transaction)
Set a IThingType
to be abstract, meaning it cannot have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
VoidPromise
thingType.SetAbstract(transaction).Resolve();
SetOwns
VoidPromise SetOwns(ITypeDBTransaction transaction, IAttributeType attributeType, IAttributeType? overriddenType, ICollection< Annotation > annotations)
Allows the instances of this IThingType
to own the given IAttributeType
. Optionally, overriding a previously declared ownership. Optionally, adds annotations to the ownership.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
|
The |
|
|
Adds annotations to the ownership. |
|
VoidPromise
thingType.SetOwns(transaction, attributeType).Resolve();
thingType.SetOwns(transaction, attributeType, overriddenType, new []{NewKey()}).Resolve();
SetOwns
VoidPromise SetOwns(ITypeDBTransaction transaction, IAttributeType attributeType, IAttributeType overriddenType)
Allows the instances of this IThingType
to own the given IAttributeType
,
See also
IThingType::SetOwns(ITypeDBTransaction, IAttributeType, IAttributeType, Set)
VoidPromise
SetOwns
VoidPromise SetOwns(ITypeDBTransaction transaction, IAttributeType attributeType, ICollection< Annotation > annotations)
Allows the instances of this IThingType
to own the given IAttributeType
.
See also
IThingType::SetOwns(ITypeDBTransaction, IAttributeType, IAttributeType, Set)
VoidPromise
SetOwns
VoidPromise SetOwns(ITypeDBTransaction transaction, IAttributeType attributeType)
Allows the instances of this IThingType
to own the given IAttributeType
.
See also
IThingType::SetOwns(ITypeDBTransaction, IAttributeType, IAttributeType, Set)
VoidPromise
SetPlays
VoidPromise SetPlays(ITypeDBTransaction transaction, IRoleType roleType)
Allows the instances of this IThingType
to play the given role.
See also
IThingType::SetPlays(ITypeDBTransaction, IRoleType, IRoleType)
VoidPromise
SetPlays
VoidPromise SetPlays(ITypeDBTransaction transaction, IRoleType roleType, IRoleType overriddenType)
Allows the instances of this IThingType
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 |
|
VoidPromise
thingType.SetPlays(transaction, roleType).Resolve();
thingType.SetPlays(transaction, roleType, overriddenType).Resolve();
UnsetAbstract
VoidPromise UnsetAbstract(ITypeDBTransaction transaction)
Set a IThingType
to be non-abstract, meaning it can have instances.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
VoidPromise
thingType.UnsetAbstract(transaction).Resolve();
UnsetOwns
VoidPromise UnsetOwns(ITypeDBTransaction transaction, IAttributeType attributeType)
Disallows the instances of this IThingType
from owning the given IAttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
VoidPromise
thingType.UnsetOwns(transaction, attributeType).Resolve();
UnsetPlays
VoidPromise UnsetPlays(ITypeDBTransaction transaction, IRoleType roleType)
Disallows the instances of this IThingType
from playing the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not be played by the instances of this type. |
|
VoidPromise
thingType.UnsetPlays(transaction, roleType).Resolve();
IEntityType
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IThingType
-
TypeDB.Driver.Api.IType
-
TypeDB.Driver.Api.IConcept
Entity types represent the classification of independent objects in the data model of the business domain.
AsEntityType
IEntityType IConcept. AsEntityType()
Casts the concept to IEntityType
.
Implements TypeDB.Driver.Api.IConcept.
IEntityType IConcept.
concept.AsEntityType();
Create
Promise< IEntity > Create(ITypeDBTransaction transaction)
Creates and returns a new instance of this IEntityType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< IEntity >
entityType.Create(transaction).Resolve();
IsEntityType
bool IConcept. IsEntityType()
Checks if the concept is an IEntityType
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
concept.IsEntityType();
SetSupertype
VoidPromise SetSupertype(ITypeDBTransaction transaction, IEntityType superEntityType)
Sets the supplied IEntityType
as the supertype of the current IEntityType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
VoidPromise
entityType.SetSupertype(transaction, entityType).Resolve();
IRelationType
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IThingType
-
TypeDB.Driver.Api.IType
-
TypeDB.Driver.Api.IConcept
Relation types (or subtypes of the relation root type) represent relationships between types. Relation types have roles. Other types can play roles in relations if it’s mentioned in their definition. A relation type must specify at least one role.
AsRelationType
IRelationType IConcept. AsRelationType()
Casts the concept to IRelationType
.
Implements TypeDB.Driver.Api.IConcept.
IRelationType IConcept.
concept.AsRelationType();
Create
Promise< IRelation > Create(ITypeDBTransaction transaction)
Creates and returns an instance of this IRelationType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< IRelation >
relationType.Create(transaction).Resolve();
GetRelates
IEnumerable< IRoleType > GetRelates(ITypeDBTransaction transaction)
Retrieves roles that this IRelationType
relates to directly or via inheritance.
See also
IRelationType::getRelates(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IRoleType >
GetRelates
IEnumerable< IRoleType > GetRelates(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves roles that this IRelationType
relates to directly or via inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IRoleType >
relationType.GetRelates(transaction, transitivity);
GetRelates
Promise< IRoleType > GetRelates(ITypeDBTransaction transaction, string roleLabel)
Retrieves roles that this IRelationType
relates to directly or via inheritance. If role_label
is given, returns a corresponding IRoleType
or null
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Label of the role we wish to retrieve |
|
Promise< IRoleType >
relationType.GetRelates(transaction, roleLabel).Resolve();
GetRelatesOverridden
Promise< IRoleType > GetRelatesOverridden(ITypeDBTransaction transaction, IRoleType roleType)
Retrieves a IRoleType
that is overridden by the role with the role_label
.
See also
IRelationType::GetRelatesOverridden(ITypeDBTransaction, string)
Promise< IRoleType >
GetRelatesOverridden
Promise< IRoleType > GetRelatesOverridden(ITypeDBTransaction transaction, string roleLabel)
Retrieves a IRoleType
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< IRoleType >
relationType.GetRelatesOverridden(transaction, roleLabel).Resolve();
IsRelationType
bool IConcept. IsRelationType()
Checks if the concept is a IRelationType
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
concept.IsRelationType();
SetRelates
VoidPromise SetRelates(ITypeDBTransaction transaction, string roleLabel)
Sets the new role that this IRelationType
relates to.
See also
IRelationType::SetRelates(ITypeDBTransaction, string, string)
VoidPromise
SetRelates
VoidPromise SetRelates(ITypeDBTransaction transaction, string roleLabel, IRoleType overriddenType)
Sets the new role that this IRelationType
relates to.
See also
IRelationType::SetRelates(ITypeDBTransaction, string, string)
VoidPromise
SetRelates
VoidPromise SetRelates(ITypeDBTransaction transaction, string roleLabel, string? overriddenLabel)
Sets the new role that this IRelationType
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 |
|
VoidPromise
relationType.SetRelates(transaction, roleLabel).Resolve();
relationType.SetRelates(transaction, roleLabel, overriddenLabel).Resolve();
SetSupertype
VoidPromise SetSupertype(ITypeDBTransaction transaction, IRelationType superRelationType)
Sets the supplied IRelationType
as the supertype of the current IRelationType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
VoidPromise
relationType.SetSupertype(transaction, superRelationType).Resolve();
UnsetRelates
VoidPromise UnsetRelates(ITypeDBTransaction transaction, IRoleType roleType)
Disallows this IRelationType
from relating to the given role.
See also
IRelationType::UnsetRelates(ITypeDBTransaction, string)
VoidPromise
UnsetRelates
VoidPromise UnsetRelates(ITypeDBTransaction transaction, string roleLabel)
Disallows this IRelationType
from relating to the given role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to not relate to the relation type. |
|
VoidPromise
relationType.UnsetRelates(transaction, roleLabel).Resolve();
IRoleType
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IType
-
TypeDB.Driver.Api.IConcept
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.
AsRoleType
IRoleType IConcept. AsRoleType()
Casts the concept to IRoleType
.
Implements TypeDB.Driver.Api.IConcept.
IRoleType IConcept.
concept.AsRoleType();
GetPlayerInstances
IEnumerable< IThing > GetPlayerInstances(ITypeDBTransaction transaction)
Retrieves the Thing
instances that play this role.
See also
IRoleType::GetPlayerInstances(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IThing >
GetPlayerInstances
IEnumerable< IThing > GetPlayerInstances(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves the Thing
instances that play this role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IThing >
roleType.GetPlayerInstances(transaction, transitivity);
GetPlayerTypes
IEnumerable< IThingType > GetPlayerTypes(ITypeDBTransaction transaction)
Retrieves the ThingType
s whose instances play this role. Equivalent to GetPlayerTypes(transaction, Transitive)
.
See also
IRoleType::GetPlayerTypes(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IThingType >
GetPlayerTypes
IEnumerable< IThingType > GetPlayerTypes(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves the ThingType
s whose instances play this role.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IThingType >
roleType.GetPlayerTypes(transaction, transitivity)
GetRelationInstances
IEnumerable< IRelation > GetRelationInstances(ITypeDBTransaction transaction)
Retrieves the Relation
instances that this role is related to. Equivalent to GetRelationInstances(transaction, Transitive)
See also
IRoleType::GetRelationInstances(ITypeDBTransaction, IConcept.Transitivity)
IEnumerable< IRelation >
GetRelationInstances
IEnumerable< IRelation > GetRelationInstances(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieves the Relation
instances that this role is related to.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IRelation >
roleType.GetRelationInstances(transaction, transitivity)
GetRelationTypes
IEnumerable< IRelationType > GetRelationTypes(ITypeDBTransaction transaction)
Retrieves RelationType
s that this role is related to (directly or indirectly).
Name | Description | Type |
---|---|---|
|
The current transaction |
|
IEnumerable< IRelationType >
roleType.GetRelationTypes(transaction);
IAttributeType
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IThingType
-
TypeDB.Driver.Api.IType
-
TypeDB.Driver.Api.IConcept
Attribute types represent properties that other types can own.
IAttribute 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.
AsAttributeType
IAttributeType IConcept. AsAttributeType()
Casts the concept to IAttributeType
.
Implements TypeDB.Driver.Api.IConcept.
IAttributeType IConcept.
concept.AsAttributeType();
Get
Promise< IAttribute > Get(ITypeDBTransaction transaction, IValue value)
Retrieves an IAttribute
of this IAttributeType
with the given value if such IAttribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise< IAttribute >
attributeType.Get(transaction, value).Resolve();
Get
Promise< IAttribute > Get(ITypeDBTransaction transaction, string value)
Retrieves an IAttribute
of this IAttributeType
with the given value if such IAttribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise< IAttribute >
attributeType.Get(transaction, value).Resolve();
Get
Promise< IAttribute > Get(ITypeDBTransaction transaction, long value)
Retrieves an IAttribute
of this IAttributeType
with the given value if such IAttribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise< IAttribute >
attributeType.Get(transaction, value).Resolve();
Get
Promise< IAttribute > Get(ITypeDBTransaction transaction, double value)
Retrieves an IAttribute
of this IAttributeType
with the given value if such IAttribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise< IAttribute >
attributeType.Get(transaction, value).Resolve();
Get
Promise< IAttribute > Get(ITypeDBTransaction transaction, bool value)
Retrieves an IAttribute
of this IAttributeType
with the given value if such IAttribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise< IAttribute >
attributeType.Get(transaction, value).Resolve();
Get
Promise< IAttribute > Get(ITypeDBTransaction transaction, System.DateTime value)
Retrieves an IAttribute
of this IAttributeType
with the given value if such IAttribute
exists. Otherwise, returns None
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
Promise< IAttribute >
attributeType.Get(transaction, value).Resolve();
GetOwners
IEnumerable< IThingType > GetOwners(ITypeDBTransaction transaction)
Retrieve all Things
that own an attribute of this IAttributeType
directly or through inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
IEnumerable< IThingType >
attributeType.GetOwners(transaction);
GetOwners
IEnumerable< IThingType > GetOwners(ITypeDBTransaction transaction, ICollection< Annotation > annotations)
Retrieve all Things
that own an attribute of this IAttributeType
, filtered by Annotation
s, directly or through inheritance.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Only retrieve |
|
IEnumerable< IThingType >
attributeType.GetOwners(transaction, annotations);
GetOwners
IEnumerable< IThingType > GetOwners(ITypeDBTransaction transaction, IConcept.Transitivity transitivity)
Retrieve all Things
that own an attribute of this IAttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IThingType >
attributeType.GetOwners(transaction, transitivity);
GetOwners
IEnumerable< IThingType > GetOwners(ITypeDBTransaction transaction, ICollection< Annotation > annotations, IConcept.Transitivity transitivity)
Retrieve all Things
that own an attribute of this IAttributeType
, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Only retrieve |
|
|
|
|
IEnumerable< IThingType >
attributeType.GetOwners(transaction, annotations, transitivity);
GetRegex
Promise< string > GetRegex(ITypeDBTransaction transaction)
Retrieves the regular expression that is defined for this IAttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< string >
attributeType.GetRegex(transaction).Resolve();
GetSubtypes
IEnumerable< IType > GetSubtypes(ITypeDBTransaction transaction, IValue.ValueType valueType)
Retrieves all direct and indirect subtypes of this IAttributeType
with given IValue.ValueType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
IEnumerable< IType >
attributeType.GetSubtypes(transaction, valueType);
GetSubtypes
IEnumerable< IType > GetSubtypes(ITypeDBTransaction transaction, IValue.ValueType valueType, IConcept.Transitivity transitivity)
Retrieves all direct and indirect (or direct only) subtypes of this IAttributeType
with given IValue.ValueType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
|
|
|
|
|
IEnumerable< IType >
attributeType.GetSubtypes(transaction, valueType, transitivity);
IsAttributeType
bool IConcept. IsAttributeType()
Checks if the concept is an IAttributeType
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
concept.IsAttributeType();
IsBool
bool IsBool()
Returns True
if the value for attributes of this type is of type bool
. Otherwise, returns False
.
bool
attributeType.IsBool();
IsDateTime
bool IsDateTime()
Returns True
if the value for attributes of this type is of type datetime
. Otherwise, returns False
.
bool
attributeType.IsDateTime();
IsDouble
bool IsDouble()
Returns True
if the value for attributes of this type is of type double
. Otherwise, returns False
.
bool
attributeType.IsDouble();
IsLong
bool IsLong()
Returns True
if the value for attributes of this type is of type long
. Otherwise, returns False
.
bool
attributeType.IsLong();
IsString
bool IsString()
Returns True
if the value for attributes of this type is of type string
. Otherwise, returns False
.
bool
attributeType.IsString();
Put
Promise< IAttribute > Put(ITypeDBTransaction transaction, IValue value)
Adds and returns an IAttribute
of this IAttributeType
with the given value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise< IAttribute >
attributeType.Put(transaction, value).Resolve();
Put
Promise< IAttribute > Put(ITypeDBTransaction transaction, string value)
Adds and returns an IAttribute
of this IAttributeType
with the given string
value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise< IAttribute >
attributeType.Put(transaction, value).Resolve();
Put
Promise< IAttribute > Put(ITypeDBTransaction transaction, long value)
Adds and returns an IAttribute
of this IAttributeType
with the given long
value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise< IAttribute >
attributeType.Put(transaction, value).Resolve();
Put
Promise< IAttribute > Put(ITypeDBTransaction transaction, double value)
Adds and returns an IAttribute
of this IAttributeType
with the given double
value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise< IAttribute >
attributeType.Put(transaction, value).Resolve();
Put
Promise< IAttribute > Put(ITypeDBTransaction transaction, bool value)
Adds and returns an IAttribute
of this IAttributeType
with the given bool
value.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise< IAttribute >
attributeType.Put(transaction, value).Resolve();
Put
Promise< IAttribute > Put(ITypeDBTransaction transaction, System.DateTime value)
Adds and returns an IAttribute
of this IAttributeType
with the given DateTime
value. The input DateTime value is treated as timezone naive, with DateTimeKind being ignored.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
New |
|
Promise< IAttribute >
attributeType.Put(transaction, value).Resolve();
SetRegex
VoidPromise SetRegex(ITypeDBTransaction transaction, string regex)
Sets a regular expression as a constraint for this IAttributeType
. Values
of all IAttribute
s of this type (inserted earlier or later) should match this regex.
Can only be applied for IAttributeType
s with a string
value type.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Regular expression |
|
VoidPromise
attributeType.SetRegex(transaction, regex).Resolve();
SetSupertype
VoidPromise SetSupertype(ITypeDBTransaction transaction, IAttributeType attributeType)
Sets the supplied IAttributeType
as the supertype of the current IAttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
VoidPromise
attributeType.SetSupertype(transaction, superType).Resolve();
UnsetRegex
VoidPromise UnsetRegex(ITypeDBTransaction transaction)
Removes the regular expression that is defined for this IAttributeType
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
VoidPromise
attributeType.UnsetRegex(transaction).Resolve();
Annotation
Package: TypeDB.Driver.Api.IThingType
Annotation
Equals
override bool Equals(object? obj)
Checks if this Annotation
is equal to another object.
Name | Description | Type |
---|---|---|
|
Object to compare with |
|
override bool
annotation.Equals(obj);
IsKey
bool IsKey()
Checks if this Annotation
is a @key
annotation.
bool
annotation.IsKey();
IsUnique
bool IsUnique()
Checks if this Annotation
is a @unique
annotation.
bool
annotation.IsUnique();
NewKey
static Annotation NewKey()
Produces a @key
annotation.
Annotation
using static TypeDB.Driver.Api.IThingType.Annotation;
NewKey();
Label
Package: TypeDB.Driver.Common
A Label
holds the uniquely identifying name of a type.
It consists of an optional scope
, and a name
, represented scope:name
. The scope is used only used to distinguish between role-types of the same name declared in different relation types.
Name | Type | Description |
---|---|---|
|
|
Returns the name of this Label. Examples
|
|
|
Returns the scope of this Label. Examples
|
Equals
override bool Equals(object? obj)
Checks if this Label is equal to another object.
Name | Description | Type |
---|---|---|
|
Object to compare with |
|
override bool
label.Equals(obj);
Label
Label(string? scope, string name)
Creates a Label from a specified scope and name.
Name | Description | Type |
---|---|---|
|
Label scope |
|
|
Label name |
|
Label
new Label("relation", "role");
Label
Label(string name)
Creates a Label from a specified name.
Name | Description | Type |
---|---|---|
|
Label name |
|
Label
new Label("entity");
Data
IThing
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IConcept
AsThing
IThing IConcept. AsThing()
Casts the concept to IThing
.
Implements TypeDB.Driver.Api.IConcept.
IThing IConcept.
thing.AsThing();
Delete
VoidPromise Delete(ITypeDBTransaction transaction)
Deletes this IThing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
VoidPromise
thing.Delete(transaction).Resolve();
GetHas
IEnumerable< IAttribute > GetHas(ITypeDBTransaction transaction, params IAttributeType[] attributeTypes)
Retrieves the IAttribute
s that this IThing
owns, optionally filtered by IAttributeType
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
IEnumerable< IAttribute >
thing.GetHas(transaction);
thing.GetHas(transaction, attributeType);
GetHas
IEnumerable< IAttribute > GetHas(ITypeDBTransaction transaction, ICollection< Annotation > annotations)
Retrieves the IAttribute
s that this IThing
owns, filtered by Annotation
s.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Only retrieve attributes with all given |
|
IEnumerable< IAttribute >
thing.GetHas(transaction);
thing.GetHas(transaction, new []{NewKey()});
GetPlaying
IEnumerable< IRoleType > GetPlaying(ITypeDBTransaction transaction)
Retrieves the roles that this IThing
is currently playing.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
IEnumerable< IRoleType >
thing.GetPlaying(transaction);
GetRelations
IEnumerable< IRelation > GetRelations(ITypeDBTransaction transaction, params IRoleType[] roleTypes)
Retrieves all the Relations
which this IThing
plays a role in, optionally filtered by one or more given roles.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The array of roles to filter the relations by. |
|
IEnumerable< IRelation >
thing.GetRelations(transaction, roleTypes);
IID
string TypeDB.Driver.Api.IThing.IID
The unique id of the IThing
.
string
thing.IID;
IsDeleted
Promise< bool > IsDeleted(ITypeDBTransaction transaction)
Checks if this IThing
is deleted.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Promise< bool >
thing.IsDeleted(transaction).Resolve();
IsInferred
bool IsInferred()
Checks if this IThing
is inferred by a [Reasoning Rule].
bool
thing.IsInferred();
IsThing
bool IConcept. IsThing()
Checks if the concept is a IThing
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
thing.IsThing();
SetHas
VoidPromise SetHas(ITypeDBTransaction transaction, IAttribute attribute)
Assigns an IAttribute
to be owned by this IThing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
VoidPromise
thing.SetHas(transaction, attribute).Resolve();
Type
IThingType TypeDB.Driver.Api.IThing.Type
The type which this IThing
belongs to.
IThingType
thing.Type;
UnsetHas
VoidPromise UnsetHas(ITypeDBTransaction transaction, IAttribute attribute)
Unassigns an IAttribute
from this IThing
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The |
|
VoidPromise
thing.UnsetHas(transaction, attribute).Resolve();
IEntity
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IThing
-
TypeDB.Driver.Api.IConcept
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.
IRelation
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IThing
-
TypeDB.Driver.Api.IConcept
Relation is an instance of a relation type and can be uniquely addressed by a combination of its type, owned attributes and role players.
AddPlayer
VoidPromise AddPlayer(ITypeDBTransaction transaction, IRoleType roleType, IThing player)
Adds a new role player to play the given role in this IRelation
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
The role to be played by the |
|
|
The thing to play the role |
|
VoidPromise
relation.AddPlayer(transaction, roleType, player).Resolve();
AsRelation
IRelation IConcept. AsRelation()
Casts the concept to IRelation
.
Implements TypeDB.Driver.Api.IConcept.
IRelation IConcept.
relation.AsRelation();
GetPlayers
Dictionary< IRoleType, ICollection< IThing > > GetPlayers(ITypeDBTransaction transaction)
Retrieves a mapping of all instances involved in the IRelation
and the role each play.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
Dictionary< IRoleType, ICollection< IThing > >
relation.GetPlayers(transaction)
GetPlayersByRoleType
IEnumerable< IThing > GetPlayersByRoleType(ITypeDBTransaction transaction, params IRoleType[] roleTypes)
Retrieves all role players of this IRelation
, optionally filtered by given role types.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
0 or more role types |
|
IEnumerable< IThing >
relation.GetPlayersByRoleType(transaction, roleTypes);
GetRelating
IEnumerable< IRoleType > GetRelating(ITypeDBTransaction transaction)
Retrieves all role types currently played in this IRelation
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
IEnumerable< IRoleType >
relation.GetRelating(transaction);
IsRelation
bool IConcept. IsRelation()
Checks if the concept is a IRelation
.
Implements TypeDB.Driver.Api.IConcept.
bool IConcept.
relation.IsRelation();
RemovePlayer
VoidPromise RemovePlayer(ITypeDBTransaction transaction, IRoleType roleType, IThing player)
Removes the association of the given instance that plays the given role in this IRelation
.
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 |
|
VoidPromise
relation.RemovePlayer(transaction, roleType, player).Resolve();
IAttribute
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IThing
-
TypeDB.Driver.Api.IConcept
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.
AsAttribute
IAttribute IConcept. AsAttribute()
Casts the concept to IAttribute
.
Implements TypeDB.Driver.Api.IConcept.
IAttribute IConcept.
attribute.AsAttribute();
GetOwners
IEnumerable< IThing > GetOwners(ITypeDBTransaction transaction)
Retrieves the instances that own this IAttribute
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
IEnumerable< IThing >
attribute.GetOwners(transaction);
GetOwners
IEnumerable< IThing > GetOwners(ITypeDBTransaction transaction, IThingType ownerType)
Retrieves the instances that own this IAttribute
.
Name | Description | Type |
---|---|---|
|
The current transaction |
|
|
Filter results for only owners of the given type |
|
IEnumerable< IThing >
attribute.GetOwners(transaction, ownerType);
IValue
Package: TypeDB.Driver.Api
Supertypes:
-
TypeDB.Driver.Api.IConcept
AsBool
bool AsBool()
Returns a bool
value of this value concept. If the value has another type, raises an exception.
bool
value.AsBool();
AsDateTime
System.DateTime AsDateTime()
Returns a datetime
value of this value concept. This value contains raw date and time without considering your time zone (Kind = Unspecified). If the value has another type, raises an exception.
System.DateTime
value.AsDateTime();
AsDouble
double AsDouble()
Returns a double
value of this value concept. If the value has another type, raises an exception.
double
value.AsDouble();
AsLong
long AsLong()
Returns a long
value of this value concept. If the value has another type, raises an exception.
long
value.AsLong();
AsString
string AsString()
Returns a string
value of this value concept. If the value has another type, raises an exception.
string
value.AsString();
AsUntyped
object AsUntyped()
Returns an untyped object
value of this value concept. This is useful for value equality or printing without having to switch on the actual contained value.
object
value.AsUntyped();
AsValue
IValue IConcept. AsValue()
Casts the concept to IValue
.
Implements TypeDB.Driver.Api.IConcept.
IValue IConcept.
concept.AsValue();
IsBool
bool IsBool()
Returns True
if the value which this value concept holds is of type bool
. Otherwise, returns false
.
bool
value.IsBool();
IsDateTime
bool IsDateTime()
Returns True
if the value which this value concept holds is of type datetime
. Otherwise, returns false
.
bool
value.IsDateTime();
IsDouble
bool IsDouble()
Returns True
if the value which this value concept holds is of type double
. Otherwise, returns false
.
bool
value.IsDouble();
IsLong
bool IsLong()
Returns True
if the value which this value concept holds is of type long
. Otherwise, returns false
.
bool
value.IsLong();
IsString
bool IsString()
Returns True
if the value which this value concept holds is of type string
. Otherwise, returns false
.
bool
value.IsString();
ValueType
Package: TypeDB.Driver.Api.IValue
Used to specify the type of the value.
thingType.GetOwns(transaction, IValue.ValueType.String);
Name |
---|
|
|
|
|
|
|
ValueTypeExtensions
Package: TypeDB.Driver.Api
Extension class with additional methods describing characteristics of ValueType
enum values.
GetValueClass
static System.Type GetValueClass(this IValue::ValueType valueType)
Returns a System.Type
equivalent of this value concept for this programming language.
System.Type
valueType.GetValueClass();
Logic
ILogicManager
Package: TypeDB.Driver.Api
Provides methods for manipulating rules in the database.
GetRule
Promise< IRule > GetRule(string label)
Retrieves the Rule that has the given label.
Name | Description | Type |
---|---|---|
|
The label of the Rule to create or retrieve |
|
Promise< IRule >
transaction.Logic.GetRule(label).Resolve()
GetRules
IEnumerable< IRule > GetRules()
Retrieves all rules.
IEnumerable< IRule >
transaction.Logic.GetRules();
PutRule
Promise< IRule > PutRule(string label, string when, string then)
Creates a new Rule if none exists with the given label, or replaces the existing one.
Name | Description | Type |
---|---|---|
|
The label of the IRule to create or replace |
|
|
The when body of the rule to create |
|
|
The then body of the rule to create |
|
Promise< IRule >
transaction.Logic.PutRule(label, when, then).Resolve()
IRule
Package: TypeDB.Driver.Api
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.
Delete
VoidPromise Delete(ITypeDBTransaction transaction)
Deletes this rule.
Name | Description | Type |
---|---|---|
|
The current |
|
VoidPromise
rule.Delete(transaction).Resolve();
IsDeleted
Promise< bool > IsDeleted(ITypeDBTransaction transaction)
Check if this rule has been deleted.
Name | Description | Type |
---|---|---|
|
The current |
|
Promise< bool >
rule.IsDeleted(transaction).Resolve();
SetLabel
VoidPromise SetLabel(ITypeDBTransaction transaction, string label)
Renames the label of the rule. The new label must remain unique.
Name | Description | Type |
---|---|---|
|
The current |
|
|
The new label to be given to the rule |
|
VoidPromise
rule.SetLabel(transaction, newLabel).Resolve();