Model transform(ModelTransformer transformer, Model model) {
        // If there are no filters. Exit without traversing shapes
        if (relativeVersion == null) {
            return model;
        }

        Set<Shape> shapesToRemove = new HashSet<>();
        for (Shape shape : model.getShapesWithTrait(DeprecatedTrait.class)) {
            Optional<String> sinceOptional = shape.expectTrait(DeprecatedTrait.class).getSince();

            if (!sinceOptional.isPresent()) {
                continue;
            }

            String since = sinceOptional.get();
            // Remove any shapes that were deprecated before the specified version.
            if (isSemVer(since)) {
                if (compareSemVer(relativeVersion, since) > 0) {
                    LOGGER.fine("Filtering deprecated shape: `"
                            + shape + "`"
                            + ". Shape was deprecated as of version: " + since);
                    shapesToRemove.add(shape);
                }
            }
        }

        return transformer.removeShapes(model, shapesToRemove);
    }
SemVer regex from semantic version spec.
@see <a href="https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string">SemVer</a>
smithy-model/src/main/java/software/amazon/smithy/model/transform/FilterDeprecatedRelativeVersion.java