public void addRankProfileFile(String schemaName, NamedReader reader) throws ParseException {
        try {
            ParsedSchema schema = parsedSchemas.get(schemaName);
            if (schema == null) {
                throw new IllegalArgumentException("No schema named '" + schemaName + "'");
            }
            var stream = new SimpleCharStream(IOUtils.readAll(reader.getReader()));
            var parser = new SchemaParser(stream, deployLogger);
            try {
                parser.rankProfile(schema);
            } catch (ParseException | TokenMgrException e) {
                throw new ParseException("Failed parsing rank-profile from '" + reader.getName() + "': " +
                                         stream.formatException(Exceptions.toMessageString(e)));
            }
        } catch (java.io.IOException ex) {
            throw new IllegalArgumentException("Failed reading from '" + reader.getName() + "': " + ex.getMessage());
        }
    }
Parses a rank profile from the given reader and add to the schema identified by name.
note: the named schema must have been parsed already.
config-model/src/main/java/com/yahoo/schema/parser/IntermediateCollection.java