C# gRPC driver

Connection

TypeDB

class

Package: TypeDB.Driver

Entry point for creating TypeDB driver connections.

method Driver

static IDriver Driver(string address, Credentials credentials, DriverOptions driverOptions)

Open a TypeDB Driver to a TypeDB server available at the provided address.

Input parameters
Name Description Type

address

The address (host:port) on which the TypeDB Server is running.

string

credentials

The Credentials to connect with.

Credentials

driverOptions

The DriverOptions to connect with.

DriverOptions

Returns

IDriver

Code examples
using var driver = TypeDB.Driver( "localhost:1729", new Credentials("admin", "password"), new DriverOptions(false, null)); TypeDB.Driver.Api.Credentials User credentials for connecting to TypeDB Server. Definition Credentials.cs:33 TypeDB.Driver.Api.DriverOptions User connection settings (TLS encryption, etc.) for connecting to TypeDB Server. Definition DriverOptions.cs:37 TypeDB.Driver Definition TypeDB.cs:24 TypeDB Definition TypeDB.cs:24

IDriver

class

Package: TypeDB.Driver.Api

A connection to a TypeDB server which serves as the starting point for all interaction.

method Close

void Close()

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

Returns

void

Code examples
driver.Close();

method Databases

IDatabaseManager TypeDB.Driver.Api.IDriver.Databases

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

Returns

IDatabaseManager

Code examples
driver.Databases

method IsOpen

bool IsOpen()

Checks whether this connection is presently open.

Returns

bool

Code examples
driver.IsOpen();

method Transaction

ITransaction Transaction(string database, TransactionType type)

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

Input parameters
Name Description Type

database

The name of the database to open a transaction for.

string

type

The type of transaction to be created (Read, Write, or Schema).

TransactionType

Returns

ITransaction

Code examples
driver.Transaction(database, TransactionType.Read); TypeDB.Driver.Api.TransactionType TransactionType Used to specify the type of transaction. Definition ITransaction.cs:99

method Transaction

ITransaction Transaction(string database, TransactionType type, TransactionOptions options)

Opens a transaction to perform read or write queries on the database with custom options.

Input parameters
Name Description Type

database

The name of the database to open a transaction for.

string

type

The type of transaction to be created (Read, Write, or Schema).

TransactionType

options

Transaction options to configure the opened transaction.

TransactionOptions

Returns

ITransaction

Code examples
driver.Transaction(database, TransactionType.Read, options);

method Users

IUserManager TypeDB.Driver.Api.IDriver.Users

The IUserManager instance for this connection, providing access to user management methods.

Returns

IUserManager

Code examples
driver.Users

Credentials

class

Package: TypeDB.Driver.Api

User credentials for connecting to TypeDB Server.

Credentials credentials = new Credentials("admin", "password");
TypeDB.Driver.Api.Credentials
User credentials for connecting to TypeDB Server.
Definition Credentials.cs:33

method Credentials

Credentials(string username, string password)

Creates a new Credentials for connecting to TypeDB Server.

Input parameters
Name Description Type

username

The name of the user to connect as.

string

password

The password for the user.

string

Returns

Credentials

DriverOptions

class

Package: TypeDB.Driver.Api

User connection settings (TLS encryption, etc.) for connecting to TypeDB Server.

// No TLS
DriverOptions options = new DriverOptions(false, null);
// TLS with custom CA certificate
DriverOptions options = new DriverOptions(true, "/path/to/ca-certificate.pem");
TypeDB.Driver.Api.DriverOptions
User connection settings (TLS encryption, etc.) for connecting to TypeDB Server.
Definition DriverOptions.cs:37

method DriverOptions

DriverOptions(bool isTlsEnabled, string? tlsRootCAPath = null)

Creates a new DriverOptions for connecting to TypeDB Server.

Input parameters
Name Description Type

isTlsEnabled

Specify whether the connection to TypeDB Server must be done over TLS.

bool

tlsRootCAPath

Path to the CA certificate to use for authenticating server certificates. Can be null if using system CA or TLS is disabled.

Returns

DriverOptions

IDatabaseManager

class

Package: TypeDB.Driver.Api

Provides access to all database management methods.

method Contains

bool Contains(string name)

Checks if a database with the given name exists.

Input parameters
Name Description Type

name

The database name to be checked

string

Returns

bool

Code examples
driver.Databases.Contains(name);

method Create

void Create(string name)

Create a database with the given name.

Input parameters
Name Description Type

name

The name of the database to be created

string

Returns

void

Code examples
driver.Databases.Create(name);

method Get

IDatabase Get(string name)

Retrieve the database with the given name.

Input parameters
Name Description Type

name

The name of the database to retrieve

string

Returns

IDatabase

Code examples
driver.Databases.Get(name);

method GetAll

IList< IDatabase > GetAll()

Retrieves all databases present on the TypeDB server.

Returns

IList< IDatabase >

Code examples
driver.Databases.GetAll();

method ImportFromFile

void ImportFromFile(string name, string schema, string dataFile)

Creates a database with the given name based on previously exported data. This is a blocking operation and may take a significant amount of time depending on the database size.

Input parameters
Name Description Type

name

The name of the database to be created.

string

schema

The schema definition query string for the database.

string

dataFile

The exported database file path to import the data from.

string

Returns

void

Code examples
driver.Databases.ImportFromFile("mydb", schemaString, "/path/to/data.typedb");

IDatabase

class

Package: TypeDB.Driver.Api

A TypeDB database.

method Delete

void Delete()

Deletes this database.

Returns

void

Code examples
database.Delete();

method ExportToFile

void ExportToFile(string schemaFile, string dataFile)

Exports this database to a schema definition file and a data file on disk. This is a blocking operation and may take a significant amount of time depending on the database size.

Input parameters
Name Description Type

schemaFile

The path to the schema definition file to be created.

string

dataFile

The path to the data file to be created.

string

Returns

void

Code examples
database.ExportToFile("schema.tql", "data.typedb");

method GetSchema

string GetSchema()

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

Returns

string

Code examples
database.GetSchema();

method GetTypeSchema

string GetTypeSchema()

Returns the types in the schema as a valid TypeQL define query string.

Returns

string

Code examples
database.GetTypeSchema();

method Name

string TypeDB.Driver.Api.IDatabase.Name

The database name as a string.

Returns

string

Code examples
database.Name;

IUserManager

class

Package: TypeDB.Driver.Api

Provides access to all user management methods.

method Contains

bool Contains(string username)

Checks if a user with the given name exists.

Input parameters
Name Description Type

username

The user name to be checked.

string

Returns

bool

Code examples
driver.Users.Contains(username);

method Create

void Create(string username, string password)

Creates a user with the given name and password.

Input parameters
Name Description Type

username

The name of the user to be created.

string

password

The password of the user to be created.

string

Returns

void

Code examples
driver.Users.Create(username, password);

method Get

IUser? Get(string username)

Retrieves a user with the given name.

Input parameters
Name Description Type

username

The name of the user to retrieve.

string

Returns

IUser?

Code examples
driver.Users.Get(username);

method GetAll

ISet< IUser > GetAll()

Retrieves all users which exist on the TypeDB server.

Returns

ISet< IUser >

Code examples
driver.Users.GetAll();

method GetCurrentUser

IUser GetCurrentUser()

Retrieves the currently logged in user.

Returns

IUser

Code examples
driver.Users.GetCurrentUser();

IUser

class

Package: TypeDB.Driver.Api

TypeDB user information.

method Delete

void Delete()

Deletes this user.

Returns

void

method UpdatePassword

void UpdatePassword(string password)

Updates the password for this user.

Input parameters
Name Description Type

password

The new password.

string

Returns

void

method Username

string TypeDB.Driver.Api.IUser.Username

Returns the name of this user.

Returns

string

Transaction

ITransaction

class

Package: TypeDB.Driver.Api

A transaction with a TypeDB database.

method Analyze

Promise< IAnalyzedQuery > Analyze(string query)

Analyzes a TypeQL query and returns information about its structure and type inference results.

Input parameters
Name Description Type

query

The TypeQL query string to analyze.

string

Returns

Promise< IAnalyzedQuery >

method Close

void Close()

Closes the transaction.

Returns

void

method 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.

Returns

void

method IsOpen

bool IsOpen()

Checks whether this transaction is open.

Returns

bool

method OnClose

void OnClose(Action< Exception? > function)

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

Input parameters
Name Description Type

function

The callback function.

Action< Exception? >

Returns

void

method Query

Promise< IQueryAnswer > Query(string query)

Executes a TypeQL query in this transaction.

Input parameters
Name Description Type

query

The TypeQL query string to execute.

string

Returns

Promise< IQueryAnswer >

method Query

Promise< IQueryAnswer > Query(string query, QueryOptions options)

Executes a TypeQL query in this transaction with custom options.

Input parameters
Name Description Type

query

The TypeQL query string to execute.

string

options

Query options.

QueryOptions

Returns

Promise< IQueryAnswer >

method Rollback

void Rollback()

Rolls back the uncommitted changes made via this transaction.

Returns

void

method Type

TransactionType TypeDB.Driver.Api.ITransaction.Type

The transaction’s type (Read, Write, or Schema).

Returns

TransactionType

TransactionType

class

Package: TypeDB.Driver.Api

Used to specify the type of transaction.

driver.Transaction(database, TransactionType.Read);
TypeDB.Driver.Api.TransactionType
TransactionType
Used to specify the type of transaction.
Definition ITransaction.cs:99

TransactionOptions

class

Package: TypeDB.Driver.Api

Options for transactions.

method SchemaLockAcquireTimeoutMillis

