Concept Methods & Props

Concept is inherited and extended by Type, Rule and Thing.

[tab:Java]

Retrieve the identifier

concept.id();

Retrieves the identifier of the concept generated by Grakn.

Returns

ConceptId

Check if concept is a Type

concept.isType();

Returns

boolean

Check if concept is a Thing

concept.isThing();

Returns

boolean

Check if concept is an EntityType

concept.isEntityType();

Returns

boolean

Check if concept is an AttributeType

concept.isAttributeType();

Returns

boolean

Check if concept is a RelationshipType

concept.isRelationshipType();

Returns

boolean

Check if concept is an Entity

concept.isEntity();

Returns

boolean

Check if concept is an Attribute

concept.isAttribute();

Returns

boolean

Check if concept is a Relationship

concept.isRelationship();

Returns

boolean

Cast the concept as Type

concept.asType();

Casts the concept as Type so that we can call the Type methods on it.

Returns

Type object

Cast the concept as Thing

concept.asThing();

Casts the concept as Thing so that we can call the Thing methods on it.

Returns

Thing object

Cast the concept as EntityType

concept.asEntityType();

Casts the concept as EntityType so that we can call the EntityType methods on it.

Returns

EntityType object

Cast the concept as AttributeType

concept.asAttributeType();

Casts the concept as AttributeType so that we can call the AttributeType methods on it.

Returns

AttributeType object

Cast the concept as RelationshipType

concept.asRelationshipType();

Casts the concept as RelationshipType so that we can call the RelationshipType methods on it.

Returns

Cast the concept as AttributeType

concept.asAttributeType();

Casts the concept as AttributeType so that we can call the AttributeType methods on it.

Returns

AttributeType object

Cast the concept as Entity

concept.asEntity();

Casts the concept as Entity so that we can call the Entity methods on it.

Returns

Entity object

Cast the concept as Attribute

concept.asAttribute();

Casts the concept as Attribute so that we can call the Attribute methods on it.

Returns

Attribute object

Cast the concept as Relationship

concept.asRelationship();

Casts the concept as Relationship so that we can call the Relationship methods on it.

Returns

Relationship object

[tab:end] [tab:Javascript]

Retrieve the identifier

concept[“id”];

Retrieves the identifier of the concept generated by Grakn.

Returns

String

Check if concept is a Type

concept.isType();

Returns

boolean

Check if concept is a Thing

concept.isThing();

Returns

boolean

Check if concept is an EntityType

concept.isEntityType();

Returns

boolean

Check if concept is an AttributeType

concept.isAttributeType();

Returns

boolean

Check if concept is a RelationshipType

concept.isRelationshipType();

Returns

boolean

Check if concept is an Entity

concept.isEntity();

Returns

boolean

Check if concept is an Attribute

concept.isAttribute();

Returns

boolean

Check if concept is a Relationship

concept.isRelationship();

Returns

boolean

[tab:end] [tab:Python]

Retrieve the identifier

concept.id

Retrieves the identifier of the concept generated by Grakn.

Returns

String

Check if concept is a Type

concept.is_type()

Returns

boolean

Check if concept is a Thing

concept.is_thing()

Returns

boolean

Check if concept is an EntityType

concept.is_entity_type()

Returns

boolean

Check if concept is an AttributeType

concept.is_attribute_type()

Returns

boolean

Check if concept is a RelationshipType

concept.is_relationship_type()

Returns

boolean

Check if concept is an Entity

concept.is_entity()

Returns

boolean

Check if concept is an Attribute

concept.is_attribute()

Returns

boolean

Check if concept is a Relationship

concept.is_relationship()

Returns

boolean

[tab:end]