{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "comtogether/lang/intent",
  "title": "Intention de communication (représentation interne A0)",
  "description": "Ce que la personne veut dire, independamment de sa realisation en francais. La realisation (preposition, ordre, accord, clitiques) est CALCULEE par le realisateur, jamais stockee ici.",
  "type": "object",
  "required": ["predicate", "arguments"],
  "additionalProperties": false,
  "properties": {
    "predicate": {
      "type": "string",
      "description": "Lemme du verbe. Doit exister comme cle dans lexicon.core.json."
    },
    "subject": { "$ref": "#/$defs/np" },
    "arguments": {
      "type": "array",
      "description": "Arguments du predicat, dans l'ordre semantique (pas forcement l'ordre de surface).",
      "items": {
        "type": "object",
        "required": ["role", "value"],
        "additionalProperties": false,
        "properties": {
          "role": {
            "type": "string",
            "description": "Role semantique: theme, recipient, beneficiary, goal, topic, agent..."
          },
          "value": { "$ref": "#/$defs/np" },
          "pronominalize": {
            "type": "boolean",
            "default": false,
            "description": "Realiser en pronom clitique (le/la/lui/leur...). CHOIX DE REALISATION, pas de sens."
          }
        }
      }
    },
    "tense": {
      "enum": ["present", "past", "imperfect", "future", "conditional"],
      "default": "present"
    },
    "polarity": { "enum": ["positive", "negative"], "default": "positive" },
    "mood": { "enum": ["declarative", "interrogative", "imperative"], "default": "declarative" },
    "modal": {
      "type": ["string", "null"],
      "default": null,
      "description": "Verbe modal englobant conjugue (vouloir, pouvoir, devoir); le predicat passe alors a l'infinitif."
    }
  },
  "$defs": {
    "np": {
      "type": "object",
      "description": "Un groupe nominal ou un pronom personnel.",
      "additionalProperties": false,
      "properties": {
        "pronoun": {
          "type": "object",
          "description": "Pronom personnel (je, tu, il, moi/me...). La forme de surface (nom/acc/dat) est calculee par le realisateur.",
          "additionalProperties": false,
          "properties": {
            "person": { "enum": [1, 2, 3] },
            "number": { "enum": ["s", "p"], "default": "s" },
            "gender": { "enum": ["m", "f"], "default": "m" }
          },
          "required": ["person"]
        },
        "proper": { "type": "string", "description": "Nom propre / d'adresse sans determinant (maman, Lea)." },
        "det": { "type": "string", "description": "Determinant (le, la, un, mon...)." },
        "noun": { "type": "string", "description": "Lemme du nom commun." },
        "gender": { "enum": ["m", "f"], "description": "Genre du nom propre (pour l'accord si pronominalise)." },
        "number": { "enum": ["s", "p"], "default": "s" }
      }
    }
  }
}
