TypeDB 3.0 is live! Get started for free.

Java driver API reference

Connection

TypeDB

Package: com.typedb.driver

Fields
Name Type Description

DEFAULT_ADDRESS

static java.lang.String

TypeDB

public TypeDB()
java
Returns

public

driver

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

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 connection settings to connect with

DriverOptions

Returns

public static Driver

Code examples
TypeDB.driver(address);
java

Driver

Package: com.typedb.driver.api

Superinterfaces:

  • java.lang.AutoCloseable

Fields
Name Type Description

LANGUAGE

static java.lang.String

close

void close()
java

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

Returns

void

Code examples
driver.close()
java

databases

@CheckReturnValue
DatabaseManager databases()
java

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

Returns

DatabaseManager

isOpen

@CheckReturnValue
boolean isOpen()
java

Checks whether this connection is presently open.

Returns

boolean

Code examples
driver.isOpen();
java

transaction

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

Opens a communication tunnel (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
driver.transaction(database, sessionType);
java

transaction

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

Opens a communication tunnel (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
driver.transaction(database, sessionType);
java

users

@CheckReturnValue
UserManager users()
java

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

Returns

UserManager

Code examples
driver.users();
java

Credentials

Package: com.typedb.driver.api

User credentials for connecting to TypeDB Server.

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

Credentials

public Credentials(java.lang.String username,
                   java.lang.String password)
java
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

Package: com.typedb.driver.api

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

Examples
DriverOptions driverOptions = new DriverOptions(true, Path.of("path/to/ca-certificate.pem"));
java

DriverOptions

public DriverOptions(boolean isTlsEnabled,
                     java.lang.String tlsRootCAPath)
java
Input parameters
Name Description Type

isTlsEnabled

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

boolean

tlsRootCAPath

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

java.lang.String

Returns

public

DatabaseManager

Package: com.typedb.driver.api.database

Provides access to all database management methods.

all

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

Retrieves all databases present on the TypeDB server

Returns

java.util.List<Database>

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

contains

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

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
driver.databases().contains(name)
java

create

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

Create 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
driver.databases().create(name)
java

get

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

Retrieve 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
driver.databases().get(name)
java

Database

Package: com.typedb.driver.api.database

delete

void delete()
     throws TypeDBDriverException
java

Deletes this database.

Returns

void

Code examples
database.delete()
java

name

@CheckReturnValue
java.lang.String name()
java

The database name as a string.

Returns

java.lang.String

schema

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

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

Returns

java.lang.String

Code examples
database.schema()
java

typeSchema

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

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

Returns

java.lang.String

Code examples
database.typeSchema()
java

UserManager

Package: com.typedb.driver.api.user

Provides access to all user management methods.

all

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

Retrieves all users which exist on the TypeDB server.

Returns

java.util.Set<User>

Code examples
driver.users().all();
java

contains

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

Checks if a user with the given name exists.

Input parameters
Name Description Type

username

The user name to be checked

java.lang.String

Returns

boolean

Code examples
driver.users().contains(username);
java

create

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

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
driver.users().create(username, password);
java

get

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

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
driver.users().get(username);
java

getCurrentUser

@CheckReturnValue
User getCurrentUser()
             throws TypeDBDriverException
java

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

Returns

User

Code examples
driver.users().getCurrentUsername();
java

User

Package: com.typedb.driver.api.user

TypeDB user information

delete

void delete()
java

Deletes a user with the given name.

Returns

void

Code examples
driver.users().delete(username);
java

name

@CheckReturnValue
java.lang.String name()
java

Returns the name of this user.

Returns

java.lang.String

updatePassword

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

Updates the password for this user.

Input parameters
Name Description Type

passwordOld

The current password of this user

passwordNew

The new password

Returns

void

Transaction

Transaction

Package: com.typedb.driver.api

Superinterfaces:

  • java.lang.AutoCloseable

close

void close()
    throws TypeDBDriverException
java

Closes the transaction.

Returns

void

Code examples
transaction.close()
java

commit

void commit()
     throws TypeDBDriverException
java

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
transaction.commit()
java

getType

@CheckReturnValue
Transaction.Type getType()
java

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

Returns

Transaction.Type

Code examples
transaction.getType();
java

isOpen

@CheckReturnValue
boolean isOpen()
java

Checks whether this transaction is open.

Returns

boolean

Code examples
transaction.isOpen();
java

onClose

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

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
transaction.onClose(function);
java

options

@CheckReturnValue
TransactionOptions options()
java

The options for the transaction

Returns

TransactionOptions

query

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

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
transaction.query("define entity person;");
java

query

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

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
transaction.query("define entity person;");
java

rollback

void rollback()
       throws TypeDBDriverException
java

Rolls back the uncommitted changes made via this transaction.

Returns

void

Code examples
transaction.rollback()
java

Transaction.Type

Package: com.typedb.driver.api

Used to specify the type of transaction.

Examples
driver.transaction(dbName, TransactionType.READ);
java
Enum constants
Name

READ

SCHEMA

WRITE

id

public int id()
java
Returns

public int

isRead

public boolean isRead()
java
Returns

public boolean

isSchema

public boolean isSchema()
java
Returns

public boolean

isWrite

public boolean isWrite()
java
Returns

public boolean

valueOf

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

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

values

public static Transaction.Type[] values()
java

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:

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

public static Transaction.Type[]

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

Answer

QueryAnswer

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.

asConceptDocuments

default ConceptDocumentIterator asConceptDocuments()
java

Casts the query answer to ConceptDocumentIterator.

Returns

ConceptDocumentIterator

Code examples
concept.asConceptDocuments();
java

asConceptRows

default ConceptRowIterator asConceptRows()
java

Casts the query answer to ConceptRowIterator.

Returns

ConceptRowIterator

Code examples
concept.asConceptRows();
java

asOk

default OkQueryAnswer asOk()
java

Casts the query answer to OkQueryAnswer.

Returns

OkQueryAnswer

Code examples
concept.asOk();
java

getQueryType

@CheckReturnValue
QueryType getQueryType()
java

Retrieves the executed query’s type of this QueryAnswer.

Returns

QueryType

Code examples
queryAnswer.getQueryType();
java

isConceptDocuments

@CheckReturnValue
default boolean isConceptDocuments()
java

Checks if the query answer is a ConceptDocumentIterator.

Returns

boolean

Code examples
concept.isConceptDocuments();
java

isConceptRows

@CheckReturnValue
default boolean isConceptRows()
java

Checks if the query answer is a ConceptRowIterator.

Returns

boolean

Code examples
concept.isConceptRows();
java

isOk

@CheckReturnValue
default boolean isOk()
java

Checks if the query answer is an Ok.

Returns

boolean

Code examples
concept.isOk();
java

OkQueryAnswer

Package: com.typedb.driver.api.answer

Superinterfaces:

  • QueryAnswer

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

asConceptDocuments

default ConceptDocumentIterator asConceptDocuments()
java

Casts the query answer to ConceptDocumentIterator.

Returns

ConceptDocumentIterator

Code examples
concept.asConceptDocuments();
java

asConceptRows

default ConceptRowIterator asConceptRows()
java

Casts the query answer to ConceptRowIterator.

Returns

ConceptRowIterator

Code examples
concept.asConceptRows();
java

asOk

@CheckReturnValue
default OkQueryAnswer asOk()
java

Casts the query answer to OkQueryAnswer.

Returns

OkQueryAnswer

Code examples
concept.asOk();
java

getQueryType

@CheckReturnValue
QueryType getQueryType()
java

Retrieves the executed query’s type of this QueryAnswer.

Returns

QueryType

Code examples
queryAnswer.getQueryType();
java

isConceptDocuments

@CheckReturnValue
default boolean isConceptDocuments()
java

Checks if the query answer is a ConceptDocumentIterator.

Returns

boolean

Code examples
concept.isConceptDocuments();
java

isConceptRows

@CheckReturnValue
default boolean isConceptRows()
java

Checks if the query answer is a ConceptRowIterator.

Returns

boolean

Code examples
concept.isConceptRows();
java

isOk

default boolean isOk()
java

Checks if the query answer is an Ok.

Returns

boolean

Code examples
concept.isOk();
java

ConceptRowIterator

Package: com.typedb.driver.api.answer

Superinterfaces:

  • java.util.Iterator<ConceptRow>

  • QueryAnswer

Represents an iterator over ConceptRows returned as a server answer.

asConceptRows

@CheckReturnValue
default ConceptRowIterator asConceptRows()
java

Casts the query answer to ConceptRowIterator.

Returns

ConceptRowIterator

Code examples
concept.asConceptRows();
java

isConceptRows

default boolean isConceptRows()
java

Checks if the query answer is a ConceptRowIterator.

Returns

boolean

Code examples
concept.isConceptRows();
java

stream

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

Creates a stream over ConceptRows based on this iterator.

Returns

java.util.stream.Stream<ConceptRow>

Code examples
answer.asConceptRows().stream();
java

ConceptRow

Package: com.typedb.driver.api.answer

Contains a row of concepts with a header.

columnNames

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

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
conceptRow.columnNames();
java

concepts

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

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

Returns

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

Code examples
conceptRow.concepts();
java

get

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

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
conceptRow.get(columnName);
java

getIndex

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

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
conceptRow.getIndex(columnIndex);
java

getQueryType

@CheckReturnValue
QueryType getQueryType()
java

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

Returns

QueryType

Code examples
conceptRow.getQueryType();
java

ConceptDocumentIterator

Package: com.typedb.driver.api.answer

Superinterfaces:

  • java.util.Iterator<JSON>

  • QueryAnswer

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

asConceptDocuments

@CheckReturnValue
default ConceptDocumentIterator asConceptDocuments()
java

Casts the query answer to ConceptDocumentIterator.

Returns

ConceptDocumentIterator

Code examples
concept.asConceptDocuments();
java

isConceptDocuments

default boolean isConceptDocuments()
java

Checks if the query answer is a ConceptDocumentIterator.

Returns

boolean

Code examples
concept.isConceptDocuments();
java

stream

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

java.util.stream.Stream<JSON>

JSON

Package: com.typedb.driver.api.answer

JSON

public JSON()
java
Returns

public

asArray

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

public java.util.List<JSON>

asBoolean

public boolean asBoolean()
java
Returns

public boolean

asNumber

public double asNumber()
java
Returns

public double

asObject

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

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

asString

public java.lang.String asString()
java
Returns

public java.lang.String

isArray

public boolean isArray()
java
Returns

public boolean

isBoolean

public boolean isBoolean()
java
Returns

public boolean

isNumber

public boolean isNumber()
java
Returns

public boolean

isObject

public boolean isObject()
java
Returns

public boolean

isString

public boolean isString()
java
Returns

public boolean

parse

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

public static JSON

QueryType

Package: com.typedb.driver.api

Used to specify the type of the executed query.

Examples
conceptRow.queryType();
java
Enum constants
Name

READ

SCHEMA

WRITE

id

public int id()
java
Returns

public int

isRead

public boolean isRead()
java
Returns

public boolean

isSchema

public boolean isSchema()
java
Returns

public boolean

isWrite

public boolean isWrite()
java
Returns

public boolean

of

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

public static QueryType

valueOf

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

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

values

public static QueryType[] values()
java

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:

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

public static QueryType[]

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

Promise<T>

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

Promise

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

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
new Promise(supplier)
java

map

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

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
Promise.map(supplier, mapper);
java

resolve

public T resolve()
java

Retrieves the result of the Promise.

Returns

public T

Code examples
promise.resolve()
java

Concept

Concept

Package: com.typedb.driver.api.concept

Fields
Name Type Description

DECIMAL_SCALE

static int

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Schema

Type

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

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

@CheckReturnValue
default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

EntityType

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.

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

@CheckReturnValue
default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

RelationType

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.

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

@CheckReturnValue
default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

RoleType

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.

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

@CheckReturnValue
default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

AttributeType

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.

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

@CheckReturnValue
default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Data

Instance

Package: com.typedb.driver.api.concept.instance

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

@CheckReturnValue
default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
instance.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

getType

@CheckReturnValue
Type getType()
java

Retrieves the type which this Instance belongs to.

Returns

Type

Code examples
instance.getType();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is a Instance.

Returns

boolean

Code examples
instance.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Entity

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.

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

@CheckReturnValue
default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
entity.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getIID

@CheckReturnValue
java.lang.String getIID()
java

Retrieves the unique id of the Entity.

Returns

java.lang.String

Code examples
entity.getIID();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

getType

@CheckReturnValue
EntityType getType()
java

Retrieves the type which this Entity belongs to.

Returns

EntityType

Code examples
entity.getType();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
entity.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Relation

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.

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asRelation

@CheckReturnValue
default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
relation.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getIID

@CheckReturnValue
java.lang.String getIID()
java

Retrieves the unique id of the Relation.

Returns

java.lang.String

Code examples
relation.getIID();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

getType

@CheckReturnValue
RelationType getType()
java

Retrieves the type which this Relation belongs to.

Returns

RelationType

Code examples
relation.getType();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
relation.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Attribute

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.

asAttribute

@CheckReturnValue
default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

getBoolean

boolean getBoolean()
java

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
attribute.getBoolean();
java

getDate

java.time.LocalDate getDate()
java

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
attribute.getDate();
java

getDatetime

java.time.LocalDateTime getDatetime()
java

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
attribute.getDatetime();
java

getDatetimeTZ

java.time.ZonedDateTime getDatetimeTZ()
java

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
attribute.getDatetimeTZ();
java

getDecimal

java.math.BigDecimal getDecimal()
java

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
attribute.getDecimal();
java

getDouble

double getDouble()
java

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
attribute.getDouble();
java

getDuration

Duration getDuration()
java

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
attribute.getDuration();
java

getInteger

long getInteger()
java

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
attribute.getInteger();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

getString

java.lang.String getString()
java

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
attribute.getString();
java

getStruct

java.util.Map<java.lang.String,java.util.Optional<Value>> getStruct()
java

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
attribute.getStruct();
java

getType

@CheckReturnValue
AttributeType getType()
java

Retrieves the type which this Attribute belongs to.

Returns

AttributeType

Code examples
attribute.getType();
java

getValue

@CheckReturnValue
Value getValue()
java

Retrieves the value which the Attribute instance holds.

Returns

Value

Code examples
attribute.getValue();
java

getValueType

@CheckReturnValue
java.lang.String getValueType()
java

Retrieves the description of the value type of the value which the Attribute instance holds.

Returns

java.lang.String

Code examples
attribute.getValueType();
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

@CheckReturnValue
default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Value

Package: com.typedb.driver.api.concept.value

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()
java

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();
java

asAttributeType

default AttributeType asAttributeType()
java

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();
java

asEntity

default Entity asEntity()
java

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();
java

asEntityType

default EntityType asEntityType()
java

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();
java

asInstance

default Instance asInstance()
java

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();
java

asRelation

default Relation asRelation()
java

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();
java

asRelationType

default RelationType asRelationType()
java

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();
java

asRoleType

default RoleType asRoleType()
java

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();
java

asType

default Type asType()
java

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();
java

asValue

default Value asValue()
java

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();
java

get

java.lang.Object get()
java

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
value.get();
java

getBoolean

boolean getBoolean()
java

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

Returns

boolean

Code examples
value.getBoolean();
java

getDate

java.time.LocalDate getDate()
java

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

Returns

java.time.LocalDate

Code examples
value.getDate();
java

getDatetime

java.time.LocalDateTime getDatetime()
java

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

Returns

java.time.LocalDateTime

Code examples
value.getDatetime();
java

getDatetimeTZ

java.time.ZonedDateTime getDatetimeTZ()
java

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

Returns

java.time.ZonedDateTime

Code examples
value.getDatetimeTZ();
java

getDecimal

java.math.BigDecimal getDecimal()
java

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

Returns

java.math.BigDecimal

Code examples
value.getDecimal();
java

getDouble

double getDouble()
java

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

Returns

double

Code examples
value.getDouble();
java

getDuration

Duration getDuration()
java

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

Returns

Duration

Code examples
value.getDuration();
java

getInteger

long getInteger()
java

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

Returns

long

Code examples
value.getInteger();
java

getLabel

@CheckReturnValue
java.lang.String getLabel()
java

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
concept.getLabel();
java

getString

java.lang.String getString()
java

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

Returns

java.lang.String

Code examples
value.getString();
java

getStruct

java.util.Map<java.lang.String,java.util.Optional<Value>> getStruct()
java

Returns a struct value of this value concept 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
value.getStruct();
java

getType

java.lang.String getType()
java

Retrieves the String describing the value type of this Value concept.

Returns

java.lang.String

Code examples
value.getType()
java

isAttribute

@CheckReturnValue
default boolean isAttribute()
java

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();
java

isAttributeType

@CheckReturnValue
default boolean isAttributeType()
java

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();
java

isBoolean

@CheckReturnValue
boolean isBoolean()
java

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
concept.isBoolean()
java

isDate

@CheckReturnValue
boolean isDate()
java

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
concept.isDate();
java

isDatetime

@CheckReturnValue
boolean isDatetime()
java

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
concept.isDatetime();
java

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()
java

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
concept.isDatetimeTZ();
java

isDecimal

@CheckReturnValue
boolean isDecimal()
java

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
concept.isDecimal();
java

isDouble

@CheckReturnValue
boolean isDouble()
java

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
concept.isDouble();
java

isDuration

@CheckReturnValue
boolean isDuration()
java

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
concept.isDuration();
java

isEntity

@CheckReturnValue
default boolean isEntity()
java

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();
java

isEntityType

@CheckReturnValue
default boolean isEntityType()
java

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();
java

isInstance

@CheckReturnValue
default boolean isInstance()
java

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();
java

isInteger

@CheckReturnValue
boolean isInteger()
java

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
concept.isInteger();
java

isRelation

@CheckReturnValue
default boolean isRelation()
java

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();
java

isRelationType

@CheckReturnValue
default boolean isRelationType()
java

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();
java

isRoleType

@CheckReturnValue
default boolean isRoleType()
java

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();
java

isString

@CheckReturnValue
boolean isString()
java

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
concept.isString();
java

isStruct

@CheckReturnValue
boolean isStruct()
java

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
concept.isStruct();
java

isType

@CheckReturnValue
default boolean isType()
java

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();
java

isValue

default boolean isValue()
java

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();
java

tryGetBoolean

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

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

Returns

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

Code examples
concept.tryGetBoolean();
java

tryGetDate

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

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

Returns

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

Code examples
concept.tryGetDate();
java

tryGetDatetime

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

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

Returns

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

Code examples
concept.tryGetDatetime();
java

tryGetDatetimeTZ

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

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

Returns

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

Code examples
concept.tryGetDatetimeTZ();
java

tryGetDecimal

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

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

Returns

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

Code examples
concept.tryGetDecimal();
java

tryGetDouble

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

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

Returns

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

Code examples
concept.tryGetDouble();
java

tryGetDuration

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

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

Returns

java.util.Optional<Duration>

Code examples
concept.tryGetDuration();
java

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();
java

tryGetInteger

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

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

Returns

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

Code examples
concept.tryGetInteger();
java

tryGetLabel

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

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
concept.tryGetLabel();
java

tryGetString

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

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

Returns

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

Code examples
concept.tryGetString();
java

tryGetStruct

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

Returns a struct value of this Concept. 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
concept.tryGetStruct();
java

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();
java

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();
java

Value

Duration

Package: com.typedb.driver.common

equals

public boolean equals​(java.lang.Object obj)
java

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
label.equals(obj);
java

getDatePart

public java.time.Period getDatePart()
java

Returns the date part of this duration.

Returns

public java.time.Period

Code examples
duration.getDatePart();
java

getDays

public int getDays()
java

Returns the amount of days of this Duration from the date part.

Returns

public int

Code examples
duration.getMonths();
java

getMonths

public int getMonths()
java

Returns the amount of months of this Duration from the date part.

Returns

public int

Code examples
duration.getMonths();
java

getNano

public long getNano()
java

Returns the number of nanoseconds within the second in this Duration from the time part.

Returns

public long

Code examples
duration.getNano();
java

getSeconds

public long getSeconds()
java

Returns the amount of seconds of this Duration from the time part.

Returns

public long

Code examples
duration.getSeconds();
java

getTimePart

public java.time.Duration getTimePart()
java

Returns the time part of this duration.

Returns

public java.time.Duration

Code examples
duration.getTimePart();
java

parse

public static Duration parse​(java.lang.String durationString)
java

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
Duration.parse("P1Y10M7DT15H44M5.00394892S");
     Duration.parse("P55W");
java

toString

public java.lang.String toString()
java

Returns the string representation of the duration.

Returns

public java.lang.String

Code examples
duration.toString();
java

Errors

TypeDBDriverException

Package: com.typedb.driver.common.exception

Exceptions raised by the driver.

getErrorMessage

@Nullable
public com.typedb.driver.common.exception.ErrorMessage getErrorMessage()
java
Returns

public com.typedb.driver.common.exception.ErrorMessage

getName

public java.lang.String getName()
java
Returns

public java.lang.String