long? TypeDB.Driver.Api.TransactionOptions.SchemaLockAcquireTimeoutMillis

Gets or sets the schema lock acquire timeout in milliseconds.

Returns

long?

method TransactionOptions

TransactionOptions()

Creates a new TransactionOptions with default settings.

Returns

TransactionOptions

method TransactionTimeoutMillis

long? TypeDB.Driver.Api.TransactionOptions.TransactionTimeoutMillis

Gets or sets the transaction timeout in milliseconds.

Returns

long?

QueryOptions

class

Package: TypeDB.Driver.Api

Options for query execution.

method IncludeInstanceTypes

bool? TypeDB.Driver.Api.QueryOptions.IncludeInstanceTypes

Gets or sets whether to include instance types in query results.

Returns

bool?

method IncludeQueryStructure

bool? TypeDB.Driver.Api.QueryOptions.IncludeQueryStructure

Gets or sets whether to include query structure in query results.

Returns

bool?

method PrefetchSize

long? TypeDB.Driver.Api.QueryOptions.PrefetchSize

Gets or sets the prefetch size for query results.

Returns

long?

method QueryOptions

QueryOptions()

Creates a new QueryOptions with default settings.

Returns

QueryOptions

Answer

IQueryAnswer

class

Package: TypeDB.Driver.Api.Answer

General answer on a query returned by a server. Can be a simple Ok response or a collection of concepts.

method AsConceptDocuments

IConceptDocumentIterator AsConceptDocuments()

Casts the query answer to IConceptDocumentIterator.

Implemented in TypeDB.Driver.Api.Answer.IConceptDocumentIterator.

Returns

IConceptDocumentIterator

Code examples
queryAnswer.AsConceptDocuments()

method AsConceptRows

IConceptRowIterator AsConceptRows()

Casts the query answer to IConceptRowIterator.

Implemented in TypeDB.Driver.Api.Answer.IConceptRowIterator.

Returns

IConceptRowIterator

Code examples
queryAnswer.AsConceptRows()

method AsOk

IOkQueryAnswer AsOk()

Casts the query answer to IOkQueryAnswer.

Implemented in TypeDB.Driver.Api.Answer.IOkQueryAnswer.

Returns

IOkQueryAnswer

Code examples
queryAnswer.AsOk()

method IsConceptDocuments

bool TypeDB.Driver.Api.Answer.IQueryAnswer.IsConceptDocuments

Checks if the query answer is a IConceptDocumentIterator.

Implemented in TypeDB.Driver.Api.Answer.IConceptDocumentIterator.

Returns

bool

Code examples
queryAnswer.IsConceptDocuments

method IsConceptRows

bool TypeDB.Driver.Api.Answer.IQueryAnswer.IsConceptRows

Checks if the query answer is a IConceptRowIterator.

Implemented in TypeDB.Driver.Api.Answer.IConceptRowIterator.

Returns

bool

Code examples
queryAnswer.IsConceptRows

method IsOk

bool TypeDB.Driver.Api.Answer.IQueryAnswer.IsOk

Checks if the query answer is an IOkQueryAnswer.

Implemented in TypeDB.Driver.Api.Answer.IOkQueryAnswer.

Returns

bool

Code examples
queryAnswer.IsOk

method QueryType

QueryType TypeDB.Driver.Api.Answer.IQueryAnswer.QueryType

Retrieves the executed query’s type of this IQueryAnswer.

Returns

QueryType

Code examples
queryAnswer.QueryType

IOkQueryAnswer

class

Package: TypeDB.Driver.Api.Answer

Supertypes:

  • TypeDB.Driver.Api.Answer.IQueryAnswer

Represents a simple Ok message as a server answer. Doesn’t contain concepts.

method AsOk

IOkQueryAnswer IQueryAnswer. AsOk()

Casts the query answer to IOkQueryAnswer.

Implements TypeDB.Driver.Api.Answer.IQueryAnswer.

Returns

IOkQueryAnswer IQueryAnswer.

Code examples
queryAnswer.AsOk()

method IsOk

bool IQueryAnswer. TypeDB.Driver.Api.Answer.IOkQueryAnswer.IsOk

Checks if the query answer is an IOkQueryAnswer.

Implements TypeDB.Driver.Api.Answer.IQueryAnswer.

Returns

bool IQueryAnswer.

Code examples
queryAnswer.IsOk

IConceptRowIterator

class

Package: TypeDB.Driver.Api.Answer

Supertypes:

  • TypeDB.Driver.Api.Answer.IQueryAnswer

Represents an iterator over IConceptRows returned as a server answer.

method AsConceptRows

IConceptRowIterator IQueryAnswer. AsConceptRows()

Casts the query answer to IConceptRowIterator.

Implements TypeDB.Driver.Api.Answer.IQueryAnswer.

Returns

IConceptRowIterator IQueryAnswer.

Code examples
queryAnswer.AsConceptRows()

method IsConceptRows

bool IQueryAnswer. TypeDB.Driver.Api.Answer.IConceptRowIterator.IsConceptRows

Checks if the query answer is a IConceptRowIterator.

Implements TypeDB.Driver.Api.Answer.IQueryAnswer.

Returns

bool IQueryAnswer.

Code examples
queryAnswer.IsConceptRows

IConceptRow

class

Package: TypeDB.Driver.Api.Answer

Contains a row of concepts with a header.

method ColumnNames

IEnumerable< string > TypeDB.Driver.Api.Answer.IConceptRow.ColumnNames

Produces a collection of all column names (variables) in the header of this IConceptRow. Shared between all the rows in a QueryAnswer.

Returns

IEnumerable< string >

Code examples
conceptRow.ColumnNames

method Concepts

IEnumerable< IConcept > TypeDB.Driver.Api.Answer.IConceptRow.Concepts

Produces a collection over all concepts in this IConceptRow, skipping empty results.

Returns

IEnumerable< IConcept >

Code examples
conceptRow.Concepts

method Get

IConcept? Get(string columnName)

Retrieves a concept for a given column name (variable). Returns null if the variable has an empty answer. Throws an exception if the variable is not present.

Input parameters
Name Description Type

columnName

The variable (column name from ColumnNames)

string

Returns

IConcept?

Code examples
conceptRow.Get(columnName)

method GetIndex

IConcept? GetIndex(long columnIndex)

Retrieves a concept for a given index of the header (ColumnNames). Returns null if the index points to an empty answer. Throws an exception if the index is not in the row’s range.

Input parameters
Name Description Type

columnIndex

The column index

long

Returns

IConcept?

Code examples
conceptRow.GetIndex(columnIndex)

method QueryStructure

IPipeline? TypeDB.Driver.Api.Answer.IConceptRow.QueryStructure

Retrieves the query structure pipeline if available. Only available if the query was executed with IncludeQueryStructure option enabled.

Returns

IPipeline?

Code examples
conceptRow.QueryStructure

method QueryType

QueryType TypeDB.Driver.Api.Answer.IConceptRow.QueryType

Retrieves the executed query’s type of this IConceptRow. Shared between all the rows in a QueryAnswer.

Returns

QueryType

Code examples
conceptRow.QueryType

IConceptDocumentIterator

class

Package: TypeDB.Driver.Api.Answer

Supertypes:

  • TypeDB.Driver.Api.Answer.IQueryAnswer

Represents an iterator over concept documents (represented as IJSONs) returned as a server answer.

method AsConceptDocuments

IConceptDocumentIterator IQueryAnswer. AsConceptDocuments()

Casts the query answer to IConceptDocumentIterator.

Implements TypeDB.Driver.Api.Answer.IQueryAnswer.

Returns

IConceptDocumentIterator IQueryAnswer.

Code examples
queryAnswer.AsConceptDocuments()

method IsConceptDocuments

bool IQueryAnswer. TypeDB.Driver.Api.Answer.IConceptDocumentIterator.IsConceptDocuments

Checks if the query answer is a IConceptDocumentIterator.

Implements TypeDB.Driver.Api.Answer.IQueryAnswer.

Returns

bool IQueryAnswer.

Code examples
queryAnswer.IsConceptDocuments

IJSON

class

Package: TypeDB.Driver.Api.Answer

Represents a JSON value returned from a fetch query.

method AsArray

IReadOnlyList< IJSON > AsArray()

Casts this JSON value to an array.

Returns

IReadOnlyList< IJSON >

Code examples
json.AsArray()

method AsBoolean

bool AsBoolean()

Casts this JSON value to a boolean.

Returns

bool

Code examples
json.AsBoolean()

method AsNumber

double AsNumber()

Casts this JSON value to a number.

Returns

double

Code examples
json.AsNumber()

method AsObject

IReadOnlyDictionary< string, IJSON > AsObject()

Casts this JSON value to an object (dictionary).

Returns

IReadOnlyDictionary< string, IJSON >

Code examples
json.AsObject()

method AsString

string AsString()

Casts this JSON value to a string.

Returns

string

Code examples
json.AsString()

method IsArray

bool TypeDB.Driver.Api.Answer.IJSON.IsArray

Checks if this JSON value is an array.

Returns

bool

Code examples
json.IsArray

method IsBoolean

bool TypeDB.Driver.Api.Answer.IJSON.IsBoolean

Checks if this JSON value is a boolean.

Returns

bool

Code examples
json.IsBoolean

method IsNull

bool TypeDB.Driver.Api.Answer.IJSON.IsNull

Checks if this JSON value is null.

Returns

bool

Code examples
json.IsNull

method IsNumber

bool TypeDB.Driver.Api.Answer.IJSON.IsNumber

Checks if this JSON value is a number.

Returns

bool

Code examples
json.IsNumber

method IsObject

bool TypeDB.Driver.Api.Answer.IJSON.IsObject

