# Java gRPC driver

## [](#_connection_header)Connection

### [](#_TypeDB)TypeDB

`class`

**Package**: `com.typedb.driver`

Fields   

Name

Type

Description

`DEFAULT_ADDRESS`

`static java.lang.String`

#### [](#_TypeDB_TypeDB_)method `TypeDB`

```java
public TypeDB()
```

Returns

`public`

#### [](#_TypeDB_driver_java_lang_String_Credentials_DriverOptions)method `driver`

```java
public static Driver driver​(java.lang.String address,
                            Credentials credentials,
                            DriverOptions driverOptions)
                     throws TypeDBDriverException
```

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

Input parameters   

Name

Description

Type

`address`

The address of the TypeDB server

`java.lang.String`

`credentials`

The credentials to connect with

`Credentials`

`driverOptions`

The driver connection options to connect with

`DriverOptions`

Returns

`public static Driver`

Code examples

```java
TypeDB.driver(address);
```

#### [](#_TypeDB_driver_java_util_Set_java_lang_String_Credentials_DriverOptions)method `driver`

```java
public static Driver driver​(java.util.Set<java.lang.String> addresses,
                            Credentials credentials,
                            DriverOptions driverOptions)
                     throws TypeDBDriverException
```

Open a TypeDB Driver to a TypeDB cluster available at the provided addresses.

Input parameters   

Name

Description

Type

`addresses`

The addresses of TypeDB cluster servers for connection

`java.util.Set<java.lang.String>`

`credentials`

The credentials to connect with

`Credentials`

`driverOptions`

The driver connection options to connect with

`DriverOptions`

Returns

`public static Driver`

Code examples

```java
TypeDB.driver(address);
```

#### [](#_TypeDB_driver_java_util_Map_java_lang_String_​java_lang_String_Credentials_DriverOptions)method `driver`

```java
public static Driver driver​(java.util.Map<java.lang.String,​java.lang.String> addressTranslation,
                            Credentials credentials,
                            DriverOptions driverOptions)
                     throws TypeDBDriverException
```

Open a TypeDB Driver to a TypeDB cluster, using the provided address translation.

Input parameters   

Name

Description

Type

`addressTranslation`

The translation of public TypeDB cluster server addresses (keys) to server-side private addresses (values)

`java.util.Map<java.lang.String,​java.lang.String>`

`credentials`

The credentials to connect with

`Credentials`

`driverOptions`

The driver connection options to connect with

`DriverOptions`

Returns

`public static Driver`

Code examples

```java
TypeDB.driver(addresses);
```

### [](#_Driver)Driver

`class`

**Package**: `com.typedb.driver.api`

**Superinterfaces:**

*   `java.lang.AutoCloseable`
    

Fields   

Name

Type

Description

`LANGUAGE`

`static java.lang.String`

#### [](#_Driver_close_)method `close`

```java
void close()
```

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

Returns

`void`

Code examples

```java
driver.close();
```

#### [](#_Driver_databases_)method `databases`

```java
@CheckReturnValue
DatabaseManager databases()
```

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

Returns

`DatabaseManager`

Code examples

```java
driver.databases();
```

#### [](#_Driver_isOpen_)method `isOpen`

```java
@CheckReturnValue
boolean isOpen()
```

Checks whether this connection is presently open.

Returns

`boolean`

Code examples

```java
driver.isOpen();
```

#### [](#_Driver_primaryServer_)method `primaryServer`

```java
@CheckReturnValue
default java.util.Optional<? extends Server> primaryServer()
```

