{
  "$defs": {
    "About": {
      "additionalProperties": false,
      "description": "The plain-language card of one catalog item.\n\nEvery field except the expert ones is required, so an About that validates is\nstructurally complete; :func:`about_issues` adds the editorial rules (one or two\nsentences, no jargon in the summary, known chooser tags, related ids that exist).",
      "examples": [
        {
          "assumptions": [
            "Numbers can be added up (spend, sales); averages are averaged"
          ],
          "avoid_when": [
            "Your data already has one row per week"
          ],
          "data_needs": [
            "A date column"
          ],
          "difficulty": "beginner",
          "example": "Daily TV spend of 100 each day becomes 700 for the week.",
          "fits": {
            "goal": [
              "check_data"
            ]
          },
          "outputs": [
            "The same columns, one row per week"
          ],
          "related": [
            "core.calendar"
          ],
          "summary_plain": "Adds up daily numbers into one number per week (or month), so that every row covers the same length of time.",
          "title": "Weekly totals",
          "typical_runtime": "instant",
          "use_when": [
            "Your data is daily but you want to plan or report by week"
          ]
        }
      ],
      "properties": {
        "assumptions": {
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "minItems": 1,
          "title": "Assumptions",
          "type": "array"
        },
        "avoid_when": {
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "minItems": 1,
          "title": "Avoid When",
          "type": "array"
        },
        "data_needs": {
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "minItems": 1,
          "title": "Data Needs",
          "type": "array"
        },
        "difficulty": {
          "$ref": "#/$defs/Difficulty"
        },
        "example": {
          "description": "A tiny example",
          "maxLength": 600,
          "minLength": 10,
          "title": "Example",
          "type": "string"
        },
        "expert_notes": {
          "anyOf": [
            {
              "maxLength": 4000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maths, estimator details, caveats for experts",
          "title": "Expert Notes"
        },
        "fits": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Chooser tags: question id -> the answers this item suits",
          "maxProperties": 16,
          "title": "Fits",
          "type": "object"
        },
        "outputs": {
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "minItems": 1,
          "title": "Outputs",
          "type": "array"
        },
        "references": {
          "items": {
            "$ref": "#/$defs/AboutReference"
          },
          "maxItems": 10,
          "title": "References",
          "type": "array"
        },
        "related": {
          "description": "Ids of related catalog items (models, steps, nodes, checks, templates)",
          "items": {
            "type": "string"
          },
          "maxItems": 16,
          "title": "Related",
          "type": "array"
        },
        "summary_plain": {
          "description": "One or two sentences without jargon: what it does for you",
          "maxLength": 400,
          "minLength": 20,
          "title": "Summary Plain",
          "type": "string"
        },
        "title": {
          "description": "A human name",
          "maxLength": 80,
          "minLength": 3,
          "title": "Title",
          "type": "string"
        },
        "typical_runtime": {
          "$ref": "#/$defs/TypicalRuntime"
        },
        "use_when": {
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "minItems": 1,
          "title": "Use When",
          "type": "array"
        }
      },
      "required": [
        "title",
        "summary_plain",
        "use_when",
        "avoid_when",
        "data_needs",
        "assumptions",
        "outputs",
        "difficulty",
        "typical_runtime",
        "example"
      ],
      "title": "About",
      "type": "object"
    },
    "AboutKind": {
      "description": "What an About describes (chooser results and the catalog say which).",
      "enum": [
        "model",
        "step",
        "split",
        "template",
        "workflow_template",
        "node_kind",
        "node",
        "check",
        "dataset",
        "spec",
        "plot"
      ],
      "title": "AboutKind",
      "type": "string"
    },
    "AboutReference": {
      "additionalProperties": false,
      "description": "A source for the expert detail (a paper, a book chapter, library documentation).",
      "properties": {
        "title": {
          "maxLength": 300,
          "minLength": 3,
          "title": "Title",
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "maxLength": 500,
              "pattern": "^https://\\S+$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        }
      },
      "required": [
        "title"
      ],
      "title": "AboutReference",
      "type": "object"
    },
    "Difficulty": {
      "description": "How much statistical background an item needs to use well.",
      "enum": [
        "beginner",
        "intermediate",
        "expert"
      ],
      "title": "Difficulty",
      "type": "string"
    },
    "Recommendation": {
      "description": "One ranked candidate with the reasons in plain words.",
      "properties": {
        "about": {
          "anyOf": [
            {
              "$ref": "#/$defs/About"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "cautions_plain": {
          "items": {
            "type": "string"
          },
          "title": "Cautions Plain",
          "type": "array"
        },
        "difficulty": {
          "$ref": "#/$defs/Difficulty"
        },
        "id": {
          "maxLength": 128,
          "title": "Id",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/AboutKind"
        },
        "reasons_plain": {
          "items": {
            "type": "string"
          },
          "title": "Reasons Plain",
          "type": "array"
        },
        "score": {
          "maximum": 1,
          "minimum": 0,
          "title": "Score",
          "type": "number"
        },
        "summary_plain": {
          "title": "Summary Plain",
          "type": "string"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "typical_runtime": {
          "$ref": "#/$defs/TypicalRuntime"
        }
      },
      "required": [
        "kind",
        "id",
        "title",
        "summary_plain",
        "score",
        "difficulty",
        "typical_runtime"
      ],
      "title": "Recommendation",
      "type": "object"
    },
    "TypicalRuntime": {
      "description": "Rough wall-clock time on typical data (``S`` resource class).",
      "enum": [
        "instant",
        "seconds",
        "minutes",
        "long"
      ],
      "title": "TypicalRuntime",
      "type": "string"
    }
  },
  "$id": "https://schemas.mapi.dev/v1/api-ChooserResult.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "``GET /v1/catalog/recommendations``: candidates ranked best first.",
  "examples": [
    {
      "answered": [
        "goal",
        "data_shape"
      ],
      "items": [
        {
          "cautions_plain": [],
          "difficulty": "beginner",
          "id": "weekly_forecast",
          "kind": "template",
          "reasons_plain": [
            "Suits: forecast the future",
            "Suits: one number over time"
          ],
          "score": 0.92,
          "summary_plain": "Forecasts one weekly number a few months ahead, with a range of likely values.",
          "title": "Weekly forecast",
          "typical_runtime": "minutes"
        }
      ],
      "unanswered": [
        "frequency",
        "history",
        "drivers",
        "uncertainty",
        "experience",
        "speed"
      ]
    }
  ],
  "properties": {
    "answered": {
      "items": {
        "type": "string"
      },
      "title": "Answered",
      "type": "array"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/Recommendation"
      },
      "title": "Items",
      "type": "array"
    },
    "unanswered": {
      "items": {
        "type": "string"
      },
      "title": "Unanswered",
      "type": "array"
    }
  },
  "title": "ChooserResult",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
