{
  "definitions": {},
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://docs.veritone.com/schemas/vtn-standard/master.json",
  "type": "object",
  "title": "vtn-standard for sentiment engines",
  "required": [
    "series"
  ],
  "properties": {
    "schemaId": {
      "type": "string",
      "const": "https://docs.veritone.com/schemas/vtn-standard/master.json"
    },
    "validationContracts": {
      "type": "array",
      "title": "Validation contracts",
      "description": "Engine category contracts to validate this engine output against",
      "contains": {
        "type": "string",
        "description": "The sentiment engine category ID",
        "const": "f2554098-f14b-4d81-9be1-41d0f992a22f"
      }
    },
    "series": {
      "type": "array",
      "title": "Time series objects",
      "items": {
        "type": "object",
        "title": "Time series object",
        "required": [
          "sentiment"
        ],
        "properties": {
          "sentiment": {
            "description": "Sentiment. -1.00 (negative) to 1.00 (positive). For this time slice, provides a scale of how negative to positive it is. If a single number is returned, then positive must be used",
            "type": "object",
            "properties": {
              "positiveValue": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "positiveConfidence": {
                "description": "Positive value confidence score. 0.00 = 0% to 1.00 = 100%",
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "negativeValue": {
                "type": "number",
                "minimum": -1,
                "maximum": 0
              },
              "negativeConfidence": {
                "description": "Negative value confidence score. 0.00 = 0% to 1.00 = 100%",
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            "required": [ "positiveValue" ]
          },
          "emotions": {
            "description": "Emotions detected",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "emotion": {
                  "description": "angry, happy, sad.  Can be any string field",
                  "type": "string"
                },
                "emotionValue": {
                  "description": "How strong. 0.00 to 1.00",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "emotionConfidence": {
                  "description": "Emotion confidence score. 0.00 = 0% to 1.00 = 100%",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "required": [ "emotion" ]
            }
          }
        }
      }
    }
  }
}