use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_owns_attribute_type.
@When("{root_label}\\( ?{type_label} ?) set owns attribute type: {type_label}")
public void thing_type_set_owns_attribute_type(RootLabel rootLabel, String typeLabel, String attributeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
get_thing_type(rootLabel, typeLabel).setOwns(attributeType);
}
use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_owns_key_type.
@When("{root_label}\\( ?{type_label} ?) set owns key type: {type_label}")
public void thing_type_set_owns_key_type(RootLabel rootLabel, String typeLabel, String attTypeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attTypeLabel);
get_thing_type(rootLabel, typeLabel).setOwns(attributeType, true);
}
use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_owns_key_type_as.
@When("{root_label}\\( ?{type_label} ?) set owns key type: {type_label} as {type_label}")
public void thing_type_set_owns_key_type_as(RootLabel rootLabel, String typeLabel, String attTypeLabel, String overriddenLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attTypeLabel);
AttributeType overriddenType = tx().concepts().getAttributeType(overriddenLabel);
get_thing_type(rootLabel, typeLabel).setOwns(attributeType, overriddenType, true);
}
use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class AttributeTypeSteps method attribute_type_as_value_type_does_not_have_any_regex.
@Then("attribute\\( ?{type_label} ?) as\\( ?{value_type} ?) does not have any regex")
public void attribute_type_as_value_type_does_not_have_any_regex(String typeLabel, AttributeType.ValueType valueType) {
if (!valueType.equals(AttributeType.ValueType.STRING))
fail();
AttributeType attributeType = attribute_type_as_value_type(typeLabel, valueType);
assertNull(attributeType.asString().getRegex());
}
use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class AttributeTypeSteps method attribute_type_get_supertype_value_type.
@Then("attribute\\( ?{type_label} ?) get supertype value type: {value_type}")
public void attribute_type_get_supertype_value_type(String typeLabel, AttributeType.ValueType valueType) {
AttributeType supertype = tx().concepts().getAttributeType(typeLabel).getSupertype().asAttributeType();
assertEquals(valueType, supertype.getValueType());
}
Aggregations