Search in sources :

Example 31 with EntityType

use of com.vaticle.typedb.core.concept.type.EntityType in project grakn by graknlabs.

the class ThingTypeSteps method thing_type_set_supertype.

@When("{root_label}\\( ?{type_label} ?) set supertype: {type_label}")
public void thing_type_set_supertype(RootLabel rootLabel, String typeLabel, String superLabel) {
    switch(rootLabel) {
        case ENTITY:
            EntityType entitySuperType = tx().concepts().getEntityType(superLabel);
            tx().concepts().getEntityType(typeLabel).setSupertype(entitySuperType);
            break;
        case ATTRIBUTE:
            AttributeType attributeSuperType = tx().concepts().getAttributeType(superLabel);
            tx().concepts().getAttributeType(typeLabel).setSupertype(attributeSuperType);
            break;
        case RELATION:
            RelationType relationSuperType = tx().concepts().getRelationType(superLabel);
            tx().concepts().getRelationType(typeLabel).setSupertype(relationSuperType);
            break;
    }
}
Also used : EntityType(com.vaticle.typedb.core.concept.type.EntityType) AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) RelationType(com.vaticle.typedb.core.concept.type.RelationType) When(io.cucumber.java.en.When)

Example 32 with EntityType

use of com.vaticle.typedb.core.concept.type.EntityType in project grakn by graknlabs.

the class ConceptService method putEntityType.

private void putEntityType(String label, UUID reqID) {
    EntityType entityType = conceptMgr.putEntityType(label);
    transactionSvc.respond(putEntityTypeRes(reqID, entityType));
}
Also used : EntityType(com.vaticle.typedb.core.concept.type.EntityType)

Aggregations

EntityType (com.vaticle.typedb.core.concept.type.EntityType)32 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)28 Test (org.junit.Test)28 ConceptManager (com.vaticle.typedb.core.concept.ConceptManager)24 CoreSession (com.vaticle.typedb.core.database.CoreSession)22 CoreTransaction (com.vaticle.typedb.core.database.CoreTransaction)22 RelationType (com.vaticle.typedb.core.concept.type.RelationType)20 ConceptMap (com.vaticle.typedb.core.concept.answer.ConceptMap)16 CoreDatabaseManager (com.vaticle.typedb.core.database.CoreDatabaseManager)14 LogicManager (com.vaticle.typedb.core.logic.LogicManager)10 TypeDB (com.vaticle.typedb.core.TypeDB)6 Options (com.vaticle.typedb.core.common.parameters.Options)5 RoleType (com.vaticle.typedb.core.concept.type.RoleType)5 Entity (com.vaticle.typedb.core.concept.thing.Entity)4 Conjunction (com.vaticle.typedb.core.pattern.Conjunction)4 Variable (com.vaticle.typedb.core.pattern.variable.Variable)4 Identifier (com.vaticle.typedb.core.traversal.common.Identifier)4 ThingVariable (com.vaticle.typeql.lang.pattern.variable.ThingVariable)4 Map (java.util.Map)4 Attribute (com.vaticle.typedb.core.concept.thing.Attribute)3