Map<ShapeId, Set<Relationship>> getRelationships() {
        PathFinder finder = PathFinder.create(model);
        for (Shape traitDef : model.getShapesWithTrait(TraitDefinition.class)) {
            if (traitDef.hasTrait(IdRefTrait.ID)) {
                // PathFinder doesn't handle the case where the trait def has the idRef
                NodeQuery query = new NodeQuery().self();
                addRelationships(traitDef, query);
                continue;
            }
            List<PathFinder.Path> paths = finder.search(traitDef, WITH_ID_REF);
            if (!paths.isEmpty()) {
                for (PathFinder.Path path : paths) {
                    NodeQuery query = buildNodeQuery(path);
                    addRelationships(traitDef, query);
                }
            }
        }
        return relationships;
    }
Finds all {@link RelationshipType#ID_REF} relationships in a model.

<p>This works by finding all paths from {@link TraitDefinition} shapes
to shapes with {@link IdRefTrait}, then using those paths to search
the node values of each application of the trait to extract the {@link ShapeId}
value. Because we don't have a fixed set of traits known to potentially have
idRef members, this has to be done dynamically.
smithy-model/src/main/java/software/amazon/smithy/model/neighbor/IdRefShapeRelationships.java