public Set<String> getLegallyPositiveEdgeLabels(final Direction direction) {
        if (null == this.edgeFilter)
            return Collections.singleton(null);
        else if (this.allowNoEdges)
            return Collections.emptySet();
        else
            return this.edgeLegality.get(direction).containsKey(null) ?
                    Collections.singleton(null) :
                    this.edgeLegality.get(direction).entrySet()
                            .stream()
                            .filter(entry -> entry.getValue().positive())
                            .map(Map.Entry::getKey)
                            .collect(Collectors.toSet());
    }
For a particular edge directionality, get all the {@link Legal#YES} or {@link Legal#MAYBE} edge labels.
If the label set contains {@code null}, then all edge labels for that direction are positively legal.

@param direction the direction to get the positively legal edge labels for.
@return the set of positively legal edge labels for the direction.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java