@Override public Collection<PropertyExecutor> undefine(Var var) throws GraqlQueryException { PropertyExecutor.Method method = executor -> { Type type = executor.get(var).asType(); Role role = executor.get(this.role().var()).asRole(); if (!type.isDeleted() && !role.isDeleted()) { type.unplay(role); } }; return ImmutableSet.of(PropertyExecutor.builder(method).requires(var, role().var()).build()); }
@Override public Collection<PropertyExecutor> undefine(Var var) throws GraqlQueryException { PropertyExecutor.Method method = executor -> { RelationshipType relationshipType = executor.get(var).asRelationshipType(); Role role = executor.get(this.role().var()).asRole(); if (!relationshipType.isDeleted() && !role.isDeleted()) { relationshipType.unrelate(role); } }; return ImmutableSet.of(PropertyExecutor.builder(method).requires(var, role().var()).build()); }