{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/system/main/json-schema/system-relationship-schema.json",
  "title": "Relationship",
  "description": "Relationship.",
  "x-generated": "2026-10-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/system-api-openapi.json#/components/schemas/Relationship",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Unique identifier of relationship.",
      "filterable": true
    },
    "num_findings": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Num Findings",
      "description": "Number of findings on relationship",
      "filterable": true,
      "sortable": true
    },
    "num_studies": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Num Studies",
      "description": "Number of studies supporting relationship",
      "filterable": true,
      "sortable": true
    },
    "num_significant_findings": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Num Significant Findings",
      "description": "Number of significant findings on relationship",
      "filterable": true,
      "sortable": true
    },
    "highest_cited": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Highest Cited",
      "description": "Highest cited study supporting relationship",
      "filterable": true,
      "sortable": true
    },
    "median_effect_size": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Median Effect Size",
      "description": "Median effect size of findings on relationship",
      "filterable": true,
      "sortable": true
    },
    "last_updated": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Updated",
      "description": "Date relationship was last updated",
      "filterable": true,
      "sortable": true
    },
    "has_experimental_trial": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Has Experimental Trial",
      "description": "Whether or not the relationship is supported by an experimental trial",
      "filterable": true,
      "sortable": true
    },
    "source_topic": {
      "anyOf": [
        {
          "$ref": "#/$defs/Topic"
        },
        {
          "type": "null"
        }
      ],
      "description": "Unique identifier of the source topic",
      "filterable": true,
      "searchable": true
    },
    "target_topic": {
      "anyOf": [
        {
          "$ref": "#/$defs/Topic"
        },
        {
          "type": "null"
        }
      ],
      "description": "Unique identifier of the target topic",
      "filterable": true,
      "searchable": true
    }
  },
  "type": "object",
  "required": [
    "id"
  ],
  "$defs": {
    "Topic": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique identifier",
          "filterable": true
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the topic",
          "searchable": true
        },
        "wikidata_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Wikidata Id",
          "description": "Wikidata identifier for the topic",
          "filterable": true
        },
        "umls_cuis": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Umls Cuis",
          "description": "UMLS Concept Unique Identifiers (CUIs) for the topic",
          "filterable": true
        },
        "category": {
          "anyOf": [
            {
              "$ref": "#/$defs/TopicCategory"
            },
            {
              "type": "null"
            }
          ],
          "description": "Category of the topic",
          "filterable": true
        },
        "roles": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TopicRole"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Roles",
          "description": "Roles associated with the topic",
          "filterable": true
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "Topic",
      "description": "Topic."
    },
    "TopicCategory": {
      "type": "string",
      "enum": [
        "Biomedical - Diseases & disorders",
        "Biomedical - Hospitalization",
        "Biomedical - Mortality/survival",
        "Biomedical - Pathogen",
        "Biomedical - Ethnicity",
        "Biomedical - Other biological factors",
        "Biomedical - Anthropometry",
        "Biomedical - Age",
        "Biomedical - Sex",
        "Biomedical - Carcinogen",
        "Biomedical - Genetics",
        "Behavioral - Personal hygiene",
        "Behavioral - Other dietary factors",
        "Behavioral - Stress",
        "Behavioral - Substance use",
        "Behavioral - Eating behaviors",
        "Behavioral - Sleep",
        "Behavioral - Physical activity",
        "Behavioral - Other behavioral factors",
        "Behavioral - Sexual behavior",
        "Environmental - Air quality",
        "Environmental - Water quality",
        "Environmental - Weather and climate change",
        "Environmental - Other environmental factors",
        "Social - Education",
        "Social - Economic context",
        "Social - Other social factors",
        "Social - Physical infrastructure",
        "Social - Social context",
        "Social - Healthcare context",
        "Social - Occupation",
        "Social - Geography",
        "Social - Occupational context",
        "Healing",
        "Preventative",
        "Diagnostic",
        "Preservative",
        "Managing",
        "Therapeutic",
        "Other"
      ],
      "title": "TopicCategory",
      "description": "Topic category."
    },
    "TopicRole": {
      "type": "string",
      "enum": [
        "Determinant",
        "Intervention",
        "Outcome",
        "Agent"
      ],
      "title": "TopicRole",
      "description": "Topic role."
    }
  }
}