Returns the primary server for this driver connection, using default automatic routing. See [`primaryServer(ServerRouting)`](#_primaryServer_com_typedb_driver_api_ServerRouting) for more details and options.

Returns

`java.util.Optional<? extends Server>`

Code examples

```java
driver.primaryServer();
```

#### [](#_Driver_primaryServer_ServerRouting)method `primaryServer`

```java
@CheckReturnValue
java.util.Optional<? extends Server> primaryServer​(ServerRouting serverRouting)
```

Returns the primary server for this driver connection.

Input parameters   

Name

Description

Type

`serverRouting`

The server routing to use for the operation

`ServerRouting`

Returns

`java.util.Optional<? extends Server>`

Code examples

```java
driver.primaryServer(new ServerRouting.Auto());
```

#### [](#_Driver_serverVersion_)method `serverVersion`

```java
@CheckReturnValue
default ServerVersion serverVersion()
```

Retrieves the server’s version, using default automatic routing. See [`serverVersion(ServerRouting)`](#_serverVersion_com_typedb_driver_api_ServerRouting) for more details and options.

Returns

`ServerVersion`

Code examples

```java
driver.serverVersion();
```

#### [](#_Driver_serverVersion_ServerRouting)method `serverVersion`

```java
@CheckReturnValue
ServerVersion serverVersion​(ServerRouting serverRouting)
```

Retrieves the server’s version.

Input parameters   

Name

Description

Type

`serverRouting`

The server routing to use for the operation

`ServerRouting`

Returns

`ServerVersion`

Code examples

```java
driver.serverVersion();
```

#### [](#_Driver_servers_)method `servers`

```java
@CheckReturnValue
default java.util.Set<? extends Server> servers()
```

Set of servers for this driver connection, using default automatic routing. See [`servers(ServerRouting)`](#_servers_com_typedb_driver_api_ServerRouting) for more details and options.

Returns

`java.util.Set<? extends Server>`

Code examples

```java
driver.servers();
```

#### [](#_Driver_servers_ServerRouting)method `servers`

```java
@CheckReturnValue
java.util.Set<? extends Server> servers​(ServerRouting serverRouting)
```

Set of servers for this driver connection.

Input parameters   

Name

Description

Type

`serverRouting`

The server routing to use for the operation

`ServerRouting`

Returns

`java.util.Set<? extends Server>`

Code examples

```java
driver.servers(new ServerRouting.Auto());
```

#### [](#_Driver_transaction_java_lang_String_Transaction_Type)method `transaction`

```java
@CheckReturnValue
Transaction transaction​(java.lang.String database,
                        Transaction.Type type)
                 throws TypeDBDriverException
```

Opens a transaction to the given database on the running TypeDB server.

Input parameters   

Name

Description

Type

`database`

The name of the database with which the transaction connects

`java.lang.String`

`type`

The type of transaction to be created (READ, WRITE, or SCHEMA)

`Transaction.Type`

Returns

`Transaction`

Code examples

```java
driver.transaction(database, sessionType);
```

#### [](#_Driver_transaction_java_lang_String_Transaction_Type_TransactionOptions)method `transaction`

```java
@CheckReturnValue
Transaction transaction​(java.lang.String database,
                        Transaction.Type type,
                        TransactionOptions options)
```

Opens a transaction to the given database on the running TypeDB server.

Input parameters   

Name

Description

Type

`database`

The name of the database with which the transaction connects

`java.lang.String`

`type`

The type of transaction to be created (READ, WRITE, or SCHEMA)

`Transaction.Type`

`options`

`TransactionOptions` to configure the opened transaction

`TransactionOptions`

Returns

`Transaction`

Code examples

```java
driver.transaction(database, sessionType);
```

#### [](#_Driver_users_)method `users`

```java
@CheckReturnValue
UserManager users()
```

The `UserManager` for this connection, providing access to user management methods.

Returns

`UserManager`

Code examples

```java
driver.users();
```

### [](#_Credentials)Credentials

`class`

**Package**: `com.typedb.driver.api`

User credentials for connecting to TypeDB Server.

Examples

```java
Credential credentials = new Credential(username, password);
```

#### [](#_Credentials_Credentials_java_lang_String_java_lang_String)method `Credentials`

```java
public Credentials​(java.lang.String username,
                   java.lang.String password)
```

Input parameters   

Name

Description

Type

`username`

The name of the user to connect as

`java.lang.String`

`password`

The password for the user

`java.lang.String`

Returns

`public`

### [](#_DriverOptions)DriverOptions

`class`

**Package**: `com.typedb.driver.api`

TypeDB driver options. `DriverOptions` are used to specify the driver’s connection behavior.

#### [](#_DriverOptions_DriverOptions_DriverTlsConfig)method `DriverOptions`

```java
public DriverOptions​(DriverTlsConfig tlsConfig)
```

Produces a new `DriverOptions` object for connecting to TypeDB Server using custom TLS settings. WARNING: Disabled TLS settings will make the driver sending passwords as plaintext.

Returns

`public`

Code examples

```java
DriverOptions options = new DriverOptions(DriverTlsConfig.enabledWithNativeRootCA());
```

#### [](#_DriverOptions_primaryFailoverRetries_)method `primaryFailoverRetries`

```java
@CheckReturnValue
public java.lang.Integer primaryFailoverRetries()
```

Returns the value set for the primary failover retries limit in this `DriverOptions` object. Specifies the number of retries the driver performs to find and reach the cluster primary after a failed request, before giving up. Total attempts per user request = `N + 1`. Each retry either follows the server’s redirect address (fast path) or polls the known replicas with a 2-second sleep between polls (slow path). Set to `0` to disable failover. Defaults to 1.

Returns

`public java.lang.Integer`

Code examples

```java
options.primaryFailoverRetries();
```

#### [](#_DriverOptions_primaryFailoverRetries_int)method `primaryFailoverRetries`

```java
public DriverOptions primaryFailoverRetries​(int primaryFailoverRetries)
```

Specifies the number of retries the driver performs to find and reach the cluster primary after a failed request, before giving up. Total attempts per user request = `N + 1`. Each retry either follows the server’s redirect address (fast path) or polls the known replicas with a 2-second sleep between polls (slow path). Set to `0` to disable failover. Defaults to 1.

Input parameters   

Name

Description

Type

`primaryFailoverRetries`

The limit of primary failover retries.

`int`

Returns

`public DriverOptions`

Code examples

```java
options.primaryFailoverRetries(1);
```

#### [](#_DriverOptions_requestTimeoutMillis_)method `requestTimeoutMillis`

```java
@CheckReturnValue
public java.lang.Long requestTimeoutMillis()
```

Returns the request timeout in milliseconds set for this `DriverOptions` object. Specifies the maximum time to wait for a response to a unary RPC request. This applies to operations like database creation, user management, and initial transaction opening. It does NOT apply to operations within transactions (queries, commits).

Returns

`public java.lang.Long`

Code examples

```java
options.requestTimeoutMillis();
```

#### [](#_DriverOptions_requestTimeoutMillis_long)method `requestTimeoutMillis`

```java
public DriverOptions requestTimeoutMillis​(long requestTimeoutMillis)
```

Sets the maximum time (in milliseconds) to wait for a response to a unary RPC request. This applies to operations like database creation, user management, and initial transaction opening. It does NOT apply to operations within transactions (queries, commits). Defaults to 2 hours (7200000 milliseconds).

Input parameters   

Name

Description

Type

`requestTimeoutMillis`

The request timeout in milliseconds. Must be non-negative.

`long`

Returns

`public DriverOptions`

Code examples

```java
options.requestTimeoutMillis(30000); // 30 seconds
```

#### [](#_DriverOptions_tlsConfig_)method `tlsConfig`

```java
@CheckReturnValue
public DriverTlsConfig tlsConfig()
```

Returns the TLS configuration associated with this `DriverOptions`. Specifies the TLS configuration of the connection to TypeDB.

Returns

`public DriverTlsConfig`

Code examples

```java
options.tlsConfig();
```

#### [](#_DriverOptions_tlsConfig_DriverTlsConfig)method `tlsConfig`

```java
public DriverOptions tlsConfig​(DriverTlsConfig tlsConfig)
```

Overrides the TLS configuration associated with this `DriverOptions`. WARNING: Disabled TLS settings will make the driver sending passwords as plaintext.

Returns

`public DriverOptions`

Code examples

```java
options.tlsConfig(DriverTlsConfig.enabledWithNativeRootCA());
```

### [](#_DatabaseManager)DatabaseManager

`class`

**Package**: `com.typedb.driver.api.database`

Provides access to all database management methods.

#### [](#_DatabaseManager_all_)method `all`

```java
@CheckReturnValue
java.util.List<Database> all()
                      throws TypeDBDriverException
```

Retrieves all databases present on the TypeDB server.

Returns

`java.util.List<Database>`

Code examples

```java
driver.databases().all()
```

#### [](#_DatabaseManager_contains_java_lang_String)method `contains`

```java
@CheckReturnValue
boolean contains​(java.lang.String name)
          throws TypeDBDriverException
```

Checks if a database with the given name exists.

Input parameters   

Name

Description

Type

`name`

The database name to be checked

`java.lang.String`

Returns

`boolean`

Code examples

```java
driver.databases().contains(name)
```

#### [](#_DatabaseManager_create_java_lang_String)method `create`

```java
void create​(java.lang.String name)
     throws TypeDBDriverException
```

Creates a database with the given name.

Input parameters   

Name

Description

Type

`name`

The name of the database to be created

`java.lang.String`

Returns

`void`

Code examples

```java
driver.databases().create(name)
```

#### [](#_DatabaseManager_get_java_lang_String)method `get`

```java
@CheckReturnValue
Database get​(java.lang.String name)
      throws TypeDBDriverException
```

Retrieves the database with the given name.

Input parameters   

Name

Description

Type

`name`

The name of the database to retrieve

`java.lang.String`

Returns

`Database`

Code examples

```java
driver.databases().get(name)
```

#### [](#_DatabaseManager_importFromFile_java_lang_String_java_lang_String_java_lang_String)method `importFromFile`

```java
void importFromFile​(java.lang.String name,
                    java.lang.String schema,
                    java.lang.String dataFilePath)
             throws TypeDBDriverException
```

Creates a database with the given name based on previously exported another database’s data loaded from a file. 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

`java.lang.String`

`schema`

The schema definition query string for the database

`java.lang.String`

`dataFilePath`

The exported database file path to import the data from

`java.lang.String`

Returns

`void`

Code examples

```java
driver.databases().importFromFile(name, schema, "data.typedb")
```

### [](#_Database)Database

`class`

**Package**: `com.typedb.driver.api.database`

#### [](#_Database_delete_)method `delete`

```java
void delete()
     throws TypeDBDriverException
```

Deletes this database.

Returns

`void`

Code examples

```java
database.delete()
```

#### [](#_Database_exportToFile_java_lang_String_java_lang_String)method `exportToFile`

```java
void exportToFile​(java.lang.String schemaFilePath,
                  java.lang.String dataFilePath)
           throws TypeDBDriverException
```

Export a database into a schema definition and a data files saved to the disk. This is a blocking operation and may take a significant amount of time depending on the database size.

Input parameters   

Name

Description

Type

`schemaFilePath`

The path to the schema definition file to be created

`java.lang.String`

`dataFilePath`

The path to the data file to be created

`java.lang.String`

Returns

`void`

Code examples

```java
database.exportToFile("schema.typeql", "data.typedb")
```

#### [](#_Database_name_)method `name`

```java
@CheckReturnValue
java.lang.String name()
```

The database name as a string.

Returns

`java.lang.String`

Code examples

```java
database.name()
```

#### [](#_Database_schema_)method `schema`

```java
@CheckReturnValue
java.lang.String schema()
                 throws TypeDBDriverException
```

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

Returns

`java.lang.String`

Code examples

```java
database.schema()
```

#### [](#_Database_typeSchema_)method `typeSchema`

```java
@CheckReturnValue
java.lang.String typeSchema()
                     throws TypeDBDriverException
```

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

Returns

`java.lang.String`

Code examples

```java
database.typeSchema()
```

### [](#_UserManager)UserManager

`class`

**Package**: `com.typedb.driver.api.user`

Provides access to all user management methods.

#### [](#_UserManager_all_)method `all`

```java
java.util.Set<User> all()
                 throws TypeDBDriverException
```

Retrieves all users which exist on the TypeDB server.

Returns

`java.util.Set<User>`

Code examples

```java
driver.users().all();
```

#### [](#_UserManager_contains_java_lang_String)method `contains`

```java
@CheckReturnValue
boolean contains​(java.lang.String username)
          throws TypeDBDriverException
```

Checks if a user with the given name exists.

Input parameters   

Name

Description

Type

`username`

The username to be checked

`java.lang.String`

Returns

`boolean`

Code examples

```java
driver.users().contains(username);
```

#### [](#_UserManager_create_java_lang_String_java_lang_String)method `create`

```java
void create​(java.lang.String username,
            java.lang.String password)
     throws TypeDBDriverException
```

Creates a user with the given name & password.

Input parameters   

Name

Description

Type

`username`

The name of the user to be created

`java.lang.String`

`password`

The password of the user to be created

`java.lang.String`

Returns

`void`

Code examples

```java
driver.users().create(username, password);
```

#### [](#_UserManager_get_java_lang_String)method `get`

```java
@CheckReturnValue
User get​(java.lang.String username)
  throws TypeDBDriverException
```

Retrieves a user with the given name.

Input parameters   

Name

Description

Type

`username`

The name of the user to retrieve

`java.lang.String`

Returns

`User`

Code examples

```java
driver.users().get(username);
```

#### [](#_UserManager_getCurrent_)method `getCurrent`

```java
@CheckReturnValue
User getCurrent()
         throws TypeDBDriverException
```

Retrieves the name of the user who opened the current connection.

Returns

`User`

Code examples

```java
driver.users().getCurrent();
```

### [](#_User)User

`class`

**Package**: `com.typedb.driver.api.user`

TypeDB user information

#### [](#_User_delete_)method `delete`

```java
void delete()
```

Deletes this user.

Returns

`void`

Code examples

```java
user.delete();
```

#### [](#_User_name_)method `name`

```java
@CheckReturnValue
java.lang.String name()
```

Returns the name of this user.

Returns

`java.lang.String`

#### [](#_User_updatePassword_java_lang_String)method `updatePassword`

```java
void updatePassword​(java.lang.String password)
```

Updates the password for this user.

Input parameters   

Name

Description

Type

`password`

The new password

`java.lang.String`

Returns

`void`

Code examples

```java
user.updatePassword("new-password");
```

## [](#_transaction_header)Transaction

### [](#_Transaction)Transaction

`class`

**Package**: `com.typedb.driver.api`

**Superinterfaces:**

*   `java.lang.AutoCloseable`
    

#### [](#_Transaction_analyze_java_lang_String)method `analyze`

```java
@CheckReturnValue
Promise<? extends AnalyzedQuery> analyze​(java.lang.String query)
                                  throws TypeDBDriverException
```

Analayze a TypeQL query in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to analyze.

`java.lang.String`

Returns

`Promise<? extends AnalyzedQuery>`

Code examples

```java
transaction.analyze("match $x isa person;");
```

#### [](#_Transaction_close_)method `close`

```java
void close()
    throws TypeDBDriverException
```

Closes the transaction.

Returns

`void`

Code examples

```java
transaction.close()
```

#### [](#_Transaction_commit_)method `commit`

```java
void commit()
     throws TypeDBDriverException
```

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

Returns

`void`

Code examples

```java
transaction.commit()
```

#### [](#_Transaction_getType_)method `getType`

```java
@CheckReturnValue
Transaction.Type getType()
```

The transaction’s type (READ, WRITE, or SCHEMA)

Returns

`Transaction.Type`

Code examples

```java
transaction.getType();
```

#### [](#_Transaction_isOpen_)method `isOpen`

```java
@CheckReturnValue
boolean isOpen()
```

Checks whether this transaction is open.

Returns

`boolean`

Code examples

```java
transaction.isOpen();
```

#### [](#_Transaction_onClose_java_util_function_Consumer_java_lang_Throwable_)method `onClose`

```java
void onClose​(java.util.function.Consumer<java.lang.Throwable> function)
```

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

Input parameters   

Name

Description

Type

`function`

The callback function.

`java.util.function.Consumer<java.lang.Throwable>`

Returns

`void`

Code examples

```java
transaction.onClose(function);
```

#### [](#_Transaction_options_)method `options`

```java
@CheckReturnValue
TransactionOptions options()
```

The options for the transaction

Returns

`TransactionOptions`

#### [](#_Transaction_query_java_lang_String)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query)
                              throws TypeDBDriverException
```

Execute a TypeQL query in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

Returns

`Promise<? extends QueryAnswer>`

Code examples

```java
transaction.query("define entity person;");
```

#### [](#_Transaction_query_java_lang_String_QueryOptions)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     QueryOptions options)
                              throws TypeDBDriverException
```

Execute a TypeQL query in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`options`

The `QueryOptions` to execute the query with.

`QueryOptions`

Returns

`Promise<? extends QueryAnswer>`

Code examples

```java
transaction.query("define entity person;");
```

#### [](#_Transaction_query_java_lang_String_GivenRows)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     GivenRows givenRows)
                              throws TypeDBDriverException
```

Execute a TypeQL query with input rows in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`givenRows`

GivenRows to be used as input to the query.

`GivenRows`

Returns

`Promise<? extends QueryAnswer>`

Code examples

```java
String query = "given $n: string, $a: integer; insert $p isa person, has name == $n, has age == $a;";
 GivenRows rows = TypeDB.Concept.givenRows(
      List.of("n", "a"),
      List.of(
          List.of(TypeDB.Concept.newString("Alice"), TypeDB.Concept.newInteger(28)), // First row
          List.of(TypeDB.Concept.newString("Bob"), TypeDB.Concept.newInteger(26))    // Second row
      )
  );
 transaction.query(query, rows);
```

#### [](#_Transaction_query_java_lang_String_java_util_List_extends_java_util_Map_java_lang_String_​java_lang_Object_)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     java.util.List<? extends java.util.Map<java.lang.String,​java.lang.Object>> givenRows)
                              throws TypeDBDriverException
```

Execute a TypeQL query with input rows in this transaction.

See also: [`query(String, GivenRows)`](#_query_java_lang_String_com_typedb_driver_api_concept_GivenRows)

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`givenRows`

Used to construct the GivenRows which will be used as input to the query. Values must be Concept or a primitive supported by TypeDB.tryConvertToValue

`java.util.List<? extends java.util.Map<java.lang.String,​java.lang.Object>>`

Returns

`Promise<? extends QueryAnswer>`

#### [](#_Transaction_query_java_lang_String_java_util_List_java_lang_String_java_util_List_extends_java_util_List_java_lang_Object_)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     java.util.List<java.lang.String> givenVariables,
                                     java.util.List<? extends java.util.List<java.lang.Object>> givenRows)
                              throws TypeDBDriverException
```

Execute a TypeQL query with input rows in this transaction.

See also: [`query(String, GivenRows)`](#_query_java_lang_String_com_typedb_driver_api_concept_GivenRows)

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`givenVariables`

The variables used to construct the GivenRows which will be used as input to the query.

`java.util.List<java.lang.String>`

`givenRows`

The rows used to construct the GivenRows which will be used as input to the query. Values must be Concept or a primitive supported by TypeDB.tryConvertToValue

`java.util.List<? extends java.util.List<java.lang.Object>>`

Returns

`Promise<? extends QueryAnswer>`

#### [](#_Transaction_query_java_lang_String_QueryOptions_GivenRows)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     QueryOptions options,
                                     GivenRows givenRows)
                              throws TypeDBDriverException
```

Execute a TypeQL query in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`options`

The `QueryOptions` to execute the query with.

`QueryOptions`

`givenRows`

GivenRows to be used as input to the query.

`GivenRows`

Returns

`Promise<? extends QueryAnswer>`

#### [](#_Transaction_query_java_lang_String_QueryOptions_java_util_List_extends_java_util_Map_java_lang_String_​java_lang_Object_)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     QueryOptions options,
                                     java.util.List<? extends java.util.Map<java.lang.String,​java.lang.Object>> givenRows)
                              throws TypeDBDriverException
```

Execute a TypeQL query in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`options`

The `QueryOptions` to execute the query with.

`QueryOptions`

`givenRows`

Used to construct the GivenRows which will be used as input to the query. Values must be Concept or a primitive supported by TypeDB.tryConvertToValue

`java.util.List<? extends java.util.Map<java.lang.String,​java.lang.Object>>`

Returns

`Promise<? extends QueryAnswer>`

#### [](#_Transaction_query_java_lang_String_QueryOptions_java_util_List_java_lang_String_java_util_List_extends_java_util_List_java_lang_Object_)method `query`

```java
@CheckReturnValue
Promise<? extends QueryAnswer> query​(java.lang.String query,
                                     QueryOptions options,
                                     java.util.List<java.lang.String> givenVariables,
                                     java.util.List<? extends java.util.List<java.lang.Object>> givenRows)
                              throws TypeDBDriverException
```

Execute a TypeQL query in this transaction.

Input parameters   

Name

Description

Type

`query`

The query to execute.

`java.lang.String`

`options`

The `QueryOptions` to execute the query with.

`QueryOptions`

`givenVariables`

The variables used to construct the GivenRows which will be used as input to the query.

`java.util.List<java.lang.String>`

`givenRows`

The rows used to construct the GivenRows which will be used as input to the query. Values must be Concept or a primitive supported by TypeDB.tryConvertToValue

`java.util.List<? extends java.util.List<java.lang.Object>>`

Returns

`Promise<? extends QueryAnswer>`

#### [](#_Transaction_rollback_)method `rollback`

```java
void rollback()
       throws TypeDBDriverException
```

Rolls back the uncommitted changes made via this transaction.

Returns

`void`

Code examples

```java
transaction.rollback()
```

### [](#_Transaction_Type)Transaction.Type

`class`

**Package**: `com.typedb.driver.api`

Used to specify the type of transaction.

Examples

```java
driver.transaction(dbName, TransactionType.READ);
```

Enum constants 

Name

`READ`

`SCHEMA`

`WRITE`

#### [](#_Transaction_Type_id_)method `id`

```java
public int id()
```

Returns

`public int`

#### [](#_Transaction_Type_isRead_)method `isRead`

```java
public boolean isRead()
```

Returns

`public boolean`

#### [](#_Transaction_Type_isSchema_)method `isSchema`

```java
public boolean isSchema()
```

Returns

`public boolean`

#### [](#_Transaction_Type_isWrite_)method `isWrite`

```java
public boolean isWrite()
```

Returns

`public boolean`

#### [](#_Transaction_Type_valueOf_java_lang_String)method `valueOf`

```java
public static Transaction.Type valueOf​(java.lang.String name)
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Input parameters   

Name

Description

Type

`name`

the name of the enum constant to be returned.

`java.lang.String`

Returns

`public static Transaction.Type`

#### [](#_Transaction_Type_values_)method `values`

```java
public static Transaction.Type[] values()
```

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

```java
for (Transaction.Type c : Transaction.Type.values())
    System.out.println(c);
```

Returns

`public static Transaction.Type[]`

Code examples

```java
for (Transaction.Type c : Transaction.Type.values())
    System.out.println(c);
```

### [](#_TransactionOptions)TransactionOptions

`class`

**Package**: `com.typedb.driver.api`

TypeDB transaction options. `TransactionOptions` object can be used to override the default server behaviour for opened transactions.

#### [](#_TransactionOptions_TransactionOptions_)method `TransactionOptions`

```java
public TransactionOptions()
```

Produces a new `TransactionOptions` object.

Returns

`public`

Code examples

```java
TransactionOptions options = TransactionOptions();
```

#### [](#_TransactionOptions_schemaLockAcquireTimeoutMillis_)method `schemaLockAcquireTimeoutMillis`

```java
public java.util.Optional<java.lang.Integer> schemaLockAcquireTimeoutMillis()
```

Returns the value set for the schema lock acquire timeout in this `TransactionOptions` object. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Returns

`public java.util.Optional<java.lang.Integer>`

Code examples

```java
options.schemaLockAcquireTimeoutMillis();
```

#### [](#_TransactionOptions_schemaLockAcquireTimeoutMillis_int)method `schemaLockAcquireTimeoutMillis`

```java
public TransactionOptions schemaLockAcquireTimeoutMillis​(int schemaLockAcquireTimeoutMillis)
```

Explicitly sets schema lock acquire timeout. If set, specifies a timeout for killing transactions automatically, preventing memory leaks in unclosed transactions.

Input parameters   

Name

Description

Type

`schemaLockAcquireTimeoutMillis`

How long the driver should wait if opening a transaction is blocked by a schema write lock

`int`

Returns

`public TransactionOptions`

Code examples

```java
options.schemaLockAcquireTimeoutMillis(schemaLockAcquireTimeoutMillis);
```

#### [](#_TransactionOptions_transactionTimeoutMillis_)method `transactionTimeoutMillis`

```java
@CheckReturnValue
public java.util.Optional<java.lang.Integer> transactionTimeoutMillis()
```

Returns the value set for the transaction timeout in this `TransactionOptions` object. If set, specifies how long the driver should wait if opening a transaction is blocked by an exclusive schema write lock.

Returns

`public java.util.Optional<java.lang.Integer>`

Code examples

```java
options.transactionTimeoutMillis();
```

#### [](#_TransactionOptions_transactionTimeoutMillis_int)method `transactionTimeoutMillis`

```java
public TransactionOptions transactionTimeoutMillis​(int transactionTimeoutMillis)
```

Explicitly sets a transaction timeout. If set, specifies how long the driver should wait if opening a transaction is blocked by an exclusive schema write lock.

Input parameters   

Name

Description

Type

`transactionTimeoutMillis`

Timeout for killing transactions automatically

`int`

Returns

`public TransactionOptions`

Code examples

```java
options.transactionTimeoutMillis(transactionTimeoutMillis);
```

### [](#_QueryOptions)QueryOptions

`class`

**Package**: `com.typedb.driver.api`

TypeDB transaction options. `QueryOptions` object can be used to override the default server behaviour for executed queries.

#### [](#_QueryOptions_QueryOptions_)method `QueryOptions`

```java
public QueryOptions()
```

Produces a new `QueryOptions` object.

Returns

`public`

Code examples

```java
QueryOptions options = QueryOptions();
```

#### [](#_QueryOptions_includeInstanceTypes_)method `includeInstanceTypes`

```java
@CheckReturnValue
public java.util.Optional<java.lang.Boolean> includeInstanceTypes()
```

Returns the value set for the "include instance types" flag in this `QueryOptions` object. If set, specifies if types should be included in instance structs returned in ConceptRow answers. This option allows reducing the amount of unnecessary data transmitted.

Returns

`public java.util.Optional<java.lang.Boolean>`

Code examples

```java
options.includeInstanceTypes();
```

#### [](#_QueryOptions_includeInstanceTypes_boolean)method `includeInstanceTypes`

```java
public QueryOptions includeInstanceTypes​(boolean includeInstanceTypes)
```

Explicitly sets the "include instance types" flag. If set, specifies if types should be included in instance structs returned in ConceptRow answers. This option allows reducing the amount of unnecessary data transmitted.

Input parameters   

Name

Description

Type

`includeInstanceTypes`

Whether to include instance types in ConceptRow answers.

`boolean`

Returns

`public QueryOptions`

Code examples

```java
options.includeInstanceTypes(includeInstanceTypes);
```

#### [](#_QueryOptions_includeQueryStructure_)method `includeQueryStructure`

```java
public java.util.Optional<java.lang.Boolean> includeQueryStructure()
```

Returns the value set for the "include query structure" flag in this `QueryOptions` object. If set, requests the server to return the structure of the query in the ConceptRow header.

Input parameters   

Name

Description

Type

`includeQueryStructure`

Whether to include query structure in ConceptRow header.

Returns

`public java.util.Optional<java.lang.Boolean>`

Code examples

```java
options.includeQueryStructure();
```

#### [](#_QueryOptions_includeQueryStructure_boolean)method `includeQueryStructure`

```java
public QueryOptions includeQueryStructure​(boolean includeQueryStructure)
```

Explicitly set the "include query structure" flag. If set, requests the server to return the structure of the query in the ConceptRow header.

Input parameters   

Name

Description

Type

`includeQueryStructure`

Whether to include query structure in ConceptRow header.

`boolean`

Returns

`public QueryOptions`

Code examples

```java
options.includeQueryStructure(true);
```

#### [](#_QueryOptions_prefetchSize_)method `prefetchSize`

```java
@CheckReturnValue
public java.util.Optional<java.lang.Integer> prefetchSize()
```

Returns the value set for the prefetch size in this `QueryOptions` object. If set, specifies the number of extra query responses sent before the client side has to re-request more responses. Increasing this may increase performance for queries with a huge number of answers, as it can reduce the number of network round-trips at the cost of more resources on the server side.

Returns

`public java.util.Optional<java.lang.Integer>`

Code examples

```java
options.prefetchSize();
```

#### [](#_QueryOptions_prefetchSize_int)method `prefetchSize`

```java
public QueryOptions prefetchSize​(int prefetchSize)
```

Explicitly sets the prefetch size. If set, specifies the number of extra query responses sent before the client side has to re-request more responses. Increasing this may increase performance for queries with a huge number of answers, as it can reduce the number of network round-trips at the cost of more resources on the server side. Minimal value: 1.

Input parameters   

Name

Description

Type

`prefetchSize`

Whether to include instance types in ConceptRow answers.

`int`

Returns

`public QueryOptions`

Code examples

```java
options.prefetchSize(prefetchSize);
```

## [](#_answer_header)Answer

### [](#_QueryAnswer)QueryAnswer

`class`

**Package**: `com.typedb.driver.api.answer`

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

#### [](#_QueryAnswer_asConceptDocuments_)method `asConceptDocuments`

```java
default ConceptDocumentIterator asConceptDocuments()
```

Casts the query answer to `ConceptDocumentIterator`.

Returns

`ConceptDocumentIterator`

Code examples

```java
concept.asConceptDocuments();
```

#### [](#_QueryAnswer_asConceptRows_)method `asConceptRows`

```java
default ConceptRowIterator asConceptRows()
```

Casts the query answer to `ConceptRowIterator`.

Returns

`ConceptRowIterator`

Code examples

```java
concept.asConceptRows();
```

#### [](#_QueryAnswer_asOk_)method `asOk`

```java
default OkQueryAnswer asOk()
```

Casts the query answer to `OkQueryAnswer`.

Returns

`OkQueryAnswer`

Code examples

```java
concept.asOk();
```

#### [](#_QueryAnswer_getQueryType_)method `getQueryType`

```java
@CheckReturnValue
QueryType getQueryType()
```

Retrieves the executed query’s type of this `QueryAnswer`.

Returns

`QueryType`

Code examples

```java
queryAnswer.getQueryType();
```

#### [](#_QueryAnswer_isConceptDocuments_)method `isConceptDocuments`

```java
@CheckReturnValue
default boolean isConceptDocuments()
```

Checks if the query answer is a `ConceptDocumentIterator`.

Returns

`boolean`

Code examples

```java
concept.isConceptDocuments();
```

#### [](#_QueryAnswer_isConceptRows_)method `isConceptRows`

```java
@CheckReturnValue
default boolean isConceptRows()
```

Checks if the query answer is a `ConceptRowIterator`.

Returns

`boolean`

Code examples

```java
concept.isConceptRows();
```

#### [](#_QueryAnswer_isOk_)method `isOk`

```java
@CheckReturnValue
default boolean isOk()
```

Checks if the query answer is an `Ok`.

Returns

`boolean`

Code examples

```java
concept.isOk();
```

### [](#_OkQueryAnswer)OkQueryAnswer

`class`

**Package**: `com.typedb.driver.api.answer`

**Superinterfaces:**

*   `QueryAnswer`
    

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

#### [](#_OkQueryAnswer_asConceptDocuments_)method `asConceptDocuments`

```java
default ConceptDocumentIterator asConceptDocuments()
```

Casts the query answer to `ConceptDocumentIterator`.

Returns

`ConceptDocumentIterator`

Code examples

```java
concept.asConceptDocuments();
```

#### [](#_OkQueryAnswer_asConceptRows_)method `asConceptRows`

```java
default ConceptRowIterator asConceptRows()
```

Casts the query answer to `ConceptRowIterator`.

Returns

`ConceptRowIterator`

Code examples

```java
concept.asConceptRows();
```

#### [](#_OkQueryAnswer_asOk_)method `asOk`

```java
@CheckReturnValue
default OkQueryAnswer asOk()
```

Casts the query answer to `OkQueryAnswer`.

Returns

`OkQueryAnswer`

Code examples

```java
concept.asOk();
```

#### [](#_OkQueryAnswer_getQueryType_)method `getQueryType`

```java
@CheckReturnValue
QueryType getQueryType()
```

Retrieves the executed query’s type of this `QueryAnswer`.

Returns

`QueryType`

Code examples

```java
queryAnswer.getQueryType();
```

#### [](#_OkQueryAnswer_isConceptDocuments_)method `isConceptDocuments`

```java
@CheckReturnValue
default boolean isConceptDocuments()
```

Checks if the query answer is a `ConceptDocumentIterator`.

Returns

`boolean`

Code examples

```java
concept.isConceptDocuments();
```

#### [](#_OkQueryAnswer_isConceptRows_)method `isConceptRows`

```java
@CheckReturnValue
default boolean isConceptRows()
```

Checks if the query answer is a `ConceptRowIterator`.

Returns

`boolean`

Code examples

```java
concept.isConceptRows();
```

#### [](#_OkQueryAnswer_isOk_)method `isOk`

```java
default boolean isOk()
```

Checks if the query answer is an `Ok`.

Returns

`boolean`

Code examples

```java
concept.isOk();
```

### [](#_ConceptRowIterator)ConceptRowIterator

`class`

**Package**: `com.typedb.driver.api.answer`

**Superinterfaces:**

*   `java.util.Iterator<ConceptRow>`
    
*   `QueryAnswer`
    

Represents an iterator over `ConceptRow`s returned as a server answer.

#### [](#_ConceptRowIterator_asConceptRows_)method `asConceptRows`

```java
@CheckReturnValue
default ConceptRowIterator asConceptRows()
```

Casts the query answer to `ConceptRowIterator`.

Returns

`ConceptRowIterator`

Code examples

```java
concept.asConceptRows();
```

#### [](#_ConceptRowIterator_isConceptRows_)method `isConceptRows`

```java
default boolean isConceptRows()
```

Checks if the query answer is a `ConceptRowIterator`.

Returns

`boolean`

Code examples

```java
concept.isConceptRows();
```

#### [](#_ConceptRowIterator_stream_)method `stream`

```java
@CheckReturnValue
java.util.stream.Stream<ConceptRow> stream()
```

Creates a stream over `ConceptRow`s based on this iterator.

Returns

`java.util.stream.Stream<ConceptRow>`

Code examples

```java
answer.asConceptRows().stream();
```

### [](#_ConceptRow)ConceptRow

`class`

**Package**: `com.typedb.driver.api.answer`

Contains a row of concepts with a header.

#### [](#_ConceptRow_columnNames_)method `columnNames`

```java
@CheckReturnValue
java.util.stream.Stream<java.lang.String> columnNames()
```

Produces a stream over all column names (variables) in the header of this `ConceptRow`. Shared between all the rows in a QueryAnswer.

Returns

`java.util.stream.Stream<java.lang.String>`

Code examples

```java
conceptRow.columnNames();
```

#### [](#_ConceptRow_concepts_)method `concepts`

```java
@CheckReturnValue
java.util.stream.Stream<? extends Concept> concepts()
```

Produces a stream over all concepts in this `ConceptRow`, skipping empty results.

Returns

`java.util.stream.Stream<? extends Concept>`

Code examples

```java
conceptRow.concepts();
```

#### [](#_ConceptRow_get_java_lang_String)method `get`

```java
@CheckReturnValue
java.util.Optional<Concept> get​(java.lang.String columnName)
                         throws TypeDBDriverException
```

Retrieves a concept for a given column name (variable). Returns an empty `Optional` 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 `column_names`)

`java.lang.String`

Returns

`java.util.Optional<Concept>`

Code examples

```java
conceptRow.get(columnName);
```

#### [](#_ConceptRow_getIndex_long)method `getIndex`

```java
@CheckReturnValue
java.util.Optional<Concept> getIndex​(long columnIndex)
                              throws TypeDBDriverException
```

Retrieves a concept for a given index of the header (`columnNames`). Returns an empty `Optional` 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

`java.util.Optional<Concept>`

Code examples

```java
conceptRow.getIndex(columnIndex);
```

#### [](#_ConceptRow_getQueryStructure_)method `getQueryStructure`

```java
java.util.Optional<Pipeline> getQueryStructure()
```

Retrieve the executed query’s structure from the `ConceptRow`'s header, if set. It must be requested via "include query structure" in `QueryOptions` Shared between all the rows in a QueryAnswer.

Returns

`java.util.Optional<Pipeline>`

Code examples

```java
conceptRow.getQueryStructure();
```

#### [](#_ConceptRow_getQueryType_)method `getQueryType`

```java
@CheckReturnValue
QueryType getQueryType()
```

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

Returns

`QueryType`

Code examples

```java
conceptRow.getQueryType();
```

#### [](#_ConceptRow_involvedConjunctions_)method `involvedConjunctions`

```java
java.util.Optional<java.util.stream.Stream<? extends ConjunctionID>> involvedConjunctions()
```

Retrieve the `ConjunctionID`s of `Conjunction`s that answered this row.

Returns

`java.util.Optional<java.util.stream.Stream<? extends ConjunctionID>>`

### [](#_ConceptDocumentIterator)ConceptDocumentIterator

`class`

**Package**: `com.typedb.driver.api.answer`

**Superinterfaces:**

*   `java.util.Iterator<JSON>`
    
*   `QueryAnswer`
    

Represents an iterator over concept documents (represented as `JSON`s) returned as a server answer.

#### [](#_ConceptDocumentIterator_asConceptDocuments_)method `asConceptDocuments`

```java
@CheckReturnValue
default ConceptDocumentIterator asConceptDocuments()
```

Casts the query answer to `ConceptDocumentIterator`.

Returns

`ConceptDocumentIterator`

Code examples

```java
concept.asConceptDocuments();
```

#### [](#_ConceptDocumentIterator_isConceptDocuments_)method `isConceptDocuments`

```java
default boolean isConceptDocuments()
```

Checks if the query answer is a `ConceptDocumentIterator`.

Returns

`boolean`

Code examples

```java
concept.isConceptDocuments();
```

#### [](#_ConceptDocumentIterator_stream_)method `stream`

```java
@CheckReturnValue
java.util.stream.Stream<JSON> stream()
```

Returns

`java.util.stream.Stream<JSON>`

### [](#_JSON)JSON

`class`

**Package**: `com.typedb.driver.api.answer`

#### [](#_JSON_JSON_)method `JSON`

```java
public JSON()
```

Returns

`public`

#### [](#_JSON_asArray_)method `asArray`

```java
public java.util.List<JSON> asArray()
```

Returns

`public java.util.List<JSON>`

#### [](#_JSON_asBoolean_)method `asBoolean`

```java
public boolean asBoolean()
```

Returns

`public boolean`

#### [](#_JSON_asNumber_)method `asNumber`

```java
public double asNumber()
```

Returns

`public double`

#### [](#_JSON_asObject_)method `asObject`

```java
public java.util.Map<java.lang.String,​JSON> asObject()
```

Returns

`public java.util.Map<java.lang.String,​JSON>`

#### [](#_JSON_asString_)method `asString`

```java
public java.lang.String asString()
```

Returns

`public java.lang.String`

#### [](#_JSON_isArray_)method `isArray`

```java
public boolean isArray()
```

Returns

`public boolean`

#### [](#_JSON_isBoolean_)method `isBoolean`

```java
public boolean isBoolean()
```

Returns

`public boolean`

#### [](#_JSON_isNumber_)method `isNumber`

```java
public boolean isNumber()
```

Returns

`public boolean`

#### [](#_JSON_isObject_)method `isObject`

```java
public boolean isObject()
```

Returns

`public boolean`

#### [](#_JSON_isString_)method `isString`

```java
public boolean isString()
```

Returns

`public boolean`

#### [](#_JSON_parse_java_lang_String)method `parse`

```java
public static JSON parse​(java.lang.String string)
```

Returns

`public static JSON`

### [](#_QueryType)QueryType

`class`

**Package**: `com.typedb.driver.api`

Used to specify the type of the executed query.

Examples

```java
conceptRow.queryType();
```

Enum constants 

Name

`READ`

`SCHEMA`

`WRITE`

#### [](#_QueryType_id_)method `id`

```java
public int id()
```

Returns

`public int`

#### [](#_QueryType_isRead_)method `isRead`

```java
public boolean isRead()
```

Returns

`public boolean`

#### [](#_QueryType_isSchema_)method `isSchema`

```java
public boolean isSchema()
```

Returns

`public boolean`

#### [](#_QueryType_isWrite_)method `isWrite`

```java
public boolean isWrite()
```

Returns

`public boolean`

#### [](#_QueryType_of_com_typedb_driver_jni_QueryType)method `of`

```java
public static QueryType of​(com.typedb.driver.jni.QueryType nativeType)
```

Returns

`public static QueryType`

#### [](#_QueryType_valueOf_java_lang_String)method `valueOf`

```java
public static QueryType valueOf​(java.lang.String name)
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Input parameters   

Name

Description

Type

`name`

the name of the enum constant to be returned.

`java.lang.String`

Returns

`public static QueryType`

#### [](#_QueryType_values_)method `values`

```java
public static QueryType[] values()
```

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

```java
for (QueryType c : QueryType.values())
    System.out.println(c);
```

Returns

`public static QueryType[]`

Code examples

```java
for (QueryType c : QueryType.values())
    System.out.println(c);
```

### [](#_Promise_T)Promise<T>

`class`

**Package**: `com.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.

#### [](#_Promise_T_Promise_java_util_function_Supplier_T_)method `Promise`

```java
public Promise​(java.util.function.Supplier<T> inner)
```

Promise constructor

Input parameters   

Name

Description

Type

`inner`

The supplier to function to wrap into the promise

`java.util.function.Supplier<T>`

Returns

`public`

Code examples

```java
new Promise(supplier)
```

#### [](#_Promise_T_map_java_util_function_Supplier_T_java_util_function_Function_T_​U_)method `map`

```java
public static <T,​U> Promise<U> map​(java.util.function.Supplier<T> promise,
                                         java.util.function.Function<T,​U> fn)
```

Helper function to map promises.

Input parameters   

Name

Description

Type

`promise`

The supplier function to wrap into the promise

`java.util.function.Supplier<T>`

`fn`

The mapping function

`java.util.function.Function<T,​U>`

Returns

`public static <T,​U> Promise<U>`

Code examples

```java
Promise.map(supplier, mapper);
```

#### [](#_Promise_T_resolve_)method `resolve`

```java
public T resolve()
```

Retrieves the result of the Promise.

Returns

`public T`

Code examples

```java
promise.resolve()
```

## [](#_concept_header)Concept

### [](#_Concept)Concept

`class`

**Package**: `com.typedb.driver.api.concept`

Fields   

Name

Type

Description

`DECIMAL_SCALE`

`static int`

#### [](#_Concept_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Concept_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Concept_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_Concept_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Concept_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_Concept_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_Concept_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Concept_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Concept_asType_)method `asType`

```java
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Concept_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Concept_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Concept_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Concept_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Concept_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Concept_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Concept_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Concept_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Concept_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Concept_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Concept_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Concept_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_Concept_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Concept_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_Concept_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Concept_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_Concept_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Concept_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Concept_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Concept_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Concept_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Concept_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Concept_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Concept_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Concept_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Concept_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Concept_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Concept_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Concept_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Concept_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Concept_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Concept_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Concept_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Concept_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Concept_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Concept_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

## [](#_schema_header)Schema

### [](#_Type)Type

`class`

**Package**: `com.typedb.driver.api.concept.type`

**Superinterfaces:**

*   `Concept`
    

#### [](#_Type_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Type_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Type_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_Type_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Type_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_Type_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_Type_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Type_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Type_asType_)method `asType`

```java
@CheckReturnValue
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Type_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Type_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Type_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Type_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Type_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Type_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Type_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Type_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Type_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Type_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Type_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Type_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_Type_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Type_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_Type_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Type_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_Type_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Type_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Type_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Type_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Type_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Type_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Type_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Type_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Type_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Type_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Type_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Type_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Type_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Type_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Type_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Type_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Type_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Type_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Type_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Type_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_EntityType)EntityType

