@Override public Collection<PropertyExecutor> undefine(Var var) throws GraqlQueryException { PropertyExecutor.Method method = executor -> { AttributeType<Object> attributeType = executor.get(var).asAttributeType(); if (!attributeType.isDeleted() && regex().equals(attributeType.regex())) { attributeType.regex(null); } }; return ImmutableSet.of(PropertyExecutor.builder(method).requires(var).build()); }
@Override public Collection<PropertyExecutor> undefine(Var var) throws GraqlQueryException { PropertyExecutor.Method method = executor -> { Type type = executor.get(var).asType(); AttributeType<?> attributeType = executor.get(resourceType().var()).asAttributeType(); if (!type.isDeleted() && !attributeType.isDeleted()) { if (required()) { type.unkey(attributeType); } else { type.unhas(attributeType); } } }; return ImmutableSet.of(PropertyExecutor.builder(method).requires(var, resourceType().var()).build()); }