private boolean matchesAttribute(Shape shape, Context stack) {
        AttributeValue lhs = AttributeValue.shape(shape, stack.getVars()).getPath(path);

        if (comparator == null) {
            return lhs.isPresent();
        }

        for (AttributeValue rhs : expected) {
            if (comparator.compare(lhs, rhs, caseInsensitive)) {
                return true;
            }
        }

        return false;
    }
Matches shapes with a specific attribute or that matches an attribute comparator.
smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeSelector.java