`class`

**Package**: `com.typedb.driver.api.concept.type`

**Superinterfaces:**

*   `Concept`
    
*   `Type`
    

Entity types represent the classification of independent objects in the data model of the business domain.

#### [](#_EntityType_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_EntityType_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_EntityType_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_EntityType_asEntityType_)method `asEntityType`

```java
@CheckReturnValue
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_EntityType_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_EntityType_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_EntityType_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_EntityType_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_EntityType_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_EntityType_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_EntityType_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_EntityType_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_EntityType_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_EntityType_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_EntityType_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_EntityType_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_EntityType_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_EntityType_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_EntityType_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_EntityType_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_EntityType_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_EntityType_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_EntityType_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_EntityType_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_EntityType_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_EntityType_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_EntityType_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_EntityType_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_EntityType_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_EntityType_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_EntityType_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_EntityType_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_EntityType_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_EntityType_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_EntityType_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_EntityType_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_EntityType_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_EntityType_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_EntityType_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_EntityType_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_EntityType_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_EntityType_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_EntityType_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_RelationType)RelationType

`class`

**Package**: `com.typedb.driver.api.concept.type`

**Superinterfaces:**

*   `Concept`
    
*   `Type`
    

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.

#### [](#_RelationType_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_RelationType_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_RelationType_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_RelationType_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_RelationType_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_RelationType_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_RelationType_asRelationType_)method `asRelationType`

```java
@CheckReturnValue
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_RelationType_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_RelationType_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_RelationType_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_RelationType_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_RelationType_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_RelationType_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_RelationType_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_RelationType_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_RelationType_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_RelationType_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_RelationType_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_RelationType_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_RelationType_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_RelationType_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_RelationType_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_RelationType_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_RelationType_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_RelationType_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_RelationType_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_RelationType_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_RelationType_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_RelationType_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_RelationType_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_RelationType_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_RelationType_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_RelationType_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_RelationType_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_RelationType_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_RelationType_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_RelationType_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_RelationType_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_RelationType_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_RelationType_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_RelationType_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_RelationType_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_RelationType_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_RoleType)RoleType