Checks if this JSON value is an object.

Returns

bool

Code examples
json.IsObject

method IsString

bool TypeDB.Driver.Api.Answer.IJSON.IsString

Checks if this JSON value is a string.

Returns

bool

Code examples
json.IsString

QueryType

class

Package: TypeDB.Driver.Api

Used to specify the type of the executed query.

conceptRow.QueryType
Enumerator
Read&nbsp;

A read-only query that retrieves data.

Write&nbsp;

A write query that modifies data.

Schema&nbsp;

A schema query that modifies the schema.

QueryTypeExtensions

class

Package: TypeDB.Driver.Api

Extension methods for QueryType.

method FromNative

static QueryType FromNative(Pinvoke::QueryType nativeType)

Creates a QueryType from a native QueryType.

Returns

QueryType

method IsRead

static bool IsRead(this QueryType type)

Checks if this is a read query.

Returns

bool

method IsSchema

static bool IsSchema(this QueryType type)

Checks if this is a schema query.

Returns

bool

method IsWrite

static bool IsWrite(this QueryType type)

Checks if this is a write query.

Returns

bool

Promise< T >

class

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 Resolved.

method 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.

Input parameters
Name Description Type

resolver

The function to wrap into the promise

Func< TFrom? >

selector

The mapping (like Select from Linq) function

Func< TFrom, TTo >

Returns

Promise< TTo >

Code examples
Promise<TFrom>.Map<TFrom, TTo>(resolver, selector);

method Promise

Promise(Func< T? > resolver)

Promise constructor

Input parameters
Name Description Type

resolver

The function to wrap into the promise

Func< T? >

Returns

Promise

Code examples
new Promise(resolver);

method Resolve

T? Resolve()

Retrieves the result of the Promise.

Returns

T?

Code examples
promise.Resolve();

VoidPromise

class

Package: TypeDB.Driver.Common

A VoidPromise represents a Promise without an operation’s result.

See also

Promise

method Resolve

void Resolve()

Retrieves the result of the Promise.

Returns

void

Code examples
promise.Resolve();

method VoidPromise

VoidPromise(Action resolver)

Promise constructor

Input parameters
Name Description Type

promise

The function to wrap into the promise

Returns

VoidPromise

Code examples
new Promise(action);

Concept

IConcept

class

Package: TypeDB.Driver.Api

The base interface for all concepts in TypeDB.

method AsAttribute

IAttribute AsAttribute()

Casts the concept to IAttribute.

Implemented in TypeDB.Driver.Api.IAttribute.

Returns

IAttribute

Code examples
concept.AsAttribute()

method AsAttributeType

IAttributeType AsAttributeType()

Casts the concept to IAttributeType.

Implemented in TypeDB.Driver.Api.IAttributeType.

Returns

IAttributeType

Code examples
concept.AsAttributeType()

method AsEntity

IEntity AsEntity()

Casts the concept to IEntity.

Implemented in TypeDB.Driver.Api.IEntity.

Returns

IEntity

Code examples
concept.AsEntity()

method AsEntityType

IEntityType AsEntityType()

Casts the concept to IEntityType.

Implemented in TypeDB.Driver.Api.IEntityType.

Returns

IEntityType

Code examples
concept.AsEntityType()

method AsInstance

IInstance AsInstance()

Casts the concept to IInstance.

Implemented in TypeDB.Driver.Api.IInstance.

Returns

IInstance

Code examples
concept.AsInstance()

method AsRelation

IRelation AsRelation()

Casts the concept to IRelation.

Implemented in TypeDB.Driver.Api.IRelation.

Returns

IRelation

Code examples
concept.AsRelation()

method AsRelationType

IRelationType AsRelationType()

Casts the concept to IRelationType.

Implemented in TypeDB.Driver.Api.IRelationType.

Returns

IRelationType

Code examples
concept.AsRelationType()

method AsRoleType

IRoleType AsRoleType()

Casts the concept to IRoleType.

Implemented in TypeDB.Driver.Api.IRoleType.

Returns

IRoleType

Code examples
concept.AsRoleType()

method AsType

IType AsType()

Casts the concept to IType.

Implemented in TypeDB.Driver.Api.IType.

Returns

IType

Code examples
concept.AsType()

method AsValue

IValue AsValue()

Casts the concept to IValue.

Implemented in TypeDB.Driver.Api.IValue.

Returns

IValue

Code examples
concept.AsValue()

method GetLabel

string GetLabel()

Retrieves the unique label of the concept. If this is an Instance, returns the label of the type of this instance ("unknown" if type fetching is disabled). If this is a Value, returns the label of the value type. If this is a Type, returns the label of the type.

Returns

string

Code examples
concept.GetLabel()

method IsAttribute

bool IsAttribute()

Checks if the concept is an IAttribute.

Implemented in TypeDB.Driver.Api.IAttribute.

Returns

bool

Code examples
concept.IsAttribute()

method IsAttributeType

bool IsAttributeType()

Checks if the concept is an IAttributeType.

Implemented in TypeDB.Driver.Api.IAttributeType.

Returns

bool

Code examples
concept.IsAttributeType()

method IsBoolean

bool IsBoolean()

Returns true if the value which this Concept holds is of type boolean or if this Concept is an AttributeType of type boolean.

Returns

bool

Code examples
concept.IsBoolean()

method IsDate

bool IsDate()

Returns true if the value which this Concept holds is of type date or if this Concept is an AttributeType of type date.

Returns

bool

Code examples
concept.IsDate()

method IsDatetime

bool IsDatetime()

Returns true if the value which this Concept holds is of type datetime or if this Concept is an AttributeType of type datetime.

Returns

bool

Code examples
concept.IsDatetime()

method IsDatetimeTZ

bool IsDatetimeTZ()

Returns true if the value which this Concept holds is of type datetime-tz or if this Concept is an AttributeType of type datetime-tz.

Returns

bool

Code examples
concept.IsDatetimeTZ()

method IsDecimal

bool IsDecimal()

Returns true if the value which this Concept holds is of type decimal or if this Concept is an AttributeType of type decimal.

Returns

bool

Code examples
concept.IsDecimal()

method IsDouble

bool IsDouble()

Returns true if the value which this Concept holds is of type double or if this Concept is an AttributeType of type double.

Returns

bool

Code examples
concept.IsDouble()

method IsDuration

bool IsDuration()

Returns true if the value which this Concept holds is of type duration or if this Concept is an AttributeType of type duration.

Returns

bool

Code examples
concept.IsDuration()

method IsEntity

bool IsEntity()

Checks if the concept is an IEntity.

Implemented in TypeDB.Driver.Api.IEntity.

Returns

bool

Code examples
concept.IsEntity()

method IsEntityType

bool IsEntityType()

Checks if the concept is an IEntityType.

Implemented in TypeDB.Driver.Api.IEntityType.

Returns

bool

Code examples
concept.IsEntityType()

method IsInstance

bool IsInstance()

Checks if the concept is an instance (entity, relation, or attribute).

Implemented in TypeDB.Driver.Api.IInstance.

Returns

bool

Code examples
concept.IsInstance()

method IsInteger

bool IsInteger()

Returns true if the value which this Concept holds is of type integer or if this Concept is an AttributeType of type integer.

Returns

bool

Code examples
concept.IsInteger()

method IsRelation

bool IsRelation()

Checks if the concept is a IRelation.

Implemented in TypeDB.Driver.Api.IRelation.

Returns

bool

Code examples
concept.IsRelation()

method IsRelationType

bool IsRelationType()

Checks if the concept is a IRelationType.

Implemented in TypeDB.Driver.Api.IRelationType.

Returns

bool

Code examples
concept.IsRelationType()

method IsRoleType

bool IsRoleType()

Checks if the concept is a IRoleType.

Implemented in TypeDB.Driver.Api.IRoleType.

Returns

bool

Code examples
concept.IsRoleType()

method IsString

bool IsString()

Returns true if the value which this Concept holds is of type string or if this Concept is an AttributeType of type string.

Returns

bool

Code examples
concept.IsString()

method IsStruct

bool IsStruct()

Returns true if the value which this Concept holds is of type struct or if this Concept is an AttributeType of type struct.

Returns

bool

Code examples
concept.IsStruct()

method IsType

bool IsType()

Checks if the concept is a IType.

Implemented in TypeDB.Driver.Api.IType.

Returns

bool

Code examples
concept.IsType()

method IsValue

bool IsValue()

Checks if the concept is a IValue.

Implemented in TypeDB.Driver.Api.IValue.

Returns

bool

Code examples
concept.IsValue()

method TryGetBoolean

bool? TryGetBoolean()

Returns a boolean value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

bool?

Code examples
concept.TryGetBoolean()

method TryGetDate

DateOnly? TryGetDate()

Returns a date value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

DateOnly?

Code examples
concept.TryGetDate()

method TryGetDatetime

Datetime? TryGetDatetime()

Returns a datetime value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

Datetime?

Code examples
concept.TryGetDatetime()

method TryGetDatetimeTZ

DatetimeTZ? TryGetDatetimeTZ()

Returns a datetime-tz value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

DatetimeTZ?

Code examples
concept.TryGetDatetimeTZ()

method TryGetDecimal

decimal? TryGetDecimal()

Returns a decimal value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

decimal?

Code examples
concept.TryGetDecimal()

method TryGetDouble

double? TryGetDouble()

Returns a double value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

double?

Code examples
concept.TryGetDouble()

method TryGetDuration

Duration? TryGetDuration()

Returns a duration value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

Duration?

Code examples
concept.TryGetDuration()

method TryGetIID

string? TryGetIID()

Retrieves the unique id (IID) of the Concept. Returns null if absent.

