private void ensureZeroOrOneDefaultRule(SemanticRulesConfig config) {
            String defaultName = null;
            for (SemanticRulesConfig.Rulebase ruleBase : config.rulebase()) {
                if (defaultName != null && ruleBase.isdefault()) {
                    List<String> defaultRules = new ArrayList<>(List.of(defaultName, ruleBase.name()));
                    defaultRules.sort(String::compareTo);
                    throw new IllegalArgumentException("Rules " + defaultRules + " are both marked as the default rule, there can only be one");
                }
                if (ruleBase.isdefault())
                    defaultName = ruleBase.name();
            }
        }
Builds the semantic rules for an application package and validates them
config-model/src/main/java/com/yahoo/vespa/model/container/search/SemanticRules.java