`class`

**Package**: `com.typedb.driver.api.concept.type`

**Superinterfaces:**

*   `Concept`
    
*   `Type`
    

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

#### [](#_RoleType_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_RoleType_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_RoleType_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_RoleType_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_RoleType_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_RoleType_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_RoleType_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_RoleType_asRoleType_)method `asRoleType`

```java
@CheckReturnValue
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_RoleType_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_RoleType_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_RoleType_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_RoleType_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_RoleType_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_RoleType_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_RoleType_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_RoleType_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_RoleType_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_RoleType_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_RoleType_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_RoleType_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_RoleType_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_RoleType_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_RoleType_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_RoleType_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_RoleType_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_RoleType_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_RoleType_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_RoleType_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_RoleType_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_RoleType_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_RoleType_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_RoleType_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_RoleType_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_RoleType_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_RoleType_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_RoleType_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_RoleType_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_RoleType_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_RoleType_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_RoleType_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_RoleType_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_RoleType_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_RoleType_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_AttributeType)AttributeType

`class`

**Package**: `com.typedb.driver.api.concept.type`

**Superinterfaces:**

*   `Concept`
    
*   `Type`
    

Attribute types represent properties that other types can own.

Attribute types have a value type. This value type is fixed and unique for every given instance of the attribute type.

Other types can own an attribute type. That means that instances of these other types can own an instance of this attribute type. This usually means that an object in our domain has a property with the matching value.

Multiple types can own the same attribute type, and different instances of the same type or different types can share ownership of the same attribute instance.

#### [](#_AttributeType_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_AttributeType_asAttributeType_)method `asAttributeType`

```java
@CheckReturnValue
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_AttributeType_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_AttributeType_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_AttributeType_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_AttributeType_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_AttributeType_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_AttributeType_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_AttributeType_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_AttributeType_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_AttributeType_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_AttributeType_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_AttributeType_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_AttributeType_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_AttributeType_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_AttributeType_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_AttributeType_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_AttributeType_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_AttributeType_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_AttributeType_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_AttributeType_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_AttributeType_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_AttributeType_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_AttributeType_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_AttributeType_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_AttributeType_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_AttributeType_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_AttributeType_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_AttributeType_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_AttributeType_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_AttributeType_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_AttributeType_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_AttributeType_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_AttributeType_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_AttributeType_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_AttributeType_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_AttributeType_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_AttributeType_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_AttributeType_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_AttributeType_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_AttributeType_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_AttributeType_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_AttributeType_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

## [](#_data_header)Data

### [](#_Instance)Instance

`class`

**Package**: `com.typedb.driver.api.concept.instance`

**Superinterfaces:**

*   `Concept`
    

#### [](#_Instance_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Instance_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Instance_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_Instance_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Instance_asInstance_)method `asInstance`

```java
@CheckReturnValue
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
instance.asInstance();
```

#### [](#_Instance_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_Instance_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Instance_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Instance_asType_)method `asType`

```java
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Instance_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Instance_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Instance_getType_)method `getType`

```java
@CheckReturnValue
Type getType()
```

Retrieves the type which this `Instance` belongs to.

Returns

`Type`

Code examples

```java
instance.getType();
```

#### [](#_Instance_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Instance_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Instance_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Instance_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Instance_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Instance_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Instance_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Instance_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Instance_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Instance_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_Instance_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Instance_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is a `Instance`.

Returns

`boolean`

Code examples

```java
instance.isInstance();
```

#### [](#_Instance_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Instance_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_Instance_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Instance_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Instance_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Instance_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Instance_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Instance_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Instance_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Instance_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Instance_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Instance_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Instance_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Instance_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Instance_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Instance_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Instance_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Instance_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Instance_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Instance_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Instance_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Instance_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_Entity)Entity

`class`

**Package**: `com.typedb.driver.api.concept.instance`

**Superinterfaces:**

*   `Concept`
    
*   `Instance`
    

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.

#### [](#_Entity_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Entity_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Entity_asEntity_)method `asEntity`

```java
@CheckReturnValue
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
entity.asEntity();
```

#### [](#_Entity_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Entity_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_Entity_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Entity_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Entity_asType_)method `asType`

```java
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Entity_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Entity_getIID_)method `getIID`

```java
@CheckReturnValue
java.lang.String getIID()
```

Retrieves the unique id of the `Entity`.

Returns

`java.lang.String`

Code examples

```java
entity.getIID();
```

#### [](#_Entity_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Entity_getType_)method `getType`

```java
@CheckReturnValue
EntityType getType()
```

Retrieves the type which this `Entity` belongs to.

Returns

`EntityType`

Code examples

```java
entity.getType();
```

#### [](#_Entity_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Entity_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Entity_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Entity_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Entity_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Entity_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Entity_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Entity_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Entity_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Entity_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
entity.isEntity();
```

#### [](#_Entity_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Entity_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Entity_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_Entity_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Entity_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Entity_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Entity_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Entity_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Entity_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Entity_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Entity_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Entity_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Entity_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Entity_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Entity_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Entity_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Entity_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Entity_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Entity_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Entity_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Entity_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Entity_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Entity_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_Relation)Relation

`class`

**Package**: `com.typedb.driver.api.concept.instance`

**Superinterfaces:**

*   `Concept`
    
*   `Instance`
    

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

#### [](#_Relation_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Relation_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Relation_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_Relation_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Relation_asRelation_)method `asRelation`

```java
@CheckReturnValue
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
relation.asRelation();
```

#### [](#_Relation_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Relation_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Relation_asType_)method `asType`

```java
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Relation_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Relation_getIID_)method `getIID`

```java
@CheckReturnValue
java.lang.String getIID()
```

Retrieves the unique id of the `Relation`.

Returns

`java.lang.String`

Code examples

```java
relation.getIID();
```

#### [](#_Relation_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Relation_getType_)method `getType`

```java
@CheckReturnValue
RelationType getType()
```

Retrieves the type which this `Relation` belongs to.

Returns

`RelationType`

Code examples

```java
relation.getType();
```

#### [](#_Relation_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Relation_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Relation_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Relation_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Relation_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Relation_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Relation_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Relation_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Relation_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Relation_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_Relation_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Relation_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Relation_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
relation.isRelation();
```

#### [](#_Relation_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Relation_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Relation_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Relation_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Relation_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Relation_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Relation_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Relation_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Relation_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Relation_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Relation_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Relation_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Relation_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Relation_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Relation_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Relation_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Relation_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Relation_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Relation_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Relation_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_Attribute)Attribute

`class`

**Package**: `com.typedb.driver.api.concept.instance`

**Superinterfaces:**

*   `Concept`
    
*   `Instance`
    

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.

#### [](#_Attribute_asAttribute_)method `asAttribute`

```java
@CheckReturnValue
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Attribute_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Attribute_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_Attribute_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Attribute_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_Attribute_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Attribute_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Attribute_asType_)method `asType`

```java
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Attribute_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Attribute_getBoolean_)method `getBoolean`

```java
boolean getBoolean()
```

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

Returns

`boolean`

Code examples

```java
attribute.getBoolean();
```

#### [](#_Attribute_getDate_)method `getDate`

```java
java.time.LocalDate getDate()
```

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

Returns

`java.time.LocalDate`

Code examples

```java
attribute.getDate();
```

#### [](#_Attribute_getDatetime_)method `getDatetime`

```java
java.time.LocalDateTime getDatetime()
```

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

Returns

`java.time.LocalDateTime`

Code examples

```java
attribute.getDatetime();
```

#### [](#_Attribute_getDatetimeTZ_)method `getDatetimeTZ`

```java
java.time.ZonedDateTime getDatetimeTZ()
```

Returns a `datetime-tz` value of the value concept that this attribute holds. If the value has another type, raises an exception.

Returns

`java.time.ZonedDateTime`

Code examples

```java
attribute.getDatetimeTZ();
```

#### [](#_Attribute_getDecimal_)method `getDecimal`

```java
java.math.BigDecimal getDecimal()
```

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

Returns

`java.math.BigDecimal`

Code examples

```java
attribute.getDecimal();
```

#### [](#_Attribute_getDouble_)method `getDouble`

```java
double getDouble()
```

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

Returns

`double`

Code examples

```java
attribute.getDouble();
```

#### [](#_Attribute_getDuration_)method `getDuration`

```java
Duration getDuration()
```

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

Returns

`Duration`

Code examples

```java
attribute.getDuration();
```

#### [](#_Attribute_getInteger_)method `getInteger`

```java
long getInteger()
```

Returns a `integer` value of the value concept that this attribute holds. If the value has another type, raises an exception.

Returns

`long`

Code examples

```java
attribute.getInteger();
```

#### [](#_Attribute_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Attribute_getString_)method `getString`

```java
java.lang.String getString()
```

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

Returns

`java.lang.String`

Code examples

```java
attribute.getString();
```

#### [](#_Attribute_getStruct_)method `getStruct`

```java
java.util.Map<java.lang.String,​java.util.Optional<Value>> getStruct()
```

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

Returns

`java.util.Map<java.lang.String,​java.util.Optional<Value>>`

Code examples

```java
attribute.getStruct();
```

#### [](#_Attribute_getType_)method `getType`

```java
@CheckReturnValue
AttributeType getType()
```

Retrieves the type which this `Attribute` belongs to.

Returns

`AttributeType`

Code examples

```java
attribute.getType();
```

#### [](#_Attribute_getValue_)method `getValue`

```java
@CheckReturnValue
Value getValue()
```

Retrieves the value which the `Attribute` instance holds.

Returns

`Value`

Code examples

```java
attribute.getValue();
```

#### [](#_Attribute_getValueType_)method `getValueType`

```java
@CheckReturnValue
java.lang.String getValueType()
```

Retrieves the description of the value type of the value which the `Attribute` instance holds.

Returns

`java.lang.String`

Code examples

```java
attribute.getValueType();
```

#### [](#_Attribute_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Attribute_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Attribute_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Attribute_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Attribute_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Attribute_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Attribute_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Attribute_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Attribute_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Attribute_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_Attribute_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Attribute_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Attribute_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_Attribute_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Attribute_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Attribute_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Attribute_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Attribute_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Attribute_isValue_)method `isValue`

```java
@CheckReturnValue
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Attribute_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Attribute_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Attribute_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Attribute_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Attribute_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Attribute_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Attribute_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Attribute_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Attribute_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Attribute_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Attribute_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Attribute_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Attribute_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Attribute_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

### [](#_Value)Value

`class`

**Package**: `com.typedb.driver.api.concept.value`

**Superinterfaces:**

*   `Concept`
    

#### [](#_Value_asAttribute_)method `asAttribute`

```java
default Attribute asAttribute()
```

Casts the concept to `Attribute`.

Returns

`Attribute`

Code examples

```java
concept.asAttribute();
```

#### [](#_Value_asAttributeType_)method `asAttributeType`

```java
default AttributeType asAttributeType()
```

Casts the concept to `AttributeType`.

Returns

`AttributeType`

Code examples

```java
concept.asAttributeType();
```

#### [](#_Value_asEntity_)method `asEntity`

```java
default Entity asEntity()
```

Casts the concept to `Entity`.

Returns

`Entity`

Code examples

```java
concept.asEntity();
```

#### [](#_Value_asEntityType_)method `asEntityType`

```java
default EntityType asEntityType()
```

Casts the concept to `EntityType`.

Returns

`EntityType`

Code examples

```java
concept.asEntityType();
```

#### [](#_Value_asInstance_)method `asInstance`

```java
default Instance asInstance()
```

Casts the concept to `Instance`.

Returns

`Instance`

Code examples

```java
concept.asInstance();
```

#### [](#_Value_asRelation_)method `asRelation`

```java
default Relation asRelation()
```

Casts the concept to `Relation`.

Returns

`Relation`

Code examples

```java
concept.asRelation();
```

#### [](#_Value_asRelationType_)method `asRelationType`

```java
default RelationType asRelationType()
```

Casts the concept to `RelationType`.

Returns

`RelationType`

Code examples

```java
concept.asRelationType();
```

#### [](#_Value_asRoleType_)method `asRoleType`

```java
default RoleType asRoleType()
```

Casts the concept to `RoleType`.

Returns

`RoleType`

Code examples

```java
concept.asRoleType();
```

#### [](#_Value_asType_)method `asType`

```java
default Type asType()
```

Casts the concept to `Type`.

Returns

`Type`

Code examples

```java
concept.asType();
```

#### [](#_Value_asValue_)method `asValue`

```java
default Value asValue()
```

Casts the concept to `Value`.

Returns