Returns

string?

Code examples
concept.TryGetIID()

method TryGetInteger

long? TryGetInteger()

Returns an integer value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

long?

Code examples
concept.TryGetInteger()

method TryGetLabel

string? TryGetLabel()

Retrieves the unique label of the concept, or null if type fetching is disabled for instances.

Returns

string?

Code examples
concept.TryGetLabel()

method TryGetString

string? TryGetString()

Returns a string value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

string?

Code examples
concept.TryGetString()

method TryGetStruct

IReadOnlyDictionary< string, IValue? >? TryGetStruct()

Returns a struct value of this Concept. If it’s not a Value or it has another type, returns null.

Returns

IReadOnlyDictionary< string, IValue? >?

Code examples
concept.TryGetStruct()

method TryGetValue

IValue? TryGetValue()

Retrieves the value which this Concept holds. Returns null if this Concept does not hold any value.

Returns

IValue?

Code examples
concept.TryGetValue()

method TryGetValueType

string? TryGetValueType()

Retrieves the string describing the value type of this Concept. Returns null if absent.

Returns

string?

Code examples
concept.TryGetValueType()

Transitivity

class

Package: TypeDB.Driver.Api.IConcept

Used to specify whether we need explicit or transitive subtyping, instances, etc.

attributeType.GetOwners(transaction, annotation, Transitivity.Explicit)
TypeDB.Driver.Api.IConcept.Transitivity
Transitivity
Used to specify whether we need explicit or transitive subtyping, instances, etc.
Definition IConcept.cs:593

Schema

IType

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IConcept

Represents a type in TypeDB. In TypeDB 3.0, types are read-only data returned from queries.

method AsType

IType IConcept. AsType()

Casts the concept to IType.

Implements TypeDB.Driver.Api.IConcept.

Returns

IType IConcept.

Code examples
concept.AsType()

method IsType

bool IConcept. IsType()

Checks if the concept is a IType.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsType()

IEntityType

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IType

  • TypeDB.Driver.Api.IConcept

Represents an entity type in TypeDB. Entity types represent the classification of independent objects in the data model. In TypeDB 3.0, types are read-only data returned from queries.

method AsEntityType

IEntityType IConcept. AsEntityType()

Casts the concept to IEntityType.

Implements TypeDB.Driver.Api.IConcept.

Returns

IEntityType IConcept.

Code examples
concept.AsEntityType()

method IsEntityType

bool IConcept. IsEntityType()

Checks if the concept is an IEntityType.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsEntityType()

IRelationType

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IType

  • TypeDB.Driver.Api.IConcept

Represents a relation type in TypeDB. Relation types represent relationships between types and have roles. In TypeDB 3.0, types are read-only data returned from queries.

method AsRelationType

IRelationType IConcept. AsRelationType()

Casts the concept to IRelationType.

Implements TypeDB.Driver.Api.IConcept.

Returns

IRelationType IConcept.

Code examples
concept.AsRelationType()

method IsRelationType

bool IConcept. IsRelationType()

Checks if the concept is a IRelationType.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsRelationType()

IRoleType

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IType

  • TypeDB.Driver.Api.IConcept

Represents a role type in TypeDB. Roles are special internal types used by relations. In TypeDB 3.0, types are read-only data returned from queries.

method AsRoleType

IRoleType IConcept. AsRoleType()

Casts the concept to IRoleType.

Implements TypeDB.Driver.Api.IConcept.

Returns

IRoleType IConcept.

Code examples
concept.AsRoleType()

method IsRoleType

bool IConcept. IsRoleType()

Checks if the concept is a IRoleType.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsRoleType()

IAttributeType

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IType

  • TypeDB.Driver.Api.IConcept

Represents an attribute type in TypeDB. Attribute types represent properties that other types can own. In TypeDB 3.0, types are read-only data returned from queries.

method AsAttributeType

IAttributeType IConcept. AsAttributeType()

Casts the concept to IAttributeType.

Implements TypeDB.Driver.Api.IConcept.

Returns

IAttributeType IConcept.

Code examples
concept.AsAttributeType()

method IsAttributeType

bool IConcept. IsAttributeType()

Checks if the concept is an IAttributeType.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsAttributeType()

Label

class

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.

Fields
Name Type Description

readonly string TypeDB​.Driver​.Common​.Label​.Name

readonly string TypeDB​.Driver​.Common​.Label​.Name

Returns the name of this Label. Examples

label.Name;

readonly? string TypeDB​.Driver​.Common​.Label​.Scope

readonly? string TypeDB​.Driver​.Common​.Label​.Scope

Returns the scope of this Label. Examples

label.Scope;

method Equals

override bool Equals(object? obj)

Checks if this Label is equal to another object.

Input parameters
Name Description Type

obj

Object to compare with

object?

Returns

override bool

Code examples
label.Equals(obj);

method Label

Label(string? scope, string name)

Creates a Label from a specified scope and name.

Input parameters
Name Description Type

scope

Label scope

string?

name

Label name

string

Returns

Label

Code examples
new Label("relation", "role");

method Label

Label(string name)

Creates a Label from a specified name.

Input parameters
Name Description Type

name

Label name

string

Returns

Label

Code examples
new Label("entity");

method ScopedName

string TypeDB.Driver.Common.Label.ScopedName

Returns the string representation of the scoped name.

Returns

string

Code examples
label.ScopedName;

method ToString

override string ToString()

Returns the string representation of the scoped name.

Returns

override string

Code examples
label.ToString();

Data

IInstance

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IConcept

Represents an instance (entity, relation, or attribute) in TypeDB. In TypeDB 3.0, instances are read-only data returned from queries.

method AsInstance

IInstance IConcept. AsInstance()

Casts the concept to IInstance.

Implements TypeDB.Driver.Api.IConcept.

Returns

IInstance IConcept.

Code examples
concept.AsInstance()

method IsInstance

bool IConcept. IsInstance()

Checks if the concept is an instance (entity, relation, or attribute).

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsInstance()

method Type

IType TypeDB.Driver.Api.IInstance.Type

The type which this instance belongs to.

Implemented in TypeDB.Driver.Api.IAttribute, TypeDB.Driver.Api.IAttribute, TypeDB.Driver.Api.IEntity, TypeDB.Driver.Api.IEntity, TypeDB.Driver.Api.IRelation, and TypeDB.Driver.Api.IRelation.

Returns

IType

IEntity

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IInstance

  • TypeDB.Driver.Api.IConcept

Represents an entity instance in TypeDB. Entity instances are independent objects in the data model. In TypeDB 3.0, instances are read-only data returned from queries.

method AsEntity

IEntity IConcept. AsEntity()

Casts the concept to IEntity.

Implements TypeDB.Driver.Api.IConcept.

Returns

IEntity IConcept.

Code examples
concept.AsEntity()

method IsEntity

bool IConcept. IsEntity()

Checks if the concept is an IEntity.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsEntity()

method Type [1/2]

new IEntityType TypeDB.Driver.Api.IEntity.Type

The entity type which this entity instance belongs to.

Implements TypeDB.Driver.Api.IInstance.

Returns

new IEntityType

method Type [2/2]

IType IInstance. TypeDB.Driver.Api.IEntity.Type

The type which this instance belongs to.

Implements TypeDB.Driver.Api.IInstance.

Returns

IType IInstance.

IRelation

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IInstance

  • TypeDB.Driver.Api.IConcept

Represents a relation instance in TypeDB. Relation instances connect multiple instances together through roles. In TypeDB 3.0, instances are read-only data returned from queries.

method AsRelation

IRelation IConcept. AsRelation()

Casts the concept to IRelation.

Implements TypeDB.Driver.Api.IConcept.

Returns

IRelation IConcept.

Code examples
concept.AsRelation()

method IsRelation

bool IConcept. IsRelation()

Checks if the concept is a IRelation.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsRelation()

method Type [1/2]

new IRelationType TypeDB.Driver.Api.IRelation.Type

The relation type which this relation instance belongs to.

Implements TypeDB.Driver.Api.IInstance.

Returns

new IRelationType

method Type [2/2]

IType IInstance. TypeDB.Driver.Api.IRelation.Type

The type which this instance belongs to.

Implements TypeDB.Driver.Api.IInstance.

Returns

IType IInstance.

IAttribute

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IInstance

  • TypeDB.Driver.Api.IConcept

Represents an attribute instance in TypeDB. Attribute instances represent properties with values that can be owned by other instances. In TypeDB 3.0, instances are read-only data returned from queries.

method AsAttribute

IAttribute IConcept. AsAttribute()

Casts the concept to IAttribute.

Implements TypeDB.Driver.Api.IConcept.

Returns

IAttribute IConcept.

Code examples
concept.AsAttribute()

method IsAttribute

bool IConcept. IsAttribute()

Checks if the concept is an IAttribute.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsAttribute()

method Type [1/2]

new IAttributeType TypeDB.Driver.Api.IAttribute.Type

The attribute type which this attribute instance belongs to.

Implements TypeDB.Driver.Api.IInstance.

Returns

new IAttributeType

method Type [2/2]

IType IInstance. TypeDB.Driver.Api.IAttribute.Type

The type which this instance belongs to.

Implements TypeDB.Driver.Api.IInstance.

Returns

IType IInstance.

IValue

class

Package: TypeDB.Driver.Api

Supertypes:

  • TypeDB.Driver.Api.IConcept

Represents a value concept in TypeDB. In TypeDB 3.0, values are read-only data returned from queries.

method AsValue

IValue IConcept. AsValue()

Casts the concept to IValue.

Implements TypeDB.Driver.Api.IConcept.

Returns

IValue IConcept.

Code examples
concept.AsValue()

