Search in sources :

Example 16 with ThingType

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

the class AttributeTypeSteps method attribute_type_as_value_type_get_subtypes_do_not_contain.

@Then("attribute\\( ?{type_label} ?) as\\( ?{value_type} ?) get subtypes do not contain:")
public void attribute_type_as_value_type_get_subtypes_do_not_contain(String typeLabel, AttributeType.ValueType valueType, List<String> subLabels) {
    AttributeType attributeType = attribute_type_as_value_type(typeLabel, valueType);
    Set<String> actuals = attributeType.getSubtypes().map(ThingType::getLabel).map(Label::toString).toSet();
    for (String subLabel : subLabels) {
        assertFalse(actuals.contains(subLabel));
    }
}
Also used : AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) ThingType(com.vaticle.typedb.core.concept.type.ThingType) Then(io.cucumber.java.en.Then)

Example 17 with ThingType

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

the class AttributeTypeSteps method attribute_type_get_owners_as_attribute_contains.

@Then("attribute\\( ?{type_label} ?) get attribute owners contain:")
public void attribute_type_get_owners_as_attribute_contains(String typeLabel, List<String> ownerLabels) {
    AttributeType attributeType = tx().concepts().getAttributeType(typeLabel);
    Set<String> actuals = attributeType.getOwners(false).map(ThingType::getLabel).map(Label::toString).toSet();
    assertTrue(actuals.containsAll(ownerLabels));
}
Also used : AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) ThingType(com.vaticle.typedb.core.concept.type.ThingType) Then(io.cucumber.java.en.Then)

Aggregations

ThingType (com.vaticle.typedb.core.concept.type.ThingType)17 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)11 Then (io.cucumber.java.en.Then)8 ThreadTrace (com.vaticle.factory.tracing.client.FactoryTracingThreadStatic.ThreadTrace)6 RoleType (com.vaticle.typedb.core.concept.type.RoleType)6 LabelConstraint (com.vaticle.typedb.core.pattern.constraint.type.LabelConstraint)5 TypeDBException (com.vaticle.typedb.core.common.exception.TypeDBException)3 RelationType (com.vaticle.typedb.core.concept.type.RelationType)3 List (java.util.List)3 FactoryTracingThreadStatic.traceOnThread (com.vaticle.factory.tracing.client.FactoryTracingThreadStatic.traceOnThread)2 TypeDB (com.vaticle.typedb.core.TypeDB)2 TYPE_NOT_FOUND (com.vaticle.typedb.core.common.exception.ErrorMessage.TypeRead.TYPE_NOT_FOUND)2 OVERRIDDEN_NOT_SUPERTYPE (com.vaticle.typedb.core.common.exception.ErrorMessage.TypeWrite.OVERRIDDEN_NOT_SUPERTYPE)2 ROLE_DEFINED_OUTSIDE_OF_RELATION (com.vaticle.typedb.core.common.exception.ErrorMessage.TypeWrite.ROLE_DEFINED_OUTSIDE_OF_RELATION)2 ValueType (com.vaticle.typedb.core.concept.type.AttributeType.ValueType)2 EntityType (com.vaticle.typedb.core.concept.type.EntityType)2 Type (com.vaticle.typedb.core.concept.type.Type)2 Consumer (java.util.function.Consumer)2 UNRECOGNISED_VALUE (com.vaticle.typedb.core.common.exception.ErrorMessage.Internal.UNRECOGNISED_VALUE)1 RULE_NOT_FOUND (com.vaticle.typedb.core.common.exception.ErrorMessage.RuleRead.RULE_NOT_FOUND)1