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()
Returns

public

driver

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

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

Input parameters
Name Description Type

address

The address of the TypeDB server

java.lang.String

credentials

The credentials to connect with

Credentials

driverOptions

The connection settings to connect with

DriverOptions

Returns

public static Driver

Code examples
TypeDB.driver(address);

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/connection/TypeDBDriver.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/connection/TypeDBCredential.adoc[]

DatabaseManager

Package: com.typedb.driver.api.database

Provides access to all database management methods.

all

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

Retrieves all databases present on the TypeDB server

Returns

java.util.List<Database>

Code examples
driver.databases().all()

contains

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

Checks if a database with the given name exists

Input parameters
Name Description Type

name

The database name to be checked

java.lang.String

Returns

boolean

Code examples
driver.databases().contains(name)

create

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

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)

get

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

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)

Database

Package: com.typedb.driver.api.database

delete

void delete()
     throws TypeDBDriverException

Deletes this database.

Returns

void

Code examples
database.delete()

name

@CheckReturnValue
java.lang.String name()

The database name as a string.

Returns

java.lang.String

schema

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

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

Returns

java.lang.String

Code examples
database.schema()

typeSchema

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

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

Returns

java.lang.String

Code examples
database.typeSchema()

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/connection/Database.Replica.adoc[]

UserManager

Package: com.typedb.driver.api.user

Provides access to all user management methods.

all

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

Retrieves all users which exist on the TypeDB server.

Returns

java.util.Set<User>

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

contains

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

Checks if a user with the given name exists.

Input parameters
Name Description Type

username

The user name to be checked

java.lang.String

Returns

boolean

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

create

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

Creates a user with the given name & password.

Input parameters
Name Description Type

username

The name of the user to be created

java.lang.String

password

The password of the user to be created

java.lang.String

Returns

void

Code examples
driver.users().create(username, password);

get

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

Retrieves a user with the given name.

Input parameters
Name Description Type

username

The name of the user to retrieve

java.lang.String

Returns

User

Code examples
driver.users().get(username);

getCurrentUser

@CheckReturnValue
User getCurrentUser()
             throws TypeDBDriverException

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

Returns

User

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

User

Package: com.typedb.driver.api.user

TypeDB user information

delete

void delete()

Deletes a user with the given name.

Returns

void

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

name

@CheckReturnValue
java.lang.String name()

Returns the name of this user.

Returns

java.lang.String

updatePassword

void updatePassword​(java.lang.String password)

Updates the password for this user.

Input parameters
Name Description Type

passwordOld

The current password of this user

passwordNew

The new password

Returns

void

Session

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/session/TypeDBSession.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/session/TypeDBSession.Type.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/session/TypeDBOptions.adoc[]

Transaction

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/transaction/TypeDBTransaction.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/transaction/TypeDBTransaction.Type.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/transaction/QueryManager.adoc[]

Answer

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMapGroup.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMap.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ValueGroup.adoc[]

JSON

Package: com.typedb.driver.api.answer

JSON

public JSON()
Returns

public

asArray

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

public java.util.List<JSON>

asBoolean

public boolean asBoolean()
Returns

public boolean

asNumber

public double asNumber()
Returns

public double

asObject

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

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

asString

public java.lang.String asString()
Returns

public java.lang.String

isArray

public boolean isArray()
Returns

public boolean

isBoolean

public boolean isBoolean()
Returns

public boolean

isNumber

public boolean isNumber()
Returns

public boolean

isObject

public boolean isObject()
Returns

public boolean

isString

public boolean isString()
Returns

public boolean

parse

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

public static JSON

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)

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)

map

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

Helper function to map promises.

Input parameters
Name Description Type

promise

The supplier function to wrap into the promise

java.util.function.Supplier<T>

fn

The mapping function

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

Returns

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

Code examples
Promise.map(supplier, mapper);

resolve

public T resolve()

Retrieves the result of the Promise.

Returns

public T

Code examples
promise.resolve()

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMap.Explainables.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/ConceptMap.Explainable.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/answer/Explanation.adoc[]

Concept

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/concept/ConceptManager.adoc[]

Concept

Package: com.typedb.driver.api.concept

Fields
Name Type Description

DECIMAL_SCALE

static int

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

Schema

Type

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

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

@CheckReturnValue
default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/Label.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/ThingType.adoc[]

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

@CheckReturnValue
default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

@CheckReturnValue
default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

@CheckReturnValue
default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

