public Map<Reference, Constant> constants() {
        Map<Reference, Constant> allConstants = new HashMap<>();
        for (var inheritedProfile : inherited()) {
            for (var constant : inheritedProfile.constants().values()) {
                if (allConstants.containsKey(constant.name()))
                    throw new IllegalArgumentException(constant + "' is present in " +
                                                       inheritedProfile + " inherited by " +
                                                       this + ", but is also present in another profile inherited by it");
                allConstants.put(constant.name(), constant);
            }
        }

        if (schema != null)
            allConstants.putAll(schema.constants());
        allConstants.putAll(constants);
        return allConstants;
    }
Returns an unmodifiable view of the constants available in this
config-model/src/main/java/com/yahoo/schema/RankProfile.java