public Map<String, RankProfile> rankProfiles() {
        if (rankProfiles != null) return rankProfiles;
        rankProfiles = parent().isPresent() ? parent().get().rankProfiles() : new HashMap<>();

        for (var profileDefinition : PsiTreeUtil.collectElementsOfType(definition, SdRankProfileDefinition.class))
            rankProfiles.put(profileDefinition.getName(), new RankProfile(profileDefinition, this));

        for (var profileFile : Files.allFilesIn(path().append(name()), "profile", definition.getProject())) {
            var profileDefinitions = PsiTreeUtil.collectElementsOfType(profileFile, SdRankProfileDefinition.class);
            if (profileDefinitions.size() != 1) continue; // invalid file
            var profileDefinition = profileDefinitions.stream().findAny().get();
            rankProfiles.put(profileDefinition.getName(), new RankProfile(profileDefinition, this));
        }
        return rankProfiles;
    }
Returns the rank profiles in this, defined either inside it or in separate .profile files,
or inherited from the parent schema.
integration/intellij/src/main/java/ai/vespa/intellij/schema/model/Schema.java