`Value`

Code examples

```java
concept.asValue();
```

#### [](#_Value_get_)method `get`

```java
java.lang.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

`java.lang.Object`

Code examples

```java
value.get();
```

#### [](#_Value_getBoolean_)method `getBoolean`

```java
boolean getBoolean()
```

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

Returns

`boolean`

Code examples

```java
value.getBoolean();
```

#### [](#_Value_getDate_)method `getDate`

```java
java.time.LocalDate getDate()
```

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

Returns

`java.time.LocalDate`

Code examples

```java
value.getDate();
```

#### [](#_Value_getDatetime_)method `getDatetime`

```java
java.time.LocalDateTime getDatetime()
```

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

Returns

`java.time.LocalDateTime`

Code examples

```java
value.getDatetime();
```

#### [](#_Value_getDatetimeTZ_)method `getDatetimeTZ`

```java
java.time.ZonedDateTime getDatetimeTZ()
```

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

Returns

`java.time.ZonedDateTime`

Code examples

```java
value.getDatetimeTZ();
```

#### [](#_Value_getDecimal_)method `getDecimal`

```java
java.math.BigDecimal getDecimal()
```

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

Returns

`java.math.BigDecimal`

Code examples

```java
value.getDecimal();
```

#### [](#_Value_getDouble_)method `getDouble`

```java
double getDouble()
```

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

Returns

`double`

Code examples

```java
value.getDouble();
```

#### [](#_Value_getDuration_)method `getDuration`

```java
Duration getDuration()
```

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

Returns

`Duration`

Code examples

```java
value.getDuration();
```

#### [](#_Value_getInteger_)method `getInteger`

```java
long getInteger()
```

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

Returns

`long`

Code examples

```java
value.getInteger();
```

#### [](#_Value_getLabel_)method `getLabel`

```java
@CheckReturnValue
java.lang.String getLabel()
```

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

Returns

`java.lang.String`

Code examples

```java
concept.getLabel();
```

#### [](#_Value_getString_)method `getString`

```java
java.lang.String getString()
```

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

Returns

`java.lang.String`

Code examples

```java
value.getString();
```

#### [](#_Value_getStruct_)method `getStruct`

```java
java.util.Map<java.lang.String,​java.util.Optional<Value>> getStruct()
```

Returns the value of this value concept as a `Map<String, Optional<Value>>` representing a struct with field names mapped to values. If the value has another type, raises an exception.

Returns

`java.util.Map<java.lang.String,​java.util.Optional<Value>>`

Code examples

```java
value.getStruct();
```

#### [](#_Value_getType_)method `getType`

```java
java.lang.String getType()
```

Retrieves the `String` describing the value type of this `Value` concept.

Returns

`java.lang.String`

Code examples

```java
value.getType()
```

#### [](#_Value_isAttribute_)method `isAttribute`

```java
@CheckReturnValue
default boolean isAttribute()
```

Checks if the concept is an `Attribute`.

Returns

`boolean`

Code examples

```java
concept.isAttribute();
```

#### [](#_Value_isAttributeType_)method `isAttributeType`

```java
@CheckReturnValue
default boolean isAttributeType()
```

Checks if the concept is an `AttributeType`.

Returns

`boolean`

Code examples

```java
concept.isAttributeType();
```

#### [](#_Value_isBoolean_)method `isBoolean`

```java
@CheckReturnValue
boolean isBoolean()
```

Returns `true` if the value which this `Concept` holds is of type `boolean` or if this `Concept` is an `AttributeType` of type `boolean`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isBoolean()
```

#### [](#_Value_isDate_)method `isDate`

```java
@CheckReturnValue
boolean isDate()
```

Returns `true` if the value which this `Concept` holds is of type `date` or if this `Concept` is an `AttributeType` of type `date`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDate();
```

#### [](#_Value_isDatetime_)method `isDatetime`

```java
@CheckReturnValue
boolean isDatetime()
```

Returns `true` if the value which this `Concept` holds is of type `datetime` or if this `Concept` is an `AttributeType` of type `datetime`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetime();
```

#### [](#_Value_isDatetimeTZ_)method `isDatetimeTZ`

```java
@CheckReturnValue
boolean 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`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDatetimeTZ();
```

#### [](#_Value_isDecimal_)method `isDecimal`

```java
@CheckReturnValue
boolean isDecimal()
```

Returns `true` if the value which this `Concept` holds is of type `decimal` or if this `Concept` is an `AttributeType` of type `decimal`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDecimal();
```

#### [](#_Value_isDouble_)method `isDouble`

```java
@CheckReturnValue
boolean isDouble()
```

Returns `true` if the value which this `Concept` holds is of type `double` or if this `Concept` is an `AttributeType` of type `double`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDouble();
```

#### [](#_Value_isDuration_)method `isDuration`

```java
@CheckReturnValue
boolean isDuration()
```

Returns `true` if the value which this `Concept` holds is of type `duration` or if this `Concept` is an `AttributeType` of type `duration`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isDuration();
```

#### [](#_Value_isEntity_)method `isEntity`

```java
@CheckReturnValue
default boolean isEntity()
```

Checks if the concept is an `Entity`.

Returns

`boolean`

Code examples

```java
concept.isEntity();
```

#### [](#_Value_isEntityType_)method `isEntityType`

```java
@CheckReturnValue
default boolean isEntityType()
```

Checks if the concept is an `EntityType`.

Returns

`boolean`

Code examples

```java
concept.isEntityType();
```

#### [](#_Value_isInstance_)method `isInstance`

```java
@CheckReturnValue
default boolean isInstance()
```

Checks if the concept is an `Instance`.

Returns

`boolean`

Code examples

```java
concept.isInstance();
```

#### [](#_Value_isInteger_)method `isInteger`

```java
@CheckReturnValue
boolean isInteger()
```

Returns `true` if the value which this `Concept` holds is of type `integer` or if this `Concept` is an `AttributeType` of type `integer`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isInteger();
```

#### [](#_Value_isRelation_)method `isRelation`

```java
@CheckReturnValue
default boolean isRelation()
```

Checks if the concept is a `Relation`.

Returns

`boolean`

Code examples

```java
concept.isRelation();
```

#### [](#_Value_isRelationType_)method `isRelationType`

```java
@CheckReturnValue
default boolean isRelationType()
```

Checks if the concept is a `RelationType`.

Returns

`boolean`

Code examples

```java
concept.isRelationType();
```

#### [](#_Value_isRoleType_)method `isRoleType`

```java
@CheckReturnValue
default boolean isRoleType()
```

Checks if the concept is a `RoleType`.

Returns

`boolean`

Code examples

```java
concept.isRoleType();
```

#### [](#_Value_isString_)method `isString`

```java
@CheckReturnValue
boolean isString()
```

Returns `true` if the value which this `Concept` holds is of type `string` or if this `Concept` is an `AttributeType` of type `string`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isString();
```

#### [](#_Value_isStruct_)method `isStruct`

```java
@CheckReturnValue
boolean isStruct()
```

Returns `true` if the value which this `Concept` holds is of type `struct` or if this `Concept` is an `AttributeType` of type `struct`. Otherwise, returns `false`.

Returns

`boolean`

Code examples

```java
concept.isStruct();
```

#### [](#_Value_isType_)method `isType`

```java
@CheckReturnValue
default boolean isType()
```

Checks if the concept is a `Type`.

Returns

`boolean`

Code examples

```java
concept.isType();
```

#### [](#_Value_isValue_)method `isValue`

```java
default boolean isValue()
```

Checks if the concept is a `Value`.

Returns

`boolean`

Code examples

```java
concept.isValue();
```

#### [](#_Value_tryGetBoolean_)method `tryGetBoolean`

```java
java.util.Optional<java.lang.Boolean> tryGetBoolean()
```

Returns the value of this `Concept` as an `Optional<Boolean>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Boolean>`

Code examples

```java
concept.tryGetBoolean();
```

#### [](#_Value_tryGetDate_)method `tryGetDate`

```java
java.util.Optional<java.time.LocalDate> tryGetDate()
```

Returns the value of this `Concept` as an `Optional<LocalDate>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDate>`

Code examples

```java
concept.tryGetDate();
```

#### [](#_Value_tryGetDatetime_)method `tryGetDatetime`

```java
java.util.Optional<java.time.LocalDateTime> tryGetDatetime()
```

Returns the value of this `Concept` as an `Optional<LocalDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.LocalDateTime>`

Code examples

```java
concept.tryGetDatetime();
```

#### [](#_Value_tryGetDatetimeTZ_)method `tryGetDatetimeTZ`

```java
java.util.Optional<java.time.ZonedDateTime> tryGetDatetimeTZ()
```

Returns the value of this `Concept` as an `Optional<ZonedDateTime>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.time.ZonedDateTime>`

Code examples

```java
concept.tryGetDatetimeTZ();
```

#### [](#_Value_tryGetDecimal_)method `tryGetDecimal`

```java
java.util.Optional<java.math.BigDecimal> tryGetDecimal()
```

Returns the value of this `Concept` as an `Optional<BigDecimal>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.math.BigDecimal>`

Code examples

```java
concept.tryGetDecimal();
```

#### [](#_Value_tryGetDouble_)method `tryGetDouble`

```java
java.util.Optional<java.lang.Double> tryGetDouble()
```

Returns the value of this `Concept` as an `Optional<Double>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Double>`

Code examples

```java
concept.tryGetDouble();
```

#### [](#_Value_tryGetDuration_)method `tryGetDuration`

```java
java.util.Optional<Duration> tryGetDuration()
```

Returns the value of this `Concept` as an `Optional<Duration>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<Duration>`

Code examples

```java
concept.tryGetDuration();
```

#### [](#_Value_tryGetIID_)method `tryGetIID`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetIID()
```

Retrieves the unique id of the `Concept`. Returns `null` if absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetIID();
```

#### [](#_Value_tryGetInteger_)method `tryGetInteger`

```java
java.util.Optional<java.lang.Long> tryGetInteger()
```

Returns the value of this `Concept` as an `Optional<Long>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.Long>`

Code examples

```java
concept.tryGetInteger();
```

#### [](#_Value_tryGetLabel_)method `tryGetLabel`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetLabel()
```

Retrieves the unique label of the concept. If this is an `Instance`, return the label of the type of this instance (`null` if type fetching is disabled). Returns `null` if type fetching is disabled. If this is a `Value`, return the label of the value type of the value. If this is a `Type`, return the label of the type.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetLabel();
```

#### [](#_Value_tryGetString_)method `tryGetString`

```java
java.util.Optional<java.lang.String> tryGetString()
```

Returns the value of this `Concept` as an `Optional<String>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetString();
```

#### [](#_Value_tryGetStruct_)method `tryGetStruct`

```java
java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>> tryGetStruct()
```

Returns the value of this `Concept` as an `Optional<Map<String, Optional<Value>>>`. If it’s not a `Value` or it has another type, returns `null`.

Returns

`java.util.Optional<java.util.Map<java.lang.String,​java.util.Optional<Value>>>`

Code examples

```java
concept.tryGetStruct();
```

#### [](#_Value_tryGetValue_)method `tryGetValue`

```java
@CheckReturnValue
java.util.Optional<Value> tryGetValue()
```

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

Returns

`java.util.Optional<Value>`

Code examples

```java
concept.tryGetValue();
```

#### [](#_Value_tryGetValueType_)method `tryGetValueType`

```java
@CheckReturnValue
java.util.Optional<java.lang.String> tryGetValueType()
```

Retrieves the `String` describing the value type of this `Concept`. Returns `null` if not absent.

Returns

`java.util.Optional<java.lang.String>`

Code examples

```java
concept.tryGetValueType();
```

## [](#_value_header)Value

### [](#_Duration)Duration

`class`

**Package**: `com.typedb.driver.common`

#### [](#_Duration_equals_java_lang_Object)method `equals`

```java
public boolean equals​(java.lang.Object obj)
```

Checks if this Duration is equal to another object.

Input parameters   

Name

Description

Type

`obj`

Object to compare with

`java.lang.Object`

Returns

`public boolean`

Code examples

```java
label.equals(obj);
```

#### [](#_Duration_getDatePart_)method `getDatePart`

```java
public java.time.Period getDatePart()
```

Returns the date part of this duration.

Returns

`public java.time.Period`

Code examples

```java
duration.getDatePart();
```

#### [](#_Duration_getDays_)method `getDays`

```java
public int getDays()
```

Returns the amount of days of this `Duration` from the date part.

Returns

`public int`

Code examples

```java
duration.getMonths();
```

#### [](#_Duration_getMonths_)method `getMonths`

```java
public int getMonths()
```

Returns the amount of months of this `Duration` from the date part.

Returns

`public int`

Code examples

```java
duration.getMonths();
```

#### [](#_Duration_getNano_)method `getNano`

```java
public long getNano()
```

Returns the number of nanoseconds within the second in this `Duration` from the time part.

Returns

`public long`

Code examples

```java
duration.getNano();
```

#### [](#_Duration_getSeconds_)method `getSeconds`

```java
public long getSeconds()
```

Returns the amount of seconds of this `Duration` from the time part.

Returns

`public long`

Code examples

```java
duration.getSeconds();
```

#### [](#_Duration_getTimePart_)method `getTimePart`

```java
public java.time.Duration getTimePart()
```

Returns the time part of this duration.

Returns

`public java.time.Duration`

Code examples

```java
duration.getTimePart();
```

#### [](#_Duration_parse_java_lang_String)method `parse`

```java
public static Duration parse​(java.lang.String durationString)
```

Parses a `Duration` object from a string in ISO 8601 format. Throws java.time exceptions

Input parameters   

Name

Description

Type

`durationString`

A string representation of the duration. Expected format: PnYnMnDTnHnMnS or PnW.

`java.lang.String`

Returns

`public static Duration`

Code examples

```java
Duration.parse("P1Y10M7DT15H44M5.00394892S");
     Duration.parse("P55W");
```

#### [](#_Duration_toString_)method `toString`

```java
public java.lang.String toString()
```

Returns the string representation of the duration.

Returns

`public java.lang.String`

Code examples

```java
duration.toString();
```

## [](#_analyze_header)Analyze

### [](#_AnalyzedQuery)AnalyzedQuery

`class`

**Package**: `com.typedb.driver.api.analyze`

#### [](#_AnalyzedQuery_fetch_)method `fetch`

```java
java.util.Optional<? extends Fetch> fetch()
```

A representation of the `Fetch` stage of the query, if it has one

Returns

`java.util.Optional<? extends Fetch>`

#### [](#_AnalyzedQuery_given_)method `given`

```java
java.util.Optional<? extends Given> given()
```

A representation of the `Given` stage of the query, if it has one

Returns

`java.util.Optional<? extends Given>`

#### [](#_AnalyzedQuery_pipeline_)method `pipeline`

```java
Pipeline pipeline()
```

A representation of the query as a `Pipeline`

Returns

`Pipeline`

#### [](#_AnalyzedQuery_preamble_)method `preamble`

```java
java.util.stream.Stream<? extends Function> preamble()
```

A representation of the `Function`s in the preamble of the query

Returns

`java.util.stream.Stream<? extends Function>`

### [](#_Conjunction)Conjunction

`class`

**Package**: `com.typedb.driver.api.analyze`

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

#### [](#_Conjunction_annotated_variables_)method `annotated_variables`

```java
java.util.stream.Stream<? extends Variable> annotated_variables()
```

The variables that have annotations in this conjunction.

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_Conjunction_constraints_)method `constraints`

```java
java.util.stream.Stream<? extends Constraint> constraints()
```

The `Constraint`s in the conjunction.

Returns

`java.util.stream.Stream<? extends Constraint>`

#### [](#_Conjunction_variable_annotations_Variable)method `variable_annotations`

```java
VariableAnnotations variable_annotations​(Variable variable)
```

