private List<String> parseSelectorDirectedRelationships() {
        List<String> relationships = new ArrayList<>();
        String next;
        char peek;

        do {
            // Requires at least one relationship type.
            ws();
            next = ParserUtils.parseIdentifier(this);
            relationships.add(next);

            // Tolerate unknown relationships, but log a warning.
            if (!REL_TYPES.contains(next)) {
                LOGGER.warning(String.format(
                        "Unknown relationship type '%s' found near %s. Expected one of: %s",
                        next,
                        position() - next.length(),
                        REL_TYPES));
            }

            ws();
            peek = expect(']', ',');
        } while (peek != ']');

        return relationships;
    }
Filter out unnecessary identity selectors when creating the finalized AST to evaluate selectors.
smithy-model/src/main/java/software/amazon/smithy/model/selector/SelectorParser.java