use of com.vaticle.typedb.core.concept.type.AttributeType 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));
}
use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_owns_key_type_throws_exception.
@Then("{root_label}\\( ?{type_label} ?) set owns key type: {type_label}; throws exception")
public void thing_type_set_owns_key_type_throws_exception(RootLabel rootLabel, String typeLabel, String attributeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
assertThrows(() -> 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_throws_exception.
@Then("{root_label}\\( ?{type_label} ?) set owns key type: {type_label} as {type_label}; throws exception")
public void thing_type_set_owns_key_type_as_throws_exception(RootLabel rootLabel, String typeLabel, String attributeLabel, String overriddenLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
AttributeType overriddenType = tx().concepts().getAttributeType(overriddenLabel);
assertThrows(() -> 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 ThingTypeSteps method thing_type_unset_owns_key_type.
@When("{root_label}\\( ?{type_label} ?) unset owns key type: {type_label}")
public void thing_type_unset_owns_key_type(RootLabel rootLabel, String typeLabel, String attributeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
get_thing_type(rootLabel, typeLabel).unsetOwns(attributeType);
}
use of com.vaticle.typedb.core.concept.type.AttributeType in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_unset_owns_attribute_type.
@When("{root_label}\\( ?{type_label} ?) unset owns attribute type: {type_label}")
public void thing_type_unset_owns_attribute_type(RootLabel rootLabel, String typeLabel, String attributeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
get_thing_type(rootLabel, typeLabel).unsetOwns(attributeType);
}
Aggregations