Gets the annotations for a specific variable in this conjunction.

Input parameters   

Name

Description

Type

`variable`

the variable to get annotations for

`Variable`

Returns

`VariableAnnotations`

### [](#_Constraint)Constraint

`class`

**Package**: `com.typedb.driver.api.analyze`

A representation of a TypeQL constraint.

#### [](#_Constraint_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Comparison)Constraint.Comparison

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a comparison:

e.g., \`$x &lt; 5\`

#### [](#_Constraint_Comparison_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Comparison_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Comparison_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Comparison_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Comparison_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Comparison_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Comparison_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Comparison_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Comparison_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Comparison_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Comparison_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Comparison_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Comparison_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Comparison_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Comparison_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Comparison_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Comparison_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Comparison_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Comparison_comparator_)method `comparator`

```java
com.typedb.driver.jni.Comparator comparator()
```

Returns

`com.typedb.driver.jni.Comparator`

#### [](#_Constraint_Comparison_comparatorSymbol_)method `comparatorSymbol`

```java
java.lang.String comparatorSymbol()
```

Returns

`java.lang.String`

#### [](#_Constraint_Comparison_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Comparison_lhs_)method `lhs`

```java
ConstraintVertex lhs()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Comparison_rhs_)method `rhs`

```java
ConstraintVertex rhs()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Comparison_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Comparison_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Expression)Constraint.Expression

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents an expression: let =

e.g., let $x = $y + 5; Here, arguments will be \`\[$y\]\`

#### [](#_Constraint_Expression_arguments_)method `arguments`

```java
java.util.stream.Stream<? extends ConstraintVertex> arguments()
```

Returns

`java.util.stream.Stream<? extends ConstraintVertex>`

#### [](#_Constraint_Expression_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Expression_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Expression_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Expression_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Expression_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Expression_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Expression_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Expression_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Expression_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Expression_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Expression_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Expression_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Expression_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Expression_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Expression_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Expression_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Expression_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Expression_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Expression_assigned_)method `assigned`

```java
ConstraintVertex assigned()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Expression_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Expression_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Expression_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Expression_text_)method `text`

```java
java.lang.String text()
```

Returns

`java.lang.String`

#### [](#_Constraint_Expression_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_FunctionCall)Constraint.FunctionCall

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a function call: let = name(

) e.g., let $x, $y = my\_function($a, $b);

#### [](#_Constraint_FunctionCall_arguments_)method `arguments`

```java
java.util.stream.Stream<? extends ConstraintVertex> arguments()
```

Returns

`java.util.stream.Stream<? extends ConstraintVertex>`

#### [](#_Constraint_FunctionCall_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_FunctionCall_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_FunctionCall_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_FunctionCall_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_FunctionCall_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_FunctionCall_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_FunctionCall_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_FunctionCall_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_FunctionCall_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_FunctionCall_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_FunctionCall_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_FunctionCall_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_FunctionCall_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_FunctionCall_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_FunctionCall_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_FunctionCall_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_FunctionCall_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_FunctionCall_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_FunctionCall_assigned_)method `assigned`

```java
java.util.stream.Stream<? extends ConstraintVertex> assigned()
```

Returns

`java.util.stream.Stream<? extends ConstraintVertex>`

#### [](#_Constraint_FunctionCall_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_FunctionCall_name_)method `name`

```java
java.lang.String name()
```

Returns

`java.lang.String`

#### [](#_Constraint_FunctionCall_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_FunctionCall_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Has)Constraint.Has

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "has" constraint: has

#### [](#_Constraint_Has_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Has_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Has_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Has_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Has_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Has_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Has_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Has_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Has_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Has_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Has_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Has_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Has_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Has_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Has_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Has_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Has_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Has_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Has_attribute_)method `attribute`

```java
ConstraintVertex attribute()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Has_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Has_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Has_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Has_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Has_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Has_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Has_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Has_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Has_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Has_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Has_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Has_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Has_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Has_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Has_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Has_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Has_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Has_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Has_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Has_owner_)method `owner`

```java
ConstraintVertex owner()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Has_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Has_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Iid)Constraint.Iid

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents an IID constraint: iid

e.g., \`$y iid 0x1f0005000000000000012f\`

#### [](#_Constraint_Iid_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Iid_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Iid_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Iid_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Iid_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Iid_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Iid_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Iid_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Iid_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Iid_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Iid_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Iid_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Iid_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Iid_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Iid_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Iid_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Iid_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Iid_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Iid_iid_)method `iid`

```java
java.lang.String iid()
```

Returns

`java.lang.String`

#### [](#_Constraint_Iid_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Iid_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Iid_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Iid_variable_)method `variable`

```java
ConstraintVertex variable()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Iid_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Is)Constraint.Is

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents an "is" constraint: is

e.g., $x is $y

#### [](#_Constraint_Is_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Is_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Is_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Is_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Is_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Is_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Is_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Is_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Is_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Is_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Is_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Is_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Is_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Is_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Is_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Is_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Is_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Is_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Is_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Is_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Is_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Is_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Is_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Is_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Is_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Is_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Is_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Is_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Is_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Is_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Is_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Is_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Is_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Is_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Is_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Is_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Is_lhs_)method `lhs`

```java
ConstraintVertex lhs()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Is_rhs_)method `rhs`

```java
ConstraintVertex rhs()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Is_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Is_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Isa)Constraint.Isa

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents an "isa" constraint: isa(!)

#### [](#_Constraint_Isa_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Isa_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Isa_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Isa_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Isa_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Isa_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Isa_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Isa_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Isa_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Isa_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Isa_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Isa_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Isa_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Isa_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Isa_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Isa_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Isa_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Isa_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Isa_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Isa_instance_)method `instance`

```java
ConstraintVertex instance()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Isa_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Isa_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Isa_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Isa_type_)method `type`

```java
ConstraintVertex type()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Isa_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Kind)Constraint.Kind

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a kind constraint:

e.g., \`entity person\`

#### [](#_Constraint_Kind_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Kind_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Kind_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Kind_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Kind_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Kind_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Kind_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Kind_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Kind_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Kind_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Kind_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Kind_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Kind_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Kind_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Kind_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Kind_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Kind_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Kind_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Kind_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Kind_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Kind_kind_)method `kind`

```java
com.typedb.driver.jni.Kind kind()
```

Returns

`com.typedb.driver.jni.Kind`

#### [](#_Constraint_Kind_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Kind_type_)method `type`

```java
ConstraintVertex type()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Kind_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Label)Constraint.Label

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a label constraint: label e.g., `$t label person`

#### [](#_Constraint_Label_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Label_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Label_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Label_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Label_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Label_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Label_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Label_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Label_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Label_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Label_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Label_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Label_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Label_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Label_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Label_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Label_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Label_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Label_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Label_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Label_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Label_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Label_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Label_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Label_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Label_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Label_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Label_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Label_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Label_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Label_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Label_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Label_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Label_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Label_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Label_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Label_label_)method `label`

```java
java.lang.String label()
```

Returns

`java.lang.String`

#### [](#_Constraint_Label_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Label_variable_)method `variable`

```java
ConstraintVertex variable()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Label_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Links)Constraint.Links

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "links" constraint: links (

:

)

#### [](#_Constraint_Links_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Links_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Links_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Links_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Links_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Links_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Links_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Links_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Links_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Links_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Links_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Links_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Links_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Links_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Links_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Links_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Links_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Links_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Links_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Links_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Links_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Links_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Links_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Links_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Links_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Links_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Links_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Links_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Links_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Links_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Links_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Links_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Links_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Links_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Links_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Links_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Links_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Links_player_)method `player`

```java
ConstraintVertex player()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Links_relation_)method `relation`

```java
ConstraintVertex relation()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Links_role_)method `role`

```java
ConstraintVertex role()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Links_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Links_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Not)Constraint.Not

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "not" constraint: not { }

#### [](#_Constraint_Not_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Not_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Not_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Not_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Not_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Not_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Not_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Not_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Not_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Not_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Not_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Not_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Not_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Not_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Not_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Not_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Not_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Not_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Not_conjunction_)method `conjunction`

```java
ConjunctionID conjunction()
```

Index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_Constraint_Not_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Not_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Not_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Not_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Not_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Not_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Not_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Not_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Not_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Not_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Not_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Not_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Not_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Not_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Not_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Not_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Not_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Not_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Not_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Not_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Or)Constraint.Or

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents an "or" constraint: { } or {

} \[or ...\]

#### [](#_Constraint_Or_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Or_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Or_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Or_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Or_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Or_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Or_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Or_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Or_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Or_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Or_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Or_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Or_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Or_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Or_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Or_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Or_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Or_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Or_branches_)method `branches`

```java
java.util.stream.Stream<? extends ConjunctionID> branches()
```

Index into `Pipeline.conjunctions`

Returns

`java.util.stream.Stream<? extends ConjunctionID>`

#### [](#_Constraint_Or_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Or_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Or_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Or_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Or_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Or_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Or_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Or_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Or_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Or_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Or_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Or_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Or_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Or_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Or_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Or_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Or_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Or_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Or_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Or_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Owns)Constraint.Owns

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents an "owns" constraint: owns

#### [](#_Constraint_Owns_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Owns_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Owns_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Owns_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Owns_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Owns_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Owns_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Owns_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Owns_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Owns_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Owns_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Owns_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Owns_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Owns_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Owns_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Owns_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Owns_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Owns_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Owns_attribute_)method `attribute`

```java
ConstraintVertex attribute()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Owns_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Owns_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Owns_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Owns_owner_)method `owner`

```java
ConstraintVertex owner()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Owns_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Owns_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Plays)Constraint.Plays

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "plays" constraint: plays

#### [](#_Constraint_Plays_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Plays_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Plays_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Plays_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Plays_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Plays_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Plays_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Plays_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Plays_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Plays_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Plays_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Plays_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Plays_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Plays_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Plays_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Plays_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Plays_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Plays_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Plays_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Plays_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Plays_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Plays_player_)method `player`

```java
ConstraintVertex player()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Plays_role_)method `role`

```java
ConstraintVertex role()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Plays_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Plays_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Relates)Constraint.Relates

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "relates" constraint: relates

#### [](#_Constraint_Relates_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Relates_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Relates_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Relates_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Relates_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Relates_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Relates_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Relates_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Relates_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Relates_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Relates_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Relates_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Relates_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Relates_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Relates_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Relates_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Relates_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Relates_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Relates_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Relates_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Relates_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Relates_relation_)method `relation`

```java
ConstraintVertex relation()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Relates_role_)method `role`

```java
ConstraintVertex role()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Relates_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Relates_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Span)Constraint.Span

`class`

**Package**: `com.typedb.driver.api.analyze`

The span of a constraint in the source query

#### [](#_Constraint_Span_begin_)method `begin`

```java
long begin()
```

Returns

`long`

#### [](#_Constraint_Span_end_)method `end`

```java
long end()
```

Returns

`long`

### [](#_Constraint_Sub)Constraint.Sub

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "sub" constraint: sub(!)

#### [](#_Constraint_Sub_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Sub_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Sub_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Sub_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Sub_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Sub_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Sub_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Sub_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Sub_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Sub_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Sub_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Sub_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Sub_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Sub_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Sub_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Sub_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Sub_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Sub_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Sub_exactness_)method `exactness`

```java
com.typedb.driver.jni.ConstraintExactness exactness()
```

Returns

`com.typedb.driver.jni.ConstraintExactness`

#### [](#_Constraint_Sub_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Sub_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Sub_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Sub_subtype_)method `subtype`

```java
ConstraintVertex subtype()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Sub_supertype_)method `supertype`

```java
ConstraintVertex supertype()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Sub_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Try)Constraint.Try

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a "try" constraint: try { }

#### [](#_Constraint_Try_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Try_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Try_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Try_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Try_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Try_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Try_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Try_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Try_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Try_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Try_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Try_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Try_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Try_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Try_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Try_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Try_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Try_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Try_conjunction_)method `conjunction`

```java
ConjunctionID conjunction()
```

Index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_Constraint_Try_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Try_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Try_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Try_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Try_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Try_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Try_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Try_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Try_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Try_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Try_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Try_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Try_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Try_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Try_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Try_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Try_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Try_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Try_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Try_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_Constraint_Value)Constraint.Value

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Constraint`
    

Represents a value constraint: value

e.g., \`$t value string\`

#### [](#_Constraint_Value_asComparison_)method `asComparison`

```java
Constraint.Comparison asComparison()
```

Returns

`Constraint.Comparison`

#### [](#_Constraint_Value_asExpression_)method `asExpression`

```java
Constraint.Expression asExpression()
```

Returns

`Constraint.Expression`

#### [](#_Constraint_Value_asFunctionCall_)method `asFunctionCall`

```java
Constraint.FunctionCall asFunctionCall()
```

Returns

`Constraint.FunctionCall`

#### [](#_Constraint_Value_asHas_)method `asHas`

```java
Constraint.Has asHas()
```

Returns

`Constraint.Has`

#### [](#_Constraint_Value_asIid_)method `asIid`

```java
Constraint.Iid asIid()
```

Returns

`Constraint.Iid`

#### [](#_Constraint_Value_asIs_)method `asIs`

```java
Constraint.Is asIs()
```

Returns

`Constraint.Is`

#### [](#_Constraint_Value_asIsa_)method `asIsa`

```java
Constraint.Isa asIsa()
```

Returns

`Constraint.Isa`

#### [](#_Constraint_Value_asKind_)method `asKind`

```java
Constraint.Kind asKind()
```

Returns

`Constraint.Kind`

#### [](#_Constraint_Value_asLabel_)method `asLabel`

```java
Constraint.Label asLabel()
```

Returns

`Constraint.Label`

#### [](#_Constraint_Value_asLinks_)method `asLinks`

```java
Constraint.Links asLinks()
```

Returns

`Constraint.Links`

#### [](#_Constraint_Value_asNot_)method `asNot`

```java
Constraint.Not asNot()
```

Returns

`Constraint.Not`

#### [](#_Constraint_Value_asOr_)method `asOr`

```java
Constraint.Or asOr()
```

Returns

`Constraint.Or`

#### [](#_Constraint_Value_asOwns_)method `asOwns`

```java
Constraint.Owns asOwns()
```

Returns

`Constraint.Owns`

#### [](#_Constraint_Value_asPlays_)method `asPlays`

```java
Constraint.Plays asPlays()
```

Returns

`Constraint.Plays`

#### [](#_Constraint_Value_asRelates_)method `asRelates`

```java
Constraint.Relates asRelates()
```

Returns

`Constraint.Relates`

#### [](#_Constraint_Value_asSub_)method `asSub`

```java
Constraint.Sub asSub()
```

Returns

`Constraint.Sub`

#### [](#_Constraint_Value_asTry_)method `asTry`

```java
Constraint.Try asTry()
```

Returns

`Constraint.Try`

#### [](#_Constraint_Value_asValue_)method `asValue`

```java
Constraint.Value asValue()
```

Returns

`Constraint.Value`

#### [](#_Constraint_Value_attributeType_)method `attributeType`

```java
ConstraintVertex attributeType()
```

Returns

`ConstraintVertex`

#### [](#_Constraint_Value_isComparison_)method `isComparison`

```java
boolean isComparison()
```

Returns

`boolean`

#### [](#_Constraint_Value_isExpression_)method `isExpression`

```java
boolean isExpression()
```

Returns

`boolean`

#### [](#_Constraint_Value_isFunctionCall_)method `isFunctionCall`

```java
boolean isFunctionCall()
```

Returns

`boolean`

#### [](#_Constraint_Value_isHas_)method `isHas`

```java
boolean isHas()
```

Returns

`boolean`

#### [](#_Constraint_Value_isIid_)method `isIid`

```java
boolean isIid()
```

Returns

`boolean`

#### [](#_Constraint_Value_isIs_)method `isIs`

```java
boolean isIs()
```

Returns

`boolean`

#### [](#_Constraint_Value_isIsa_)method `isIsa`

```java
boolean isIsa()
```

Returns

`boolean`

#### [](#_Constraint_Value_isKind_)method `isKind`

```java
boolean isKind()
```

Returns

`boolean`

#### [](#_Constraint_Value_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Returns

`boolean`

#### [](#_Constraint_Value_isLinks_)method `isLinks`

```java
boolean isLinks()
```

Returns

`boolean`

#### [](#_Constraint_Value_isNot_)method `isNot`

```java
boolean isNot()
```

Returns

`boolean`

#### [](#_Constraint_Value_isOr_)method `isOr`

```java
boolean isOr()
```

Returns

`boolean`

#### [](#_Constraint_Value_isOwns_)method `isOwns`

```java
boolean isOwns()
```

Returns

`boolean`

#### [](#_Constraint_Value_isPlays_)method `isPlays`

```java
boolean isPlays()
```

Returns

`boolean`

#### [](#_Constraint_Value_isRelates_)method `isRelates`

```java
boolean isRelates()
```

Returns

`boolean`

#### [](#_Constraint_Value_isSub_)method `isSub`

```java
boolean isSub()
```

Returns

`boolean`

#### [](#_Constraint_Value_isTry_)method `isTry`

```java
boolean isTry()
```

Returns

`boolean`

#### [](#_Constraint_Value_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_Constraint_Value_span_)method `span`

```java
Constraint.Span span()
```

Gets the span of this constraint.

Returns

`Constraint.Span`

#### [](#_Constraint_Value_valueType_)method `valueType`

```java
java.lang.String valueType()
```

Returns

`java.lang.String`

#### [](#_Constraint_Value_variant_)method `variant`

```java
com.typedb.driver.jni.ConstraintVariant variant()
```

Gets the variant of this constraint.

Returns

`com.typedb.driver.jni.ConstraintVariant`

### [](#_ConstraintVertex)ConstraintVertex

`class`

**Package**: `com.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 & relates constraints, as multiple relations may have roles with the same name.