@CheckReturnValue
default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/ThingType.Annotation.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/Concept.Transitivity.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/schema/Value.Type.adoc[]

Data

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/data/Thing.adoc[]

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

@CheckReturnValue
default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
entity.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getIID

@CheckReturnValue
java.lang.String getIID()

Retrieves the unique id of the Entity.

Returns

java.lang.String

Code examples
entity.getIID();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

getType

@CheckReturnValue
EntityType getType()

Retrieves the type which this Entity belongs to.

Returns

EntityType

Code examples
entity.getType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
entity.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asRelation

@CheckReturnValue
default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
relation.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getIID

@CheckReturnValue
java.lang.String getIID()

Retrieves the unique id of the Relation.

Returns

java.lang.String

Code examples
relation.getIID();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

getType

@CheckReturnValue
RelationType getType()

Retrieves the type which this Relation belongs to.

Returns

RelationType

Code examples
relation.getType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
relation.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

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()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

getBoolean

boolean getBoolean()

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

Returns

boolean

Code examples
attribute.getBoolean();

getDate

java.time.LocalDate getDate()

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

Returns

java.time.LocalDate

Code examples
attribute.getDate();

getDatetime

java.time.LocalDateTime getDatetime()

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

Returns

java.time.LocalDateTime

Code examples
attribute.getDatetime();

getDatetimeTZ

java.time.ZonedDateTime getDatetimeTZ()

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

Returns

java.time.ZonedDateTime

Code examples
attribute.getDatetimeTZ();

getDecimal

java.math.BigDecimal getDecimal()

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

Returns

java.math.BigDecimal

Code examples
attribute.getDecimal();

getDouble

double getDouble()

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

Returns

double

Code examples
attribute.getDouble();

getDuration

Duration getDuration()

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

Returns

Duration

Code examples
attribute.getDuration();

getInteger

long getInteger()

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

Returns

long

Code examples
attribute.getInteger();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

getString

java.lang.String getString()

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

Returns

java.lang.String

Code examples
attribute.getString();

getStruct

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

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

Returns

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

Code examples
attribute.getStruct();

getType

@CheckReturnValue
AttributeType getType()

Retrieves the type which this Attribute belongs to.

Returns

AttributeType

Code examples
attribute.getType();

getValue

@CheckReturnValue
Value getValue()

Retrieves the value which the Attribute instance holds.

Returns

Value

Code examples
attribute.getValue();

getValueType

@CheckReturnValue
java.lang.String getValueType()

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

Returns

java.lang.String

Code examples
attribute.getValueType();

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

@CheckReturnValue
default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

Value

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

Superinterfaces:

  • Concept

asAttribute

default Attribute asAttribute()

Casts the concept to Attribute.

Returns

Attribute

Code examples
concept.asAttribute();

asAttributeType

default AttributeType asAttributeType()

Casts the concept to AttributeType.

Returns

AttributeType

Code examples
concept.asAttributeType();

asEntity

default Entity asEntity()

Casts the concept to Entity.

Returns

Entity

Code examples
concept.asEntity();

asEntityType

default EntityType asEntityType()

Casts the concept to EntityType.

Returns

EntityType

Code examples
concept.asEntityType();

asInstance

default Instance asInstance()

Casts the concept to Instance.

Returns

Instance

Code examples
concept.asInstance();

asRelation

default Relation asRelation()

Casts the concept to Relation.

Returns

Relation

Code examples
concept.asRelation();

asRelationType

default RelationType asRelationType()

Casts the concept to RelationType.

Returns

RelationType

Code examples
concept.asRelationType();

asRoleType

default RoleType asRoleType()

Casts the concept to RoleType.

Returns

RoleType

Code examples
concept.asRoleType();

asType

default Type asType()

Casts the concept to Type.

Returns

Type

Code examples
concept.asType();

asValue

default Value asValue()

Casts the concept to Value.

Returns

Value

Code examples
concept.asValue();

get

java.lang.Object get()

Returns an untyped Object value of this value concept. This is useful for value equality or printing without having to switch on the actual contained value.

Returns

java.lang.Object

Code examples
value.get();

getBoolean

boolean getBoolean()

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

Returns

boolean

Code examples
value.getBoolean();

getDate

java.time.LocalDate getDate()

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();

getDatetime

java.time.LocalDateTime getDatetime()

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();

getDatetimeTZ

java.time.ZonedDateTime getDatetimeTZ()

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();

getDecimal

java.math.BigDecimal getDecimal()

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();

getDouble

double getDouble()

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

