def step_impl(context: Context, root_label: RootLabel, type_label: str, att_type_label: str): attribute_type = context.tx().concepts().get_attribute_type(att_type_label) context.get_thing_type(root_label, type_label).as_remote( context.tx()).set_owns(attribute_type)
def step_impl(context: Context, type_label: str): assert_that( calling(context.tx().concepts().get_entity_type(type_label).as_remote( context.tx()).create), raises(TypeDBClientException))
def step_impl(context: Context, type_label: str, var: str): assert_that( context.tx().concepts().get_entity_type(type_label).as_remote( context.tx()).get_instances(), has_item(context.get(var)))
def step_impl(context: Context): context.tx().query().delete(query=context.text)
def step_impl(context: Context, exception: str): assert_that(calling(next).with_args(context.tx().query().insert(query=context.text)), raises(GraknClientException, exception))
def step_impl(context: Context): context.clear_answers() context.numeric_answer_groups = [group for group in context.tx().query().match_group_aggregate(query=context.text)]
def step_impl(context: Context): context.tx().query().undefine(query=context.text)
def step_impl(context: Context, var1: str, role_label: str, var2: str): relation = context.get(var1).as_relation() relation.as_remote(context.tx()).add_player( relation.get_type().as_remote(context.tx()).get_relates(role_label), context.get(var2))
def step_impl(context: Context): context.tx().commit()
def step_impl(context: Context, var1: str, var2: str): assert_that( context.get(var1).as_relation().as_remote(context.tx()).get_players(), not_(has_item(context.get(var2))))
def step_impl(context: Context, var1: str, role_label: str, var2: str): relation = context.get(var1).as_relation() assert_that( relation.as_remote(context.tx()).get_players(role_types=[ relation.get_type().as_remote(context.tx()).get_relates(role_label) ]), not_(has_item(context.get(var2))))
def step_impl(context: Context, root_label: RootLabel, type_label: str, is_abstract): is_abstract = parse_bool(is_abstract) assert_that( context.get_thing_type(root_label, type_label).as_remote( context.tx()).is_abstract(), is_(is_abstract))
def step_impl(context: Context, root_label: RootLabel, type_label: str, get_label: str): assert_that( context.get_thing_type(root_label, type_label).as_remote( context.tx()).get_label().name(), is_(get_label))
def step_impl(context: Context, root_label: RootLabel, type_label: str, new_label: str): context.get_thing_type(root_label, type_label).as_remote( context.tx()).set_label(new_label)
def step_impl(context: Context): context.clear_answers() context.numeric_answer = next(context.tx().query().match_aggregate(query=context.text))
def step_impl(context: Context): try: context.tx().commit() assert False except GraknClientException: pass
def step_impl(context: Context): context.clear_answers() context.answer_groups = [group for group in context.tx().query().match_group(query=context.text)]
def step_impl(context: Context, exception: str): assert_that(calling(context.tx().commit), raises(GraknClientException, exception))
def step_impl(context: Context): for answer in context.answers: query = apply_query_template(template=context.text, answer=answer) assert_that(list(context.tx().query().match(query)), has_length(1))
def step_impl(context: Context, type_label: str, var: str): assert_that( context.get(var), is_in(context.tx().concepts().get_attribute_type(type_label).as_remote( context.tx()).get_instances()))
def step_impl(context: Context): context.tx().query().insert(query=context.text)
def step_impl(context: Context, var1: str, var2: str): assert_that( context.get(var2), not_(is_in(context.get(var1).as_remote(context.tx()).get_owners())))
def step_impl(context: Context): assert_that(calling(next).with_args(context.tx().query().delete(query=context.text)), raises(GraknClientException))
def step_impl(context: Context, var: str, value_type: ValueType): assert_that( context.get(var).as_remote(context.tx()).get_type().get_value_type(), is_(value_type))
def step_impl(context: Context): context.clear_answers() context.answers = [answer for answer in context.tx().query().insert(query=context.text)]
def step_impl(context: Context, type_label: str, value: int): assert_that( calling( context.tx().concepts().get_attribute_type(type_label).as_remote( context.tx()).put).with_args(value), raises(GraknClientException))
def step_impl(context: Context, var: str, type_label: str): context.put( var, context.tx().concepts().get_entity_type(type_label).as_remote( context.tx()).create())
def step_impl(context: Context, var: str, type_label: str, value: int): context.put( var, context.tx().concepts().get_attribute_type(type_label).as_remote( context.tx()).put(value))
def step_impl(context: Context, type_label: str): assert_that( calling(next).with_args( context.tx().concepts().get_entity_type(type_label).as_remote( context.tx()).get_instances()), raises(StopIteration))
def step_impl(context: Context, root_label: RootLabel, type_label: str, super_label: str): supertype = context.get_thing_type(root_label, super_label) assert_that( context.get_thing_type(root_label, type_label).as_remote( context.tx()).get_supertype(), is_(supertype))