#### [](#_ConstraintVertex_asLabel_)method `asLabel`

```java
Type asLabel()
```

Down-casts this vertex to a type label.

Returns

`Type`

#### [](#_ConstraintVertex_asNamedRole_)method `asNamedRole`

```java
NamedRole asNamedRole()
```

Down-casts this vertex to a NamedRole. This is an internal variable injected to handle ambiguity in unscoped role-names.

Returns

`NamedRole`

#### [](#_ConstraintVertex_asValue_)method `asValue`

```java
Value asValue()
```

Down-casts this vertex to a value.

Returns

`Value`

#### [](#_ConstraintVertex_asVariable_)method `asVariable`

```java
Variable asVariable()
```

Down-casts this variable to a vertex.

Returns

`Variable`

#### [](#_ConstraintVertex_isLabel_)method `isLabel`

```java
boolean isLabel()
```

Checks if this vertex is a label.

Returns

`boolean`

#### [](#_ConstraintVertex_isNamedRole_)method `isNamedRole`

```java
boolean isNamedRole()
```

Checks if this vertex is a named role.

Returns

`boolean`

#### [](#_ConstraintVertex_isValue_)method `isValue`

```java
boolean isValue()
```

Checks if this vertex is a value.

Returns

`boolean`

#### [](#_ConstraintVertex_isVariable_)method `isVariable`

```java
boolean isVariable()
```

Checks if this vertex is a variable.

Returns

`boolean`

### [](#_Fetch)Fetch

`class`

**Package**: `com.typedb.driver.api.analyze`

A representation of the 'fetch' stage of a query

#### [](#_Fetch_asLeaf_)method `asLeaf`

```java
Fetch.FetchLeaf asLeaf()
```

Down-casts this `Fetch` as a `FetchLeaf` variant

Returns

`Fetch.FetchLeaf`

#### [](#_Fetch_asList_)method `asList`

```java
Fetch.FetchList asList()
```

Down-casts this `Fetch` as a `FetchList` variant

Returns

`Fetch.FetchList`

#### [](#_Fetch_asObject_)method `asObject`

```java
Fetch.FetchObject asObject()
```

Down-casts this `Fetch` as a `FetchObject` variant

Returns

`Fetch.FetchObject`

#### [](#_Fetch_isLeaf_)method `isLeaf`

```java
boolean isLeaf()
```

Returns

`boolean`

#### [](#_Fetch_isList_)method `isList`

```java
boolean isList()
```

Returns

`boolean`

#### [](#_Fetch_isObject_)method `isObject`

```java
boolean isObject()
```

Returns

`boolean`

#### [](#_Fetch_variant_)method `variant`

```java
com.typedb.driver.jni.FetchVariant variant()
```

Returns

`com.typedb.driver.jni.FetchVariant`

### [](#_Fetch_FetchLeaf)Fetch.FetchLeaf

`class`

**Package**: `com.typedb.driver.api.analyze`

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

#### [](#_Fetch_FetchLeaf_annotations_)method `annotations`

```java
java.util.stream.Stream<java.lang.String> annotations()
```

Returns

`java.util.stream.Stream<java.lang.String>`

### [](#_Fetch_FetchList)Fetch.FetchList

`class`

**Package**: `com.typedb.driver.api.analyze`

A `List` of `Fetch` documents.

#### [](#_Fetch_FetchList_element_)method `element`

```java
Fetch element()
```

Returns

`Fetch`

### [](#_Fetch_FetchObject)Fetch.FetchObject

`class`

**Package**: `com.typedb.driver.api.analyze`

A mapping of string keys to `Fetch` documents.

#### [](#_Fetch_FetchObject_get_java_lang_String)method `get`

```java
Fetch get​(java.lang.String key)
```

Returns

`Fetch`

#### [](#_Fetch_FetchObject_keys_)method `keys`

```java
java.util.stream.Stream<java.lang.String> keys()
```

Returns

`java.util.stream.Stream<java.lang.String>`

### [](#_Function)Function

`class`

**Package**: `com.typedb.driver.api.analyze`

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

#### [](#_Function_argument_annotations_)method `argument_annotations`

```java
java.util.stream.Stream<? extends VariableAnnotations> argument_annotations()
```

Gets the type annotations for each argument of the function.

Returns

`java.util.stream.Stream<? extends VariableAnnotations>`

#### [](#_Function_argument_variables_)method `argument_variables`

```java
java.util.stream.Stream<? extends Variable> argument_variables()
```

Gets the variables which are the arguments of the function.

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_Function_body_)method `body`

```java
Pipeline body()
```

Gets the pipeline which forms the body of the function.

Returns

`Pipeline`

#### [](#_Function_return_annotations_)method `return_annotations`

```java
java.util.stream.Stream<? extends VariableAnnotations> return_annotations()
```

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

Returns

`java.util.stream.Stream<? extends VariableAnnotations>`

#### [](#_Function_return_operation_)method `return_operation`

```java
Function.ReturnOperation return_operation()
```

Gets the return operation of the function.

Returns

`Function.ReturnOperation`

### [](#_Function_ReturnOperation)Function.ReturnOperation

`class`

**Package**: `com.typedb.driver.api.analyze`

A representation of the return operation of a function.

#### [](#_Function_ReturnOperation_asCheck_)method `asCheck`

```java
Function.ReturnOperation.Check asCheck()
```

Down-casts this ReturnOperation to a `Check` return operation.

Returns

`Function.ReturnOperation.Check`

#### [](#_Function_ReturnOperation_asReduce_)method `asReduce`

```java
Function.ReturnOperation.Reduce asReduce()
```

Down-casts this ReturnOperation to a Reduce return operation.

Returns

`Function.ReturnOperation.Reduce`

#### [](#_Function_ReturnOperation_asSingle_)method `asSingle`

```java
Function.ReturnOperation.Single asSingle()
```

Down-casts this ReturnOperation to a `Single` return operation.

Returns

`Function.ReturnOperation.Single`

#### [](#_Function_ReturnOperation_asStream_)method `asStream`

```java
Function.ReturnOperation.Stream asStream()
```

Down-casts this ReturnOperation to a `Stream` return operation.

Returns

`Function.ReturnOperation.Stream`

#### [](#_Function_ReturnOperation_isCheck_)method `isCheck`

```java
boolean isCheck()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_isSingle_)method `isSingle`

```java
boolean isSingle()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_isStream_)method `isStream`

```java
boolean isStream()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_variant_)method `variant`

```java
com.typedb.driver.jni.ReturnOperationVariant variant()
```

Gets the variant of this return operation. One of: `StreamReturn, SingleReturn, CheckReturn, ReduceReturn`

Returns

`com.typedb.driver.jni.ReturnOperationVariant`

### [](#_Function_ReturnOperation_Check)Function.ReturnOperation.Check

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Function.ReturnOperation`
    

Indicates the function returns a boolean - true if the body had answers, false otherwise. e.g. `return check;`

### [](#_Function_ReturnOperation_Reduce)Function.ReturnOperation.Reduce

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Function.ReturnOperation`
    

Indicates the function returns an aggregation over the rows in the body. e.g. `return count($x), sum($y);`

#### [](#_Function_ReturnOperation_Reduce_asCheck_)method `asCheck`

```java
Function.ReturnOperation.Check asCheck()
```

Down-casts this ReturnOperation to a `Check` return operation.

Returns

`Function.ReturnOperation.Check`

#### [](#_Function_ReturnOperation_Reduce_asReduce_)method `asReduce`

```java
default Function.ReturnOperation.Reduce asReduce()
```

Down-casts this ReturnOperation to a Reduce return operation.

Returns

`Function.ReturnOperation.Reduce`

#### [](#_Function_ReturnOperation_Reduce_asSingle_)method `asSingle`

```java
Function.ReturnOperation.Single asSingle()
```

Down-casts this ReturnOperation to a `Single` return operation.

Returns

`Function.ReturnOperation.Single`

#### [](#_Function_ReturnOperation_Reduce_asStream_)method `asStream`

```java
Function.ReturnOperation.Stream asStream()
```

Down-casts this ReturnOperation to a `Stream` return operation.

Returns

`Function.ReturnOperation.Stream`

#### [](#_Function_ReturnOperation_Reduce_isCheck_)method `isCheck`

```java
boolean isCheck()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Reduce_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Reduce_isSingle_)method `isSingle`

```java
boolean isSingle()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Reduce_isStream_)method `isStream`

```java
boolean isStream()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Reduce_reducers_)method `reducers`

```java
java.util.stream.Stream<? extends Reducer> reducers()
```

Gets the reducers used to compute the aggregations.

Returns

`java.util.stream.Stream<? extends Reducer>`

#### [](#_Function_ReturnOperation_Reduce_variant_)method `variant`

```java
com.typedb.driver.jni.ReturnOperationVariant variant()
```

Gets the variant of this return operation. One of: `StreamReturn, SingleReturn, CheckReturn, ReduceReturn`

Returns

`com.typedb.driver.jni.ReturnOperationVariant`

### [](#_Function_ReturnOperation_Single)Function.ReturnOperation.Single

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Function.ReturnOperation`
    

Indicates the function returns a single row of the specified variables. e.g. `return first $x, $y;`

#### [](#_Function_ReturnOperation_Single_asCheck_)method `asCheck`

```java
Function.ReturnOperation.Check asCheck()
```

Down-casts this ReturnOperation to a `Check` return operation.

Returns

`Function.ReturnOperation.Check`

#### [](#_Function_ReturnOperation_Single_asReduce_)method `asReduce`

```java
Function.ReturnOperation.Reduce asReduce()
```

Down-casts this ReturnOperation to a Reduce return operation.

Returns

`Function.ReturnOperation.Reduce`

#### [](#_Function_ReturnOperation_Single_asSingle_)method `asSingle`

```java
Function.ReturnOperation.Single asSingle()
```

Down-casts this ReturnOperation to a `Single` return operation.

Returns

`Function.ReturnOperation.Single`

#### [](#_Function_ReturnOperation_Single_asStream_)method `asStream`

```java
Function.ReturnOperation.Stream asStream()
```

Down-casts this ReturnOperation to a `Stream` return operation.

Returns

`Function.ReturnOperation.Stream`

#### [](#_Function_ReturnOperation_Single_isCheck_)method `isCheck`

```java
boolean isCheck()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Single_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Single_isSingle_)method `isSingle`

```java
boolean isSingle()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Single_isStream_)method `isStream`

```java
boolean isStream()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Single_selector_)method `selector`

```java
java.lang.String selector()
```

Gets the selector that determines how the operation selects the row.

Returns

`java.lang.String`

#### [](#_Function_ReturnOperation_Single_variables_)method `variables`

```java
java.util.stream.Stream<? extends Variable> variables()
```

Gets the variables in the returned row.

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_Function_ReturnOperation_Single_variant_)method `variant`

```java
com.typedb.driver.jni.ReturnOperationVariant variant()
```

Gets the variant of this return operation. One of: `StreamReturn, SingleReturn, CheckReturn, ReduceReturn`

Returns

`com.typedb.driver.jni.ReturnOperationVariant`

### [](#_Function_ReturnOperation_Stream)Function.ReturnOperation.Stream

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `Function.ReturnOperation`
    

Indicates the function returns a stream of concepts. e.g. `return { $x, $y };`

#### [](#_Function_ReturnOperation_Stream_asCheck_)method `asCheck`

```java
Function.ReturnOperation.Check asCheck()
```

Down-casts this ReturnOperation to a `Check` return operation.

Returns

`Function.ReturnOperation.Check`

#### [](#_Function_ReturnOperation_Stream_asReduce_)method `asReduce`

```java
Function.ReturnOperation.Reduce asReduce()
```

Down-casts this ReturnOperation to a Reduce return operation.

Returns

`Function.ReturnOperation.Reduce`

#### [](#_Function_ReturnOperation_Stream_asSingle_)method `asSingle`

```java
Function.ReturnOperation.Single asSingle()
```

Down-casts this ReturnOperation to a `Single` return operation.

Returns

`Function.ReturnOperation.Single`

#### [](#_Function_ReturnOperation_Stream_asStream_)method `asStream`

```java
Function.ReturnOperation.Stream asStream()
```

Down-casts this ReturnOperation to a `Stream` return operation.

Returns

`Function.ReturnOperation.Stream`

#### [](#_Function_ReturnOperation_Stream_isCheck_)method `isCheck`

```java
boolean isCheck()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Stream_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Stream_isSingle_)method `isSingle`

```java
boolean isSingle()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Stream_isStream_)method `isStream`

```java
boolean isStream()
```

Returns

`boolean`

#### [](#_Function_ReturnOperation_Stream_variables_)method `variables`

```java
java.util.stream.Stream<? extends Variable> variables()
```

Gets the variables in the returned row.

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_Function_ReturnOperation_Stream_variant_)method `variant`

```java
com.typedb.driver.jni.ReturnOperationVariant variant()
```

Gets the variant of this return operation. One of: `StreamReturn, SingleReturn, CheckReturn, ReduceReturn`

Returns

`com.typedb.driver.jni.ReturnOperationVariant`

### [](#_NamedRole)NamedRole

`class`

**Package**: `com.typedb.driver.api.analyze`

'links' & '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

#### [](#_NamedRole_name_)method `name`

```java
java.lang.String name()
```

The unscoped role name specified in the query.

Returns

`java.lang.String`

#### [](#_NamedRole_variable_)method `variable`

```java
Variable variable()
```

The internal variable injected to handle ambiguity in unscoped role names.

Returns

`Variable`

### [](#_Pipeline)Pipeline

`class`

**Package**: `com.typedb.driver.api.analyze`

A representation of a query pipeline.

#### [](#_Pipeline_conjunction_ConjunctionID)method `conjunction`

