public static JsonSchemaObject findRelativeDefinition(final @NotNull JsonSchemaObject schema,
                                                        final @NotNull JsonSchemaVariantsTreeBuilder.SchemaUrlSplitter splitter,
                                                        @NotNull JsonSchemaService service) {
    final String path = splitter.getRelativePath();
    if (StringUtil.isEmptyOrSpaces(path)) {
      final String id = splitter.getSchemaId();
      if (isSelfReference(id)) {
        return schema;
      }
      if (id != null && id.startsWith("#")) {
        JsonSchemaObject rootSchemaObject = schema.getRootSchemaObject();
        if (rootSchemaObject instanceof RootJsonSchemaObject<?, ?> explicitRootSchemaObject) {
          final String resolvedId = explicitRootSchemaObject.resolveId(id);
          if (resolvedId == null || id.equals("#" + resolvedId)) return null;
          return findRelativeDefinition(schema, new JsonSchemaVariantsTreeBuilder.SchemaUrlSplitter("#" + resolvedId), service);
        }
      }
      return schema;
    }
    final JsonSchemaObject definition = findRelativeDefinition(schema, path);
    if (definition == null) {
      if (LOG.isDebugEnabled()) {
        VirtualFile schemaFile = service.resolveSchemaFile(schema);
        String debugMessage = String.format("Definition not found by reference: '%s' in file %s",
                                            path, schemaFile == null ? "(no file)" : schemaFile.getPath());
        LOG.debug(debugMessage);
      }
    }
    return definition;
  }
public static JsonSchemaObject findRelativeDefinition(final @NotNull JsonSchemaObject schema,
                                                        final @NotNull JsonSchemaVariantsTreeBuilder.SchemaUrlSplitter splitter,
                                                        @NotNull JsonSchemaService service)