method Get

object Get()

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.

Returns

object

method GetBoolean

bool GetBoolean()

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

Returns

bool

method GetDate

DateOnly GetDate()

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

Returns

DateOnly

method GetDatetime

Datetime GetDatetime()

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

Returns

Datetime

method GetDatetimeTZ

DatetimeTZ GetDatetimeTZ()

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

Returns

DatetimeTZ

method GetDecimal

decimal GetDecimal()

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

Returns

decimal

method GetDouble

double GetDouble()

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

Returns

double

method GetDuration

Duration GetDuration()

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

Returns

Duration

method GetInteger

long GetInteger()

Returns an integer (long) value of this value concept. If the value has another type, raises an exception.

Returns

long

method GetString

string GetString()

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

Returns

string

method GetStruct

IReadOnlyDictionary< string, IValue? > GetStruct()

Returns a struct value of this value concept represented as a dictionary from field names to values. If the value has another type, raises an exception.

Returns

IReadOnlyDictionary< string, IValue? >

method GetValueType

string GetValueType()

Retrieves the value type of this value concept as a string.

Returns

string

method IsValue

bool IConcept. IsValue()

Checks if the concept is a IValue.

Implements TypeDB.Driver.Api.IConcept.

Returns

bool IConcept.

Code examples
concept.IsValue()

Value

Datetime

class

Package: TypeDB.Driver.Common

Represents a datetime with nanosecond precision. C#'s System.DateTime only has tick precision (100ns, 7 fractional digits), losing the last 2 digits of TypeDB’s 9-digit nanosecond precision. This class stores the full-precision seconds and subsecond nanoseconds separately, similar to Java’s Instant.

method DateTime

DateTime TypeDB.Driver.Common.Datetime.DateTime

Gets a System.DateTime derived from this value. Note: this has only tick precision (100ns) and may lose the last 2 nanosecond digits.

Returns

DateTime

method Datetime

Datetime(long seconds, uint subsecNanos)

Creates a Datetime from Unix epoch seconds and subsecond nanoseconds.

Input parameters
Name Description Type

seconds

Seconds since Unix epoch (1970-01-01T00:00:00Z).

long

subsecNanos

Nanoseconds within the second (0–999,999,999).

uint

Returns

Datetime

method Equals

bool Equals(Datetime? other)
Returns

bool

method Equals

override bool Equals(object? obj)
Returns

override bool

method GetHashCode

override int GetHashCode()
Returns

override int

method Parse

static Datetime Parse(string value)

Parses a datetime string in TypeDB format, preserving all 9 fractional digits. Example: "2024-09-20T16:40:05.123456789".

Returns

Datetime

method Seconds

long TypeDB.Driver.Common.Datetime.Seconds

Gets the Unix epoch seconds component.

Returns

long

method SubsecNanos

uint TypeDB.Driver.Common.Datetime.SubsecNanos

Gets the subsecond nanoseconds component (0–999,999,999).

Returns

uint

method ToString

override string ToString()

Formats the datetime as an ISO-8601 string with nanosecond precision. Subsecond precision is omitted if zero, otherwise trailing zeros are trimmed.

Returns

override string

method operator!=

static bool operator!=(Datetime? left, Datetime? right)

Inequality operator.

Returns

bool

method operator==

static bool operator==(Datetime? left, Datetime? right)

Equality operator.

Returns

bool

DatetimeTZ

class

Package: TypeDB.Driver.Common

Represents a datetime with timezone information and nanosecond precision. C#'s DateTimeOffset cannot carry IANA timezone names (e.g., "Europe/London"), so this class wraps a DateTimeOffset alongside the resolved TimeZoneInfo. Additionally, DateTimeOffset only has tick precision (100ns), so this class stores subsecond nanoseconds separately to preserve TypeDB’s full 9-digit precision. This mirrors Java’s ZonedDateTime which preserves both zone ID and nanosecond precision.

method DateTimeOffset

DateTimeOffset TypeDB.Driver.Common.DatetimeTZ.DateTimeOffset

Gets the local date and time with its UTC offset. For IANA zones, the offset is derived from the zone’s rules at the stored instant. Note: this has only tick precision (100ns) and may lose the last 2 nanosecond digits.

Returns

DateTimeOffset

method DatetimeTZ

DatetimeTZ(DateTime utcDateTime, string zoneName, uint subsecNanos = 0)

Creates a DatetimeTZ with an IANA timezone from a UTC datetime. The local time and offset are computed from the zone’s rules at the given UTC instant. This mirrors Java’s ZonedDateTime.ofInstant(Instant, ZoneId).

Input parameters
Name Description Type

utcDateTime

The UTC datetime (Kind should be Utc or Unspecified).

DateTime

zoneName

The IANA timezone name (e.g., "Europe/London").

string

subsecNanos

Subsecond nanoseconds (0–999,999,999), preserving TypeDB’s full nanosecond precision. Defaults to 0.

Returns

DatetimeTZ

method DatetimeTZ

DatetimeTZ(DateTimeOffset dateTimeOffset, uint subsecNanos = 0)

Creates a DatetimeTZ with a fixed UTC offset (no IANA zone).

Input parameters
Name Description Type

dateTimeOffset

The date, time, and UTC offset.

DateTimeOffset

subsecNanos

Subsecond nanoseconds (0–999,999,999), preserving TypeDB’s full nanosecond precision. Defaults to 0.

Returns

DatetimeTZ

method Equals

bool Equals(DatetimeTZ? other)
Returns

bool

method Equals

override bool Equals(object? obj)
Returns

override bool

method GetHashCode

override int GetHashCode()
Returns

override int

method IsFixedOffset

bool TypeDB.Driver.Common.DatetimeTZ.IsFixedOffset

Gets whether this datetime-tz uses a fixed UTC offset (true) or an IANA zone (false).

Returns

bool

method Parse

static DatetimeTZ Parse(string value)

Parses a datetime-tz string in TypeDB format, preserving all 9 fractional digits. IANA zones: "2024-09-20T16:40:05.000000001 Europe/London" (local time + zone name) Fixed offsets: "2024-09-20T16:40:05.000000001+0100" (local time + offset without colon) UTC shorthand: "2024-09-20T16:40:05Z".

Returns

DatetimeTZ

method SubsecNanos

uint TypeDB.Driver.Common.DatetimeTZ.SubsecNanos

Gets the subsecond nanoseconds component (0–999,999,999). This preserves TypeDB’s full nanosecond precision beyond what DateTimeOffset can represent.

Returns

uint

method ToString

override string ToString()

Formats the datetime-tz as an ISO-8601 string with nanosecond precision. Fixed offsets produce: "2024-09-20T16:40:05.123456789+01:00" IANA zones produce: "2024-09-20T16:40:05.123456789+01:00 Europe/London" Subsecond precision is omitted if zero, otherwise trailing zeros are trimmed.

Returns

override string

method ZoneInfo

TimeZoneInfo? TypeDB.Driver.Common.DatetimeTZ.ZoneInfo

Gets the resolved TimeZoneInfo, or null for fixed offsets.

Returns

TimeZoneInfo?

method ZoneName

string? TypeDB.Driver.Common.DatetimeTZ.ZoneName

Gets the IANA timezone name (e.g., "Europe/London"), or null for fixed offsets. This is the original name from the database, independent of platform timezone ID conventions.

Returns

string?

method operator!=

static bool operator!=(DatetimeTZ? left, DatetimeTZ? right)

Inequality operator.

Returns

bool

method operator==

static bool operator==(DatetimeTZ? left, DatetimeTZ? right)

Equality operator.

Returns

bool

Analyze

IAnalyzedQuery

class

Package: TypeDB.Driver.Api.Analyze

An AnalyzedQuery contains the server’s representation of the query and preamble functions, as well as the result of types inferred for each variable by type-inference.

method Fetch

IFetch? TypeDB.Driver.Api.Analyze.IAnalyzedQuery.Fetch

Gets a representation of the Fetch stage of the query, if it has one.

Returns

IFetch?

method Pipeline

IPipeline TypeDB.Driver.Api.Analyze.IAnalyzedQuery.Pipeline

Gets a representation of the query as a Pipeline.

Returns

IPipeline

method Preamble

IEnumerable< IFunction > TypeDB.Driver.Api.Analyze.IAnalyzedQuery.Preamble

Gets a representation of the Functions in the preamble of the query.

Returns

IEnumerable< IFunction >

IConjunction

class

Package: TypeDB.Driver.Api.Analyze

A representation of the constraints involved in a query, and types inferred for each variable.

method AnnotatedVariables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IConjunction.AnnotatedVariables

Gets the variables that have annotations in this conjunction.

Returns

IEnumerable< IVariable >

method Constraints

IEnumerable< IConstraint > TypeDB.Driver.Api.Analyze.IConjunction.Constraints

Gets the constraints in the conjunction.

Returns

IEnumerable< IConstraint >

method GetVariableAnnotations

IVariableAnnotations GetVariableAnnotations(IVariable variable)

Gets the annotations for a specific variable in this conjunction.

Returns

IVariableAnnotations

IConjunctionID

class

Package: TypeDB.Driver.Api.Analyze

Identifies a conjunction within a query pipeline.

IConstraint

class

Package: TypeDB.Driver.Api.Analyze

A representation of a TypeQL constraint.

method AsComparison

IComparison AsComparison()

Casts this constraint to a comparison constraint.

Returns

IComparison

method AsExpression

IExpression AsExpression()

Casts this constraint to an expression constraint.

Returns

IExpression

method AsFunctionCall

IFunctionCall AsFunctionCall()

Casts this constraint to a function call constraint.

Returns

IFunctionCall

method AsHas