```java
java.util.Optional<? extends Conjunction> conjunction​(ConjunctionID conjunctionID)
```

Input parameters   

Name

Description

Type

`conjunctionID`

The ConjunctionID of the conjunction to retrieve

`ConjunctionID`

Returns

`java.util.Optional<? extends Conjunction>`

#### [](#_Pipeline_getVariableName_Variable)method `getVariableName`

```java
java.util.Optional<java.lang.String> getVariableName​(Variable variable)
```

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

Returns

`java.util.Optional<java.lang.String>`

#### [](#_Pipeline_stages_)method `stages`

```java
java.util.stream.Stream<? extends PipelineStage> stages()
```

Returns

`java.util.stream.Stream<? extends PipelineStage>`

### [](#_PipelineStage)PipelineStage

`class`

**Package**: `com.typedb.driver.api.analyze`

Representation of a stage in a `Pipeline`.

#### [](#_PipelineStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

### [](#_PipelineStage_DeleteStage)PipelineStage.DeleteStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "delete" stage:

```java
 delete
     &lt;block&gt;;
     &lt;deleted_variables&gt;;
```

e.g.

```java
 delete
     has $attribute of $owner; links ($player) of $relation;
     $deleted-instance;
```

Examples

```java
delete
     <block>;
     <deleted_variables>;
```

, \[source,java\]

delete
     has $attribute of $owner; links ($player) of $relation;
     $deleted-instance;

#### [](#_PipelineStage_DeleteStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_DeleteStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_DeleteStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_DeleteStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_DeleteStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_DeleteStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_DeleteStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_DeleteStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_DeleteStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_DeleteStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_DeleteStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_DeleteStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_DeleteStage_block_)method `block`

```java
ConjunctionID block()
```

The index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_PipelineStage_DeleteStage_deletedVariables_)method `deletedVariables`

```java
java.util.stream.Stream<? extends Variable> deletedVariables()
```

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

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_PipelineStage_DeleteStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_DeleteStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_DeleteStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

### [](#_PipelineStage_DistinctStage)PipelineStage.DistinctStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "distinct" stage

### [](#_PipelineStage_InsertStage)PipelineStage.InsertStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents an "insert" stage: insert <block> e.g. `insert $f isa friendship, links (friend: $x, friend: $y)`

#### [](#_PipelineStage_InsertStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_InsertStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_InsertStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_InsertStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_InsertStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_InsertStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_InsertStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_InsertStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_InsertStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_InsertStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_InsertStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_InsertStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_InsertStage_block_)method `block`

```java
ConjunctionID block()
```

The index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_PipelineStage_InsertStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_InsertStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_InsertStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

### [](#_PipelineStage_LimitStage)PipelineStage.LimitStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "limit" stage: limit <limit> e.g. `limit 5`

#### [](#_PipelineStage_LimitStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_LimitStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_LimitStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_LimitStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_LimitStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_LimitStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_LimitStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_LimitStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_LimitStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_LimitStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_LimitStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_LimitStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_LimitStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_LimitStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

#### [](#_PipelineStage_LimitStage_limit_)method `limit`

```java
long limit()
```

The maximum number of results to return

Returns

`long`

### [](#_PipelineStage_MatchStage)PipelineStage.MatchStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "match" stage: match <block> e.g. `match $f isa friendship, links (friend: $x, friend: $y)`

#### [](#_PipelineStage_MatchStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_MatchStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_MatchStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_MatchStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_MatchStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_MatchStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_MatchStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_MatchStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_MatchStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_MatchStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_MatchStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_MatchStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_MatchStage_block_)method `block`

```java
ConjunctionID block()
```

The index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_PipelineStage_MatchStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_MatchStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_MatchStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

### [](#_PipelineStage_OffsetStage)PipelineStage.OffsetStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents an "offset" stage: offset <offset> e.g. `offset 3`

#### [](#_PipelineStage_OffsetStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_OffsetStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_OffsetStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_OffsetStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_OffsetStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_OffsetStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_OffsetStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_OffsetStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_OffsetStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_OffsetStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_OffsetStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_OffsetStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_OffsetStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_OffsetStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

#### [](#_PipelineStage_OffsetStage_offset_)method `offset`

```java
long offset()
```

The number of results to skip

Returns

`long`

### [](#_PipelineStage_PutStage)PipelineStage.PutStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "put" stage: put <block> e.g. `put $f isa friendship, links (friend: $x, friend: $y)`

#### [](#_PipelineStage_PutStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_PutStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_PutStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_PutStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_PutStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_PutStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_PutStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_PutStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_PutStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_PutStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_PutStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_PutStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_PutStage_block_)method `block`

```java
ConjunctionID block()
```

The index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_PipelineStage_PutStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_PutStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_PutStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

### [](#_PipelineStage_ReduceStage_ReduceAssignment)PipelineStage.ReduceStage.ReduceAssignment

`class`

**Package**: `com.typedb.driver.api.analyze`

An assignment of a reducer to a variable

#### [](#_PipelineStage_ReduceStage_ReduceAssignment_assigned_)method `assigned`

```java
Variable assigned()
```

The variable being assigned to

Returns

`Variable`

#### [](#_PipelineStage_ReduceStage_ReduceAssignment_reducer_)method `reducer`

```java
Reducer reducer()
```

The reducer being applied

Returns

`Reducer`

### [](#_PipelineStage_ReduceStage)PipelineStage.ReduceStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "reduce" stage:

```java
 reduce &lt;reducers&gt; groupby &lt;groupby&gt;
```

e.g.

```java
 reduce $sum = sum($v), $count = count groupby $x, $y;
```

Examples

```java
reduce <reducers> groupby <groupby>
```

, \[source,java\]

reduce $sum = sum($v), $count = count groupby $x, $y;

#### [](#_PipelineStage_ReduceStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_ReduceStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_ReduceStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_ReduceStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_ReduceStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_ReduceStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_ReduceStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_ReduceStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_ReduceStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_ReduceStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_ReduceStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_ReduceStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_ReduceStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_ReduceStage_groupBy_)method `groupBy`

```java
java.util.stream.Stream<? extends Variable> groupBy()
```

The variables to group by

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_PipelineStage_ReduceStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

#### [](#_PipelineStage_ReduceStage_reducerAssignments_)method `reducerAssignments`

```java
java.util.stream.Stream<? extends PipelineStage.ReduceStage.ReduceAssignment> reducerAssignments()
```

The reducer assignments

Returns

`java.util.stream.Stream<? extends PipelineStage.ReduceStage.ReduceAssignment>`

### [](#_PipelineStage_RequireStage)PipelineStage.RequireStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "require" stage: require <variables> e.g. `require $x, $y`

#### [](#_PipelineStage_RequireStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_RequireStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_RequireStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_RequireStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_RequireStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_RequireStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_RequireStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_RequireStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_RequireStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_RequireStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_RequireStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_RequireStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_RequireStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_RequireStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

#### [](#_PipelineStage_RequireStage_variables_)method `variables`

```java
java.util.stream.Stream<? extends Variable> variables()
```

The variables that must be present in the result

Returns

`java.util.stream.Stream<? extends Variable>`

### [](#_PipelineStage_SelectStage)PipelineStage.SelectStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "select" stage: select <variables> e.g. `select $x, $y`

#### [](#_PipelineStage_SelectStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_SelectStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_SelectStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_SelectStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_SelectStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_SelectStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_SelectStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_SelectStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_SelectStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_SelectStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_SelectStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_SelectStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_SelectStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_SelectStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

#### [](#_PipelineStage_SelectStage_variables_)method `variables`

```java
java.util.stream.Stream<? extends Variable> variables()
```

The variables being selected

Returns

`java.util.stream.Stream<? extends Variable>`

### [](#_PipelineStage_SortStage_SortVariable)PipelineStage.SortStage.SortVariable

`class`

**Package**: `com.typedb.driver.api.analyze`

A variable and its sort order

#### [](#_PipelineStage_SortStage_SortVariable_order_)method `order`

```java
com.typedb.driver.jni.SortOrder order()
```

The sort order (ascending or descending)

Returns

`com.typedb.driver.jni.SortOrder`

#### [](#_PipelineStage_SortStage_SortVariable_variable_)method `variable`

```java
Variable variable()
```

The variable to sort by

Returns

`Variable`

### [](#_PipelineStage_SortStage)PipelineStage.SortStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents a "sort" stage: sort <variables-and-order> e.g. `sort $x asc, $y desc`

#### [](#_PipelineStage_SortStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_SortStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_SortStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_SortStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_SortStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_SortStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_SortStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_SortStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_SortStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_SortStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_SortStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_SortStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_SortStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_SortStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

#### [](#_PipelineStage_SortStage_variables_)method `variables`

```java
java.util.stream.Stream<? extends PipelineStage.SortStage.SortVariable> variables()
```

The sort variables and their sort orders

Returns

`java.util.stream.Stream<? extends PipelineStage.SortStage.SortVariable>`

### [](#_PipelineStage_UpdateStage)PipelineStage.UpdateStage

`class`

**Package**: `com.typedb.driver.api.analyze`

**Superinterfaces:**

*   `PipelineStage`
    

Represents an "update" stage: update <block> e.g. `update $owner has name "John"`

#### [](#_PipelineStage_UpdateStage_asDelete_)method `asDelete`

```java
PipelineStage.DeleteStage asDelete()
```

Returns

`PipelineStage.DeleteStage`

#### [](#_PipelineStage_UpdateStage_asDistinct_)method `asDistinct`

```java
PipelineStage.DistinctStage asDistinct()
```

Returns

`PipelineStage.DistinctStage`

#### [](#_PipelineStage_UpdateStage_asInsert_)method `asInsert`

```java
PipelineStage.InsertStage asInsert()
```

Returns

`PipelineStage.InsertStage`

#### [](#_PipelineStage_UpdateStage_asLimit_)method `asLimit`

```java
PipelineStage.LimitStage asLimit()
```

Returns

`PipelineStage.LimitStage`

#### [](#_PipelineStage_UpdateStage_asMatch_)method `asMatch`

```java
PipelineStage.MatchStage asMatch()
```

Returns

`PipelineStage.MatchStage`

#### [](#_PipelineStage_UpdateStage_asOffset_)method `asOffset`

```java
PipelineStage.OffsetStage asOffset()
```

Returns

`PipelineStage.OffsetStage`

#### [](#_PipelineStage_UpdateStage_asPut_)method `asPut`

```java
PipelineStage.PutStage asPut()
```

Returns

`PipelineStage.PutStage`

#### [](#_PipelineStage_UpdateStage_asReduce_)method `asReduce`

```java
PipelineStage.ReduceStage asReduce()
```

Returns

`PipelineStage.ReduceStage`

#### [](#_PipelineStage_UpdateStage_asRequire_)method `asRequire`

```java
PipelineStage.RequireStage asRequire()
```

Returns

`PipelineStage.RequireStage`

#### [](#_PipelineStage_UpdateStage_asSelect_)method `asSelect`

```java
PipelineStage.SelectStage asSelect()
```

Returns

`PipelineStage.SelectStage`

#### [](#_PipelineStage_UpdateStage_asSort_)method `asSort`

```java
PipelineStage.SortStage asSort()
```

Returns

`PipelineStage.SortStage`

#### [](#_PipelineStage_UpdateStage_asUpdate_)method `asUpdate`

```java
PipelineStage.UpdateStage asUpdate()
```

Returns

`PipelineStage.UpdateStage`

#### [](#_PipelineStage_UpdateStage_block_)method `block`

```java
ConjunctionID block()
```

The index into `Pipeline.conjunctions`

Returns

`ConjunctionID`

#### [](#_PipelineStage_UpdateStage_getVariant_)method `getVariant`

```java
com.typedb.driver.jni.PipelineStageVariant getVariant()
```

Returns

`com.typedb.driver.jni.PipelineStageVariant`

#### [](#_PipelineStage_UpdateStage_isDelete_)method `isDelete`

```java
boolean isDelete()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isDistinct_)method `isDistinct`

```java
boolean isDistinct()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isInsert_)method `isInsert`

```java
boolean isInsert()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isLimit_)method `isLimit`

```java
boolean isLimit()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isMatch_)method `isMatch`

```java
boolean isMatch()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isOffset_)method `isOffset`

```java
boolean isOffset()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isPut_)method `isPut`

```java
boolean isPut()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isReduce_)method `isReduce`

```java
boolean isReduce()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isRequire_)method `isRequire`

```java
boolean isRequire()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isSelect_)method `isSelect`

```java
boolean isSelect()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isSort_)method `isSort`

```java
boolean isSort()
```

Returns

`boolean`

#### [](#_PipelineStage_UpdateStage_isUpdate_)method `isUpdate`

```java
boolean isUpdate()
```

Returns

`boolean`

### [](#_Reducer)Reducer

`class`

**Package**: `com.typedb.driver.api.analyze`

Representation of a reducer used either in a `PipelineStage::Reduce` or in a function’s `ReturnOperation`.

#### [](#_Reducer_arguments_)method `arguments`

```java
java.util.stream.Stream<? extends Variable> arguments()
```

Returns

`java.util.stream.Stream<? extends Variable>`

#### [](#_Reducer_name_)method `name`

```java
java.lang.String name()
```

Returns

`java.lang.String`

### [](#_VariableAnnotations)VariableAnnotations

`class`

**Package**: `com.typedb.driver.api.analyze`

#### [](#_VariableAnnotations_asInstance_)method `asInstance`

```java
java.util.stream.Stream<? extends Type> asInstance()
```

Returns

`java.util.stream.Stream<? extends Type>`

#### [](#_VariableAnnotations_asType_)method `asType`

```java
java.util.stream.Stream<? extends Type> asType()
```

Returns

`java.util.stream.Stream<? extends Type>`

#### [](#_VariableAnnotations_asValue_)method `asValue`

```java
java.util.stream.Stream<java.lang.String> asValue()
```

Returns

`java.util.stream.Stream<java.lang.String>`

#### [](#_VariableAnnotations_isInstance_)method `isInstance`

```java
boolean isInstance()
```

Returns

`boolean`

#### [](#_VariableAnnotations_isType_)method `isType`

```java
boolean isType()
```

Returns

`boolean`

#### [](#_VariableAnnotations_isValue_)method `isValue`

```java
boolean isValue()
```

Returns

`boolean`

#### [](#_VariableAnnotations_variant_)method `variant`

```java
com.typedb.driver.jni.VariableAnnotationsVariant variant()
```

The variant indicates whether this is an instance variable, type variable, or value variable.

Returns

`com.typedb.driver.jni.VariableAnnotationsVariant`

## [](#_errors_header)Errors

### [](#_TypeDBDriverException)TypeDBDriverException

`class`

**Package**: `com.typedb.driver.common.exception`

Exceptions raised by the driver.

#### [](#_TypeDBDriverException_getErrorMessage_)method `getErrorMessage`

```java
@Nullable
public com.typedb.driver.common.exception.ErrorMessage getErrorMessage()
```

Returns

`public com.typedb.driver.common.exception.ErrorMessage`

#### [](#_TypeDBDriverException_getName_)method `getName`

```java
public java.lang.String getName()
```

Returns

`public java.lang.String`

[Python gRPC driver](../python/index.md) [Rust gRPC driver](../rust/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/reference/modules/ROOT/pages/typedb-grpc-drivers/java.adoc) Edit this page on GitHub.