{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.schemastore.org/evolving-resolutive-process-notation.json",
  "title": "evolving resolutive process notation",
  "additionalProperties": true,
  "properties": {
    "type": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": "string",
          "description": "Standard name"
        },
        "version": {
          "$ref": "#/definitions/semver"
        }
      },
      "required": ["name", "version"]
    },
    "content": {
      "$ref": "#/definitions/contentObject"
    }
  },
  "type": "object",
  "definitions": {
    "contentObject": {
      "type": "object",
      "properties": {
        "link": {
          "description": "Where to gather info. If exists, other properties are ignored",
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "version": {
          "$ref": "#/definitions/semver"
        },
        "essence": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "contradiction": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "fundamental": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "thesis": {
                      "type": "string",
                      "description": "What we have in reality"
                    },
                    "antithesis": {
                      "type": "string",
                      "description": "Why reality is not enough"
                    }
                  },
                  "description": "Construction of contradiction"
                },
                "space": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "space": {
                      "type": "string"
                    },
                    "limitations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "actors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "description": "Where is the problem and where can we act"
                },
                "tradeoff": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Limits to make path curved for solving problem"
                },
                "resources": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "What we have before solving problem"
                }
              },
              "description": "Why we have to create this object"
            },
            "synthesis": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "fundamental": {
                  "type": "string",
                  "description": "Common solution for contradiction"
                },
                "resources": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "What we need to realize solution"
                },
                "advantages": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "What else we will get from solution beside problem solving"
                }
              },
              "description": "How to solve main problem"
            },
            "realization": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "input": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/commonObject"
                  },
                  "description": "What we have to get from outer space for sustainable functionality"
                },
                "output": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/commonObject"
                  },
                  "description": "What we produce"
                },
                "resources": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/commonObject"
                  },
                  "description": "Our manipulated objects"
                },
                "value": {
                  "type": "array",
                  "items": {
                    "$ref": "#/definitions/commonObject"
                  },
                  "description": "What we produce for main purpose or valuable to outer external world"
                },
                "commonDescription": {
                  "type": "string",
                  "description": "How it works"
                }
              },
              "description": "How main object was solved"
            }
          },
          "description": "Main description"
        },
        "timing": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "start": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "end": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "impactPercent": {
              "$ref": "#/definitions/percent",
              "description": "How much this version affects reality versus old ones"
            },
            "authors": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/person"
              },
              "description": "Who did it"
            },
            "source": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "What is the reason of changing"
            }
          },
          "description": "Time gap of object activity with authors and source of changing"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/contentObject"
          },
          "description": "Sub level objects"
        },
        "history": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/contentObject"
          },
          "description": "Old versions of object with only changed properties"
        }
      },
      "description": "Main object for notation"
    },
    "commonObject": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/propertyType"
        },
        "describe": {
          "type": "string"
        }
      },
      "description": "Common object for various reality flashes"
    },
    "semver": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$",
      "description": "Semantic version - major.minor.patch"
    },
    "propertyType": {
      "type": "string",
      "description": "Type describes possible operations on property"
    },
    "percent": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "description": "Percent value"
    },
    "person": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": "string"
        },
        "impactPercent": {
          "$ref": "#/definitions/percent"
        },
        "position": {
          "type": "string",
          "description": "Role in organization"
        },
        "comment": {
          "type": "string"
        }
      },
      "description": "Person description"
    }
  }
}