IHas AsHas()

Casts this constraint to a has constraint.

Returns

IHas

method AsIid

IIid AsIid()

Casts this constraint to an iid constraint.

Returns

IIid

method AsIs

IIs AsIs()

Casts this constraint to an is constraint.

Returns

IIs

method AsIsa

IIsa AsIsa()

Casts this constraint to an isa constraint.

Returns

IIsa

method AsKind

IKind AsKind()

Casts this constraint to a kind constraint.

Returns

IKind

method AsLabel

ILabelConstraint AsLabel()

Casts this constraint to a label constraint.

Returns

ILabelConstraint

ILinks AsLinks()

Casts this constraint to a links constraint.

Returns

ILinks

method AsNot

INot AsNot()

Casts this constraint to a not constraint.

Returns

INot

method AsOr

IOr AsOr()

Casts this constraint to an or constraint.

Returns

IOr

method AsOwns

IOwns AsOwns()

Casts this constraint to an owns constraint.

Returns

IOwns

method AsPlays

IPlays AsPlays()

Casts this constraint to a plays constraint.

Returns

IPlays

method AsRelates

IRelates AsRelates()

Casts this constraint to a relates constraint.

Returns

IRelates

method AsSub

ISub AsSub()

Casts this constraint to a sub constraint.

Returns

ISub

method AsTry

ITry AsTry()

Casts this constraint to a try constraint.

Returns

ITry

method AsValue

IValueConstraint AsValue()

Casts this constraint to a value constraint.

Returns

IValueConstraint

method IsComparison

bool TypeDB.Driver.Api.Analyze.IConstraint.IsComparison

Checks if this constraint is a comparison constraint.

Returns

bool

method IsExpression

bool TypeDB.Driver.Api.Analyze.IConstraint.IsExpression

Checks if this constraint is an expression constraint.

Returns

bool

method IsFunctionCall

bool TypeDB.Driver.Api.Analyze.IConstraint.IsFunctionCall

Checks if this constraint is a function call constraint.

Returns

bool

method IsHas

bool TypeDB.Driver.Api.Analyze.IConstraint.IsHas

Checks if this constraint is a has constraint.

Returns

bool

method IsIid

bool TypeDB.Driver.Api.Analyze.IConstraint.IsIid

Checks if this constraint is an iid constraint.

Returns

bool

method IsIs

bool TypeDB.Driver.Api.Analyze.IConstraint.IsIs

Checks if this constraint is an is constraint.

Returns

bool

method IsIsa

bool TypeDB.Driver.Api.Analyze.IConstraint.IsIsa

Checks if this constraint is an isa constraint.

Returns

bool

method IsKind

bool TypeDB.Driver.Api.Analyze.IConstraint.IsKind

Checks if this constraint is a kind constraint.

Returns

bool

method IsLabel

bool TypeDB.Driver.Api.Analyze.IConstraint.IsLabel

Checks if this constraint is a label constraint.

Returns

bool

bool TypeDB.Driver.Api.Analyze.IConstraint.IsLinks

Checks if this constraint is a links constraint.

Returns

bool

method IsNot

bool TypeDB.Driver.Api.Analyze.IConstraint.IsNot

Checks if this constraint is a not constraint.

Returns

bool

method IsOr

bool TypeDB.Driver.Api.Analyze.IConstraint.IsOr

Checks if this constraint is an or constraint.

Returns

bool

method IsOwns

bool TypeDB.Driver.Api.Analyze.IConstraint.IsOwns

Checks if this constraint is an owns constraint.

Returns

bool

method IsPlays

bool TypeDB.Driver.Api.Analyze.IConstraint.IsPlays

Checks if this constraint is a plays constraint.

Returns

bool

method IsRelates

bool TypeDB.Driver.Api.Analyze.IConstraint.IsRelates

Checks if this constraint is a relates constraint.

Returns

bool

method IsSub

bool TypeDB.Driver.Api.Analyze.IConstraint.IsSub

Checks if this constraint is a sub constraint.

Returns

bool

method IsTry

bool TypeDB.Driver.Api.Analyze.IConstraint.IsTry

Checks if this constraint is a try constraint.

Returns

bool

method IsValue

bool TypeDB.Driver.Api.Analyze.IConstraint.IsValue

Checks if this constraint is a value constraint.

Returns

bool

method Span

ISpan TypeDB.Driver.Api.Analyze.IConstraint.Span

Gets the span of this constraint in the source query.

Returns

ISpan

method Variant

Pinvoke.ConstraintVariant TypeDB.Driver.Api.Analyze.IConstraint.Variant

Gets the variant of this constraint.

Returns

Pinvoke.ConstraintVariant

IComparison

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a comparison: lhs comparator rhs.

method Comparator

Pinvoke.Comparator TypeDB.Driver.Api.Analyze.IComparison.Comparator

The comparator operator.

Returns

Pinvoke.Comparator

method ComparatorSymbol

string TypeDB.Driver.Api.Analyze.IComparison.ComparatorSymbol

The symbol representation of the comparator.

Returns

string

method Lhs

IConstraintVertex TypeDB.Driver.Api.Analyze.IComparison.Lhs

The left-hand side of the comparison.

Returns

IConstraintVertex

method Rhs

IConstraintVertex TypeDB.Driver.Api.Analyze.IComparison.Rhs

The right-hand side of the comparison.

Returns

IConstraintVertex

IExpression

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents an expression: let assigned = expression.

method Arguments

IEnumerable< IConstraintVertex > TypeDB.Driver.Api.Analyze.IExpression.Arguments

The arguments to the expression.

Returns

IEnumerable< IConstraintVertex >

method Assigned

IConstraintVertex TypeDB.Driver.Api.Analyze.IExpression.Assigned

The variable being assigned to.

Returns

IConstraintVertex

method Text

string TypeDB.Driver.Api.Analyze.IExpression.Text

The text of the expression.

Returns

string

IFunctionCall

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a function call: let assigned = name(arguments)

method Arguments

IEnumerable< IConstraintVertex > TypeDB.Driver.Api.Analyze.IFunctionCall.Arguments

The arguments to the function call.

Returns

IEnumerable< IConstraintVertex >

method Assigned

IEnumerable< IConstraintVertex > TypeDB.Driver.Api.Analyze.IFunctionCall.Assigned

The variables being assigned to.

Returns

IEnumerable< IConstraintVertex >

method Name

string TypeDB.Driver.Api.Analyze.IFunctionCall.Name

The name of the function being called.

Returns

string

IHas

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "has" constraint: owner has attribute.

method Attribute

IConstraintVertex TypeDB.Driver.Api.Analyze.IHas.Attribute

The attribute vertex of the constraint.

Returns

IConstraintVertex

method Exactness

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.IHas.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

method Owner

IConstraintVertex TypeDB.Driver.Api.Analyze.IHas.Owner

The owner vertex of the constraint.

Returns

IConstraintVertex

IIid

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents an IID constraint: concept iid iid_value.

method Iid

string TypeDB.Driver.Api.Analyze.IIid.Iid

The internal identifier value.

Returns

string

method Variable

IConstraintVertex TypeDB.Driver.Api.Analyze.IIid.Variable

The variable being constrained.

Returns

IConstraintVertex

IIs

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents an "is" constraint: lhs is rhs.

method Lhs

IConstraintVertex TypeDB.Driver.Api.Analyze.IIs.Lhs

The left-hand side of the constraint.

Returns

IConstraintVertex

method Rhs

IConstraintVertex TypeDB.Driver.Api.Analyze.IIs.Rhs

The right-hand side of the constraint.

Returns

IConstraintVertex

IIsa

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents an "isa" constraint: instance isa(!) type.

method Exactness

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.IIsa.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

method Instance

IConstraintVertex TypeDB.Driver.Api.Analyze.IIsa.Instance

The instance vertex of the constraint.

Returns

IConstraintVertex

method Type

IConstraintVertex TypeDB.Driver.Api.Analyze.IIsa.Type

The type vertex of the constraint.

Returns

IConstraintVertex

IKind

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a kind constraint: kind type.

method Kind

Pinvoke.Kind TypeDB.Driver.Api.Analyze.IKind.Kind

The kind of the type.

Returns

Pinvoke.Kind

method Type

IConstraintVertex TypeDB.Driver.Api.Analyze.IKind.Type

The type vertex of the constraint.

Returns

IConstraintVertex

ILabelConstraint

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a label constraint: type label label_value.

method LabelValue

string TypeDB.Driver.Api.Analyze.ILabelConstraint.LabelValue

The label value.

Returns

string

method Variable

IConstraintVertex TypeDB.Driver.Api.Analyze.ILabelConstraint.Variable

The variable being constrained.

Returns

IConstraintVertex

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "links" constraint: relation links (role: player)

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.ILinks.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

IConstraintVertex TypeDB.Driver.Api.Analyze.ILinks.Player

The player vertex of the constraint.

Returns

IConstraintVertex

IConstraintVertex TypeDB.Driver.Api.Analyze.ILinks.Relation

The relation vertex of the constraint.

Returns

IConstraintVertex

IConstraintVertex TypeDB.Driver.Api.Analyze.ILinks.Role

The role vertex of the constraint.

Returns

IConstraintVertex

INot

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "not" constraint: not { conjunction }.

method Conjunction

IConjunctionID TypeDB.Driver.Api.Analyze.INot.Conjunction

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

IOr

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents an "or" constraint: { branches[0] } or { branches[1] } [or …​].

method Branches

IEnumerable< IConjunctionID > TypeDB.Driver.Api.Analyze.IOr.Branches

The conjunction branches, as indices into the pipeline’s conjunctions.

Returns

IEnumerable< IConjunctionID >

