@Override
        public String toString() {
            StringBuilder result = new StringBuilder();
            result.append("[id|").append(getStartShape().getId()).append("]");

            for (Relationship rel : this) {
                if (rel.getRelationshipType() == RelationshipType.MEMBER_TARGET) {
                    result.append(" > ");
                } else {
                    result.append(" -[")
                            .append(rel.getRelationshipType()
                                    .getSelectorLabel()
                                    .orElseGet(() -> rel.getRelationshipType().toString()))
                            .append("]-> ");
                }
                result.append("[id|").append(rel.getNeighborShapeId()).append("]");
            }

            return result.toString();
        }
Converts the path to valid {@link Selector} syntax.

@return Returns the path as a selector.
smithy-model/src/main/java/software/amazon/smithy/model/selector/PathFinder.java