Returns

double

Code examples
value.getDouble();

getDuration

Duration getDuration()

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

Returns

Duration

Code examples
value.getDuration();

getInteger

long getInteger()

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

Returns

long

Code examples
value.getInteger();

getLabel

@CheckReturnValue
java.lang.String getLabel()

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

Returns

java.lang.String

Code examples
concept.getLabel();

getString

java.lang.String getString()

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();

getStruct

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

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();

getType

java.lang.String getType()

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

Returns

java.lang.String

Code examples
value.getType()

isAttribute

@CheckReturnValue
default boolean isAttribute()

Checks if the concept is an Attribute.

Returns

boolean

Code examples
concept.isAttribute();

isAttributeType

@CheckReturnValue
default boolean isAttributeType()

Checks if the concept is an AttributeType.

Returns

boolean

Code examples
concept.isAttributeType();

isBoolean

@CheckReturnValue
boolean isBoolean()

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

Returns

boolean

Code examples
concept.isBoolean()

isDate

@CheckReturnValue
boolean isDate()

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

Returns

boolean

Code examples
concept.isDate();

isDatetime

@CheckReturnValue
boolean isDatetime()

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

Returns

boolean

Code examples
concept.isDatetime();

isDatetimeTZ

@CheckReturnValue
boolean isDatetimeTZ()

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

Returns

boolean

Code examples
concept.isDatetimeTZ();

isDecimal

@CheckReturnValue
boolean isDecimal()

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

Returns

boolean

Code examples
concept.isDecimal();

isDouble

@CheckReturnValue
boolean isDouble()

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

Returns

boolean

Code examples
concept.isDouble();

isDuration

@CheckReturnValue
boolean isDuration()

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

Returns

boolean

Code examples
concept.isDuration();

isEntity

@CheckReturnValue
default boolean isEntity()

Checks if the concept is an Entity.

Returns

boolean

Code examples
concept.isEntity();

isEntityType

@CheckReturnValue
default boolean isEntityType()

Checks if the concept is an EntityType.

Returns

boolean

Code examples
concept.isEntityType();

isInstance

@CheckReturnValue
default boolean isInstance()

Checks if the concept is an Instance.

Returns

boolean

Code examples
concept.isInstance();

isInteger

@CheckReturnValue
boolean isInteger()

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

Returns

boolean

Code examples
concept.isInteger();

isRelation

@CheckReturnValue
default boolean isRelation()

Checks if the concept is a Relation.

Returns

boolean

Code examples
concept.isRelation();

isRelationType

@CheckReturnValue
default boolean isRelationType()

Checks if the concept is a RelationType.

Returns

boolean

Code examples
concept.isRelationType();

isRoleType

@CheckReturnValue
default boolean isRoleType()

Checks if the concept is a RoleType.

Returns

boolean

Code examples
concept.isRoleType();

isString

@CheckReturnValue
boolean isString()

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

Returns

boolean

Code examples
concept.isString();

isStruct

@CheckReturnValue
boolean isStruct()

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

Returns

boolean

Code examples
concept.isStruct();

isType

@CheckReturnValue
default boolean isType()

Checks if the concept is a Type.

Returns

boolean

Code examples
concept.isType();

isValue

default boolean isValue()

Checks if the concept is a Value.

Returns

boolean

Code examples
concept.isValue();

tryGetBoolean

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

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();

tryGetDate

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

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();

tryGetDatetime

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

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();

tryGetDatetimeTZ

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

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();

tryGetDecimal

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

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();

tryGetDouble

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

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();

tryGetDuration

java.util.Optional<Duration> tryGetDuration()

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();

tryGetIID

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

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

Returns

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

Code examples
concept.tryGetIID();

tryGetInteger

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

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();

tryGetLabel

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

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

Returns

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

Code examples
concept.tryGetLabel();

tryGetString

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

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();

tryGetStruct

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

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();

tryGetValue

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

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

Returns

java.util.Optional<Value>

Code examples
concept.tryGetValue();

tryGetValueType

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

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

Returns

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

Code examples
concept.tryGetValueType();

Logic

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/logic/LogicManager.adoc[]

Unresolved include directive in modules/ROOT/partials/java/api-reference.adoc - include::api-ref::partial$java/logic/Rule.adoc[]

Errors

TypeDBDriverException

Package: com.typedb.driver.common.exception

Exceptions raised by the driver.

getErrorMessage

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

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

getName

public java.lang.String getName()
Returns

public java.lang.String