{
  "relations": {
    "system_prompt": "You are an expert genealogist and data scientist. Extract kinship relations from biographical and genealogical texts, mostly in Spanish, using the provided JSON schema exactly.",
    "user_prompt": "\nExtract all explicitly stated kinship ties between named individuals from the text below. Follow these rules:\n1. Extract only **direct** ties that are clearly stated or unambiguously deducible. E.g.:\n    - \"Carlos is the father of Felipe\" → {\"s\": \"Carlos\", \"r\": \"father of\", \"t\": \"Felipe\"}\n    - \"Saúl is Felipe’s paternal grandfather\" → also extract {\"s\": \"Saúl\", \"r\": \"father of\", \"t\": \"Carlos\"}\n2. If no direct ties are found, extract clearly stated **indirect** ties (e.g., \"maternal aunt\"). Never infer them.\n3. Avoid redundant reverse ties (e.g., don’t extract both \"father of\" and \"son of\").\n4. Use **full names** in Spanish (i.e., multi-part first, middle, and last names) and titles (e.g., \"don\", \"doña\", \"general\").\n5. Exclude ties involving unnamed individuals or unclear pronouns.\n6. Include a confidence score \"c\" from 1 (uncertain) to 10 (certain).\n7. Each relation must follow this schema:\n    - \"s\": source name (string)\n    - \"r\": relationship (string)\n    - \"t\": target name (string)\n    - \"MO\": marriage order (integer or null)\n    - \"c\": confidence score (integer)\n8. Return only a valid JSON object with a `relations` list. If no ties are found, return: {\"relations\": []}.\nExtract the kinship ties from this text:\n",
    "relation_schema": {
      "name": "Schema_Relations",
      "schema": {
        "type": "object",
        "title": "RelationList",
        "properties": {
          "relations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "s": {
                  "title": "S",
                  "type": "string"
                },
                "r": {
                  "title": "R",
                  "type": "string"
                },
                "t": {
                  "title": "T",
                  "type": "string"
                },
                "MO": {
                  "default": null,
                  "title": "Mo",
                  "type": "integer"
                },
                "c": {
                  "title": "C",
                  "type": "integer"
                }
              },
              "required": [
                "s",
                "r",
                "t",
                "c"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "relations"
        ],
        "additionalProperties": false
      }
    }
  },
  "events": {
    "system_prompt": "You are an expert genealogist and data scientist. Extract key life events (birth, marriage, death) that form or dissolve kinship ties from Spanish biographical and genealogical texts.",
    "user_prompt": "\nExtract only **explicit** birth, marriage, or death events from the text. Output **valid JSON only**.\n\nFollow these rules:\n\n1. Include only **explicit** events. If highly certain but indirect, include.\n2. For each event extract:\n   - S: full name of the subject\n   - V: verb (e.g., \"nacer\", \"casarse\", \"morir\")\n   - P: place (‘municipality-department-country’ or \"null\")\n   - M: date (‘YYYY-MM-DD’ or year)\n   - PO: *prepObj*, related person (e.g., spouse), or \"null\"\n   - C: confidence (1= very uncertain, 10= very certain)\n   - CD: cause of death (e.g., \"accidente\", or \"null\")\n\n   Each event must include S and V, plus P or M.\n\n3. If no direct events are found, use strong proxies (e.g., baptism for birth, will drafting for death). In these cases, record the **interpreted verb**, then the **observed verb** (e.g., \"nacer, bautizar\").\n\n4. Report only **one direction** per marriage. Use \"null\" for unknown order.\n\n5. Use full Spanish names with titles (e.g., \"don\", \"doña\").\n\n6. Use \"null\" for missing person/place/date info.\n\n7. Output only valid JSON — no text, markdown, or comments.\n",
    "event_schema": {
      "name": "Schema_Events",
      "schema": {
        "type": "object",
        "title": "EventList",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "S": {
                  "title": "S",
                  "type": "string"
                },
                "V": {
                  "title": "V",
                  "type": "string"
                },
                "P": {
                  "title": "P",
                  "type": "string"
                },
                "M": {
                  "title": "M",
                  "type": "string"
                },
                "PO": {
                  "title": "Po",
                  "type": "string"
                },
                "C": {
                  "title": "C",
                  "type": "integer"
                },
                "CD": {
                  "title": "Cd",
                  "type": "string"
                }
              },
              "required": [
                "S",
                "V",
                "P",
                "M",
                "PO",
                "C",
                "CD"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "events"
        ],
        "additionalProperties": false
      }
    }
  }
}
