private static void addFileConstants(Collection<RankProfile.Constant> source,
                                         Map<Reference, RankProfile.Constant> destination,
                                         String sourceName) {
        for (var constant : source) {
            if (constant.valuePath().isEmpty()) continue;
            var existing = destination.get(constant.name());
            if ( existing != null && ! constant.equals(existing)) {
                throw new IllegalArgumentException("Duplicate constants: " + sourceName + " have " + constant +
                                                   ", but we already have " + existing +
                                                   ": Value reference constants must be unique across all rank profiles/models");
            }
            destination.put(constant.name(), constant);
        }
    }
Creates a rank profile list

@param schema the schema this is a rank profile from
@param attributeFields the attribute fields to create a ranking for
config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java