IOwns

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents an "owns" constraint: owner owns attribute.

method Attribute

IConstraintVertex TypeDB.Driver.Api.Analyze.IOwns.Attribute

The attribute vertex of the constraint.

Returns

IConstraintVertex

method Exactness

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.IOwns.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

method Owner

IConstraintVertex TypeDB.Driver.Api.Analyze.IOwns.Owner

The owner vertex of the constraint.

Returns

IConstraintVertex

IPlays

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "plays" constraint: player plays role.

method Exactness

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.IPlays.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

method Player

IConstraintVertex TypeDB.Driver.Api.Analyze.IPlays.Player

The player vertex of the constraint.

Returns

IConstraintVertex

method Role

IConstraintVertex TypeDB.Driver.Api.Analyze.IPlays.Role

The role vertex of the constraint.

Returns

IConstraintVertex

IRelates

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "relates" constraint: relation relates role.

method Exactness

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.IRelates.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

method Relation

IConstraintVertex TypeDB.Driver.Api.Analyze.IRelates.Relation

The relation vertex of the constraint.

Returns

IConstraintVertex

method Role

IConstraintVertex TypeDB.Driver.Api.Analyze.IRelates.Role

The role vertex of the constraint.

Returns

IConstraintVertex

ISpan

class

Package: TypeDB.Driver.Api.Analyze

The span of a constraint in the source query.

method Begin

long TypeDB.Driver.Api.Analyze.ISpan.Begin

Gets the offset of the first character.

Returns

long

method End

long TypeDB.Driver.Api.Analyze.ISpan.End

Gets the offset after the last character.

Returns

long

ISub

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "sub" constraint: subtype sub(!) supertype.

method Exactness

Pinvoke.ConstraintExactness TypeDB.Driver.Api.Analyze.ISub.Exactness

The exactness of the constraint.

Returns

Pinvoke.ConstraintExactness

method Subtype

IConstraintVertex TypeDB.Driver.Api.Analyze.ISub.Subtype

The subtype vertex of the constraint.

Returns

IConstraintVertex

method Supertype

IConstraintVertex TypeDB.Driver.Api.Analyze.ISub.Supertype

The supertype vertex of the constraint.

Returns

IConstraintVertex

ITry

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a "try" constraint: try { conjunction }.

method Conjunction

IConjunctionID TypeDB.Driver.Api.Analyze.ITry.Conjunction

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

IValueConstraint

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IConstraint

Represents a value constraint: attribute_type value value_type.

method AttributeType

IConstraintVertex TypeDB.Driver.Api.Analyze.IValueConstraint.AttributeType

The attribute type vertex of the constraint.

Returns

IConstraintVertex

method ValueType

string TypeDB.Driver.Api.Analyze.IValueConstraint.ValueType

The value type.

Returns

string

IConstraintVertex

class

Package: TypeDB.Driver.Api.Analyze

The answer to a TypeDB query is a set of concepts which satisfy the constraints in the query. A ConstraintVertex is either a variable, or some identifier of the concept. A Variable is a vertex the query must match and return. A Label uniquely identifies a type. A Value represents a primitive value literal in TypeDB. A NamedRole vertex is used in links and relates constraints, as multiple relations may have roles with the same name.

method AsLabel

IType AsLabel()

Down-casts this vertex to a type label.

Returns

IType

method AsNamedRole

INamedRole AsNamedRole()

Down-casts this vertex to a named role.

Returns

INamedRole

method AsValue

Api.IValue AsValue()

Down-casts this vertex to a value.

Returns

Api.IValue

method AsVariable

IVariable AsVariable()

Down-casts this vertex to a variable.

Returns

IVariable

method IsLabel

bool TypeDB.Driver.Api.Analyze.IConstraintVertex.IsLabel

Checks if this vertex is a label.

Returns

bool

method IsNamedRole

bool TypeDB.Driver.Api.Analyze.IConstraintVertex.IsNamedRole

Checks if this vertex is a named role.

Returns

bool

method IsValue

bool TypeDB.Driver.Api.Analyze.IConstraintVertex.IsValue

Checks if this vertex is a value.

Returns

bool

method IsVariable

bool TypeDB.Driver.Api.Analyze.IConstraintVertex.IsVariable

Checks if this vertex is a variable.

Returns

bool

IFetch

class

Package: TypeDB.Driver.Api.Analyze

A representation of the 'fetch' stage of a query.

method AsLeaf

IFetchLeaf AsLeaf()

Casts this fetch to a leaf.

Returns

IFetchLeaf

method AsList

IFetchList AsList()

Casts this fetch to a list.

Returns

IFetchList

method AsObject

IFetchObject AsObject()

Casts this fetch to an object.

Returns

IFetchObject

method IsLeaf

bool TypeDB.Driver.Api.Analyze.IFetch.IsLeaf

Checks if this fetch is a leaf.

Returns

bool

method IsList

bool TypeDB.Driver.Api.Analyze.IFetch.IsList

Checks if this fetch is a list.

Returns

bool

method IsObject

bool TypeDB.Driver.Api.Analyze.IFetch.IsObject

Checks if this fetch is an object.

Returns

bool

method Variant

Pinvoke.FetchVariant TypeDB.Driver.Api.Analyze.IFetch.Variant

Gets the variant. One of: Leaf, List, Object.

Returns

Pinvoke.FetchVariant

IFetchLeaf

class

Package: TypeDB.Driver.Api.Analyze

The leaf of a Fetch object. Holds information on the value it can hold.

method Annotations

IEnumerable< string > TypeDB.Driver.Api.Analyze.IFetchLeaf.Annotations

Gets the possible value types.

Returns

IEnumerable< string >

IFetchList

class

Package: TypeDB.Driver.Api.Analyze

A list of Fetch documents.

method Element

IFetch TypeDB.Driver.Api.Analyze.IFetchList.Element

Gets the element of the list.

Returns

IFetch

IFetchObject

class

Package: TypeDB.Driver.Api.Analyze

A mapping of string keys to Fetch documents.

method Get

IFetch Get(string key)

Gets the Fetch object for the given key.

Returns

IFetch

method Keys

IEnumerable< string > TypeDB.Driver.Api.Analyze.IFetchObject.Keys

Gets the available keys of this Fetch document.

Returns

IEnumerable< string >

IFunction

class

Package: TypeDB.Driver.Api.Analyze

Holds a representation of a function, and the result of type-inference for each variable.

method ArgumentAnnotations

IEnumerable< IVariableAnnotations > TypeDB.Driver.Api.Analyze.IFunction.ArgumentAnnotations

Gets the type annotations for each argument of the function.

Returns

IEnumerable< IVariableAnnotations >

method ArgumentVariables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IFunction.ArgumentVariables

Gets the variables which are the arguments of the function.

Returns

IEnumerable< IVariable >

method Body

IPipeline TypeDB.Driver.Api.Analyze.IFunction.Body

Gets the pipeline which forms the body of the function.

Returns

IPipeline

method ReturnAnnotations

IEnumerable< IVariableAnnotations > TypeDB.Driver.Api.Analyze.IFunction.ReturnAnnotations

Gets the type annotations for each concept returned by the function.

Returns

IEnumerable< IVariableAnnotations >

method ReturnOperation

IReturnOperation TypeDB.Driver.Api.Analyze.IFunction.ReturnOperation

Gets the return operation of the function.

Returns

IReturnOperation

IReturnOperation

class

Package: TypeDB.Driver.Api.Analyze

A representation of the return operation of a function.

method AsCheck

ICheckReturn AsCheck()

Casts this return operation to a check return.

Returns

ICheckReturn

method AsReduce

IReduceReturn AsReduce()

Casts this return operation to a reduce return.

Returns

IReduceReturn

method AsSingle

ISingleReturn AsSingle()

Casts this return operation to a single return.

Returns

ISingleReturn

method AsStream

IStreamReturn AsStream()

Casts this return operation to a stream return.

Returns

IStreamReturn

method IsCheck

bool TypeDB.Driver.Api.Analyze.IReturnOperation.IsCheck

Checks if this is a check return.

Returns

bool

method IsReduce

bool TypeDB.Driver.Api.Analyze.IReturnOperation.IsReduce

Checks if this is a reduce return.

Returns

bool

method IsSingle

bool TypeDB.Driver.Api.Analyze.IReturnOperation.IsSingle

Checks if this is a single return.

Returns

bool

method IsStream

bool TypeDB.Driver.Api.Analyze.IReturnOperation.IsStream

Checks if this is a stream return.

Returns

bool

method Variant

Pinvoke.ReturnOperationVariant TypeDB.Driver.Api.Analyze.IReturnOperation.Variant

Gets the variant. One of: StreamReturn, SingleReturn, CheckReturn, ReduceReturn.

Returns

Pinvoke.ReturnOperationVariant

ICheckReturn

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IReturnOperation

Indicates the function returns a boolean.

IReduceReturn

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IReturnOperation

Indicates the function returns an aggregation over the rows in the body.

method Reducers

IEnumerable< IReducer > TypeDB.Driver.Api.Analyze.IReduceReturn.Reducers

The reducers used to compute the aggregations.

Returns

IEnumerable< IReducer >

ISingleReturn

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IReturnOperation

Indicates the function returns a single row of the specified variables.

method Selector

string TypeDB.Driver.Api.Analyze.ISingleReturn.Selector

The selector that determines how the row is selected.

Returns

string

method Variables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.ISingleReturn.Variables

The variables in the returned row.

Returns

IEnumerable< IVariable >

IStreamReturn

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IReturnOperation

Indicates the function returns a stream of concepts.

method Variables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IStreamReturn.Variables

The variables in the returned row.

Returns

IEnumerable< IVariable >

INamedRole

class

Package: TypeDB.Driver.Api.Analyze

'links' and 'relates' constraints accept unscoped role names. Since an unscoped role-name does not uniquely identify a role-type, (different role-types belonging to different relation types may share the same name) an internal variable is introduced to handle the ambiguity.

method Name

string TypeDB.Driver.Api.Analyze.INamedRole.Name

Gets the unscoped role name specified in the query.

Returns

string

method Variable

IVariable TypeDB.Driver.Api.Analyze.INamedRole.Variable

Gets the internal variable injected to handle ambiguity in unscoped role names.

Returns

IVariable

IPipeline

class

Package: TypeDB.Driver.Api.Analyze

A representation of a query pipeline.

method GetConjunction

IConjunction? GetConjunction(IConjunctionID conjunctionID)

Gets the conjunction for the specified conjunction ID.

Returns

IConjunction?

method GetVariableName

string? GetVariableName(IVariable variable)

Gets the name of the specified variable, if it has one.

Returns

string?

method Stages

IEnumerable< IPipelineStage > TypeDB.Driver.Api.Analyze.IPipeline.Stages

Gets the stages making up the pipeline.

Returns

IEnumerable< IPipelineStage >

IPipelineStage

class

Package: TypeDB.Driver.Api.Analyze

Representation of a stage in a pipeline.

method AsDelete

IDeleteStage AsDelete()

Casts this stage to a delete stage.

Returns

IDeleteStage

method AsDistinct

IDistinctStage AsDistinct()

Casts this stage to a distinct stage.

Returns

IDistinctStage

method AsInsert

IInsertStage AsInsert()

Casts this stage to an insert stage.

Returns

IInsertStage

method AsLimit

ILimitStage AsLimit()

Casts this stage to a limit stage.

Returns

ILimitStage

method AsMatch

IMatchStage AsMatch()

Casts this stage to a match stage.

Returns

IMatchStage

method AsOffset

IOffsetStage AsOffset()

Casts this stage to an offset stage.

Returns

IOffsetStage

method AsPut

IPutStage AsPut()

Casts this stage to a put stage.

Returns

IPutStage

method AsReduce

IReduceStage AsReduce()

Casts this stage to a reduce stage.

Returns

IReduceStage

method AsRequire

IRequireStage AsRequire()

Casts this stage to a require stage.

Returns

IRequireStage

method AsSelect

ISelectStage AsSelect()

Casts this stage to a select stage.

Returns

ISelectStage

method AsSort

ISortStage AsSort()

Casts this stage to a sort stage.

Returns

ISortStage

method AsUpdate

IUpdateStage AsUpdate()

Casts this stage to an update stage.

Returns

IUpdateStage

method IsDelete

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsDelete

Checks if this stage is a delete stage.

Returns

bool

method IsDistinct

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsDistinct

Checks if this stage is a distinct stage.

Returns

bool

method IsInsert

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsInsert

Checks if this stage is an insert stage.

Returns

bool

method IsLimit

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsLimit

Checks if this stage is a limit stage.

Returns

bool

method IsMatch

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsMatch

Checks if this stage is a match stage.

Returns

bool

method IsOffset

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsOffset

Checks if this stage is an offset stage.

Returns

bool

method IsPut

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsPut

Checks if this stage is a put stage.

Returns

bool

method IsReduce

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsReduce

Checks if this stage is a reduce stage.

Returns

bool

method IsRequire

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsRequire

Checks if this stage is a require stage.

Returns

bool

method IsSelect

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsSelect

Checks if this stage is a select stage.

Returns

bool

method IsSort

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsSort

Checks if this stage is a sort stage.

Returns

bool

method IsUpdate

bool TypeDB.Driver.Api.Analyze.IPipelineStage.IsUpdate

Checks if this stage is an update stage.

Returns

bool

method Variant

Pinvoke.PipelineStageVariant TypeDB.Driver.Api.Analyze.IPipelineStage.Variant

Gets the pipeline stage variant.

Returns

Pinvoke.PipelineStageVariant

IDeleteStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "delete" stage: delete block; deleted_variables;.

method Block

IConjunctionID TypeDB.Driver.Api.Analyze.IDeleteStage.Block

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

method DeletedVariables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IDeleteStage.DeletedVariables

The variables for which the unified concepts are to be deleted.

Returns

IEnumerable< IVariable >

IDistinctStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "distinct" stage.

IInsertStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents an "insert" stage: insert block.

method Block

IConjunctionID TypeDB.Driver.Api.Analyze.IInsertStage.Block

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

ILimitStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "limit" stage: limit n.

method Limit

long TypeDB.Driver.Api.Analyze.ILimitStage.Limit

The maximum number of results to return.

Returns

long

IMatchStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "match" stage: match block.

method Block

IConjunctionID TypeDB.Driver.Api.Analyze.IMatchStage.Block

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

IOffsetStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents an "offset" stage: offset n.

method Offset

long TypeDB.Driver.Api.Analyze.IOffsetStage.Offset

The number of results to skip.

Returns

long

IPutStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "put" stage: put block.

method Block

IConjunctionID TypeDB.Driver.Api.Analyze.IPutStage.Block

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

IReduceAssignment

class

Package: TypeDB.Driver.Api.Analyze

An assignment of a reducer to a variable.

method Assigned

IVariable TypeDB.Driver.Api.Analyze.IReduceAssignment.Assigned

The variable being assigned to.

Returns

IVariable

method Reducer

IReducer TypeDB.Driver.Api.Analyze.IReduceAssignment.Reducer

The reducer being applied.

Returns

IReducer

IReduceStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "reduce" stage: reduce reducers groupby groupby.

method GroupBy

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IReduceStage.GroupBy

The variables to group by.

Returns

IEnumerable< IVariable >

method ReducerAssignments

IEnumerable< IReduceAssignment > TypeDB.Driver.Api.Analyze.IReduceStage.ReducerAssignments

The reducer assignments.

Returns

IEnumerable< IReduceAssignment >

IRequireStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "require" stage: require variables.

method Variables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IRequireStage.Variables

The variables that must be present in the result.

Returns

IEnumerable< IVariable >

ISelectStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "select" stage: select variables.

method Variables

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.ISelectStage.Variables

The variables being selected.

Returns

IEnumerable< IVariable >

ISortVariable

class

Package: TypeDB.Driver.Api.Analyze

A variable and its sort order.

method Order

Pinvoke.SortOrder TypeDB.Driver.Api.Analyze.ISortVariable.Order

The sort order (ascending or descending).

Returns

Pinvoke.SortOrder

method Variable

IVariable TypeDB.Driver.Api.Analyze.ISortVariable.Variable

The variable to sort by.

Returns

IVariable

ISortStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents a "sort" stage: sort variables-and-order.

method Variables

IEnumerable< ISortVariable > TypeDB.Driver.Api.Analyze.ISortStage.Variables

The sort variables and their sort orders.

Returns

IEnumerable< ISortVariable >

IUpdateStage

class

Package: TypeDB.Driver.Api.Analyze

Supertypes:

  • TypeDB.Driver.Api.Analyze.IPipelineStage

Represents an "update" stage: update block.

method Block

IConjunctionID TypeDB.Driver.Api.Analyze.IUpdateStage.Block

The index into the pipeline’s conjunctions.

Returns

IConjunctionID

IReducer

class

Package: TypeDB.Driver.Api.Analyze

Representation of a reducer used either in a reduce stage or in a function’s return operation.

method Arguments

IEnumerable< IVariable > TypeDB.Driver.Api.Analyze.IReducer.Arguments

Gets the arguments to the reducer.

Returns

IEnumerable< IVariable >

method Name

string TypeDB.Driver.Api.Analyze.IReducer.Name

Gets the name of the reduce operation.

Returns

string

IVariable

class

Package: TypeDB.Driver.Api.Analyze

Represents a variable in a TypeQL query.

IVariableAnnotations

class

Package: TypeDB.Driver.Api.Analyze

Represents the type annotations inferred for a variable.

method AsInstance

IEnumerable< IType > AsInstance()

Gets the possible types of instances this variable can hold. Only valid if IsInstance is true.

Returns

IEnumerable< IType >

method AsType

IEnumerable< IType > AsType()

Gets the possible types this variable can hold. Only valid if IsType is true.

Returns

IEnumerable< IType >

method AsValue

IEnumerable< string > AsValue()

Gets the possible value types this variable can hold. Only valid if IsValue is true.

Returns

IEnumerable< string >

method IsInstance

bool TypeDB.Driver.Api.Analyze.IVariableAnnotations.IsInstance

Checks if this variable is an instance variable.

Returns

bool

method IsType

bool TypeDB.Driver.Api.Analyze.IVariableAnnotations.IsType

Checks if this variable is a type variable.

Returns

bool

method IsValue

bool TypeDB.Driver.Api.Analyze.IVariableAnnotations.IsValue

Checks if this variable is a value variable.

Returns

bool

method Variant

Pinvoke.VariableAnnotationsVariant TypeDB.Driver.Api.Analyze.IVariableAnnotations.Variant

Gets the variant indicating whether this is an instance, type, or value variable.

Returns

Pinvoke.VariableAnnotationsVariant

Errors

TypeDBDriverException

class

Package: TypeDB.Driver.Common

Exceptions raised by the driver.

method Contains

bool Contains(string subString)

Checks whether a substring is a part of this exception’s message.

Returns

bool

Code examples
try
{
    ...
}
catch (TypeDBDriverException e)
{
    if (e.Contains("CSCO01"))
    {
        ...
    }
    else
    {
        ...
    }
}