{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-ad/json-schema/azure-ad-microsoft-graph-term-store-relation-schema.json",
  "title": "microsoft.graph.termStore.relation",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-ad-sites-store-api-openapi.yml#/components/schemas/microsoft.graph.termStore.relation",
  "allOf": [
    {
      "$ref": "#/$defs/microsoft.graph.entity"
    },
    {
      "title": "relation",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "relationship": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.termStore.relationType"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The type of relation. The possible values are: pin, reuse."
        },
        "fromTerm": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.termStore.term"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set].",
          "x-ms-navigationProperty": true
        },
        "set": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.termStore.set"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The [set] in which the relation is relevant.",
          "x-ms-navigationProperty": true
        },
        "toTerm": {
          "anyOf": [
            {
              "$ref": "#/$defs/microsoft.graph.termStore.term"
            },
            {
              "type": [
                "object",
                "null"
              ]
            }
          ],
          "description": "The to [term] of the relation. The term to which the relationship is defined.",
          "x-ms-navigationProperty": true
        },
        "@odata.type": {
          "type": "string"
        }
      }
    }
  ],
  "x-ms-discriminator-value": "#microsoft.graph.termStore.relation",
  "$defs": {
    "microsoft.graph.entity": {
      "title": "entity",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for an entity. Read-only."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.keyValue": {
      "title": "keyValue",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "key": {
          "type": [
            "string",
            "null"
          ],
          "description": "Key for the key-value pair."
        },
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "Value for the key-value pair."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.termStore.group": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "group",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "createdDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "Date and time of the group creation. Read-only.",
              "format": "date-time"
            },
            "description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Description that gives details on the term usage."
            },
            "displayName": {
              "type": [
                "string",
                "null"
              ],
              "description": "Name of the group."
            },
            "parentSiteId": {
              "type": [
                "string",
                "null"
              ],
              "description": "ID of the parent site of this group."
            },
            "scope": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.termStore.termGroupScope"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "Returns the type of the group. The possible values are: global, system, and siteCollection."
            },
            "sets": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.set"
              },
              "description": "All sets under the group in a term [store].",
              "x-ms-navigationProperty": true
            },
            "@odata.type": {
              "type": "string"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.termStore.group"
    },
    "microsoft.graph.termStore.localizedDescription": {
      "title": "localizedDescription",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "The description in the localized language."
        },
        "languageTag": {
          "type": [
            "string",
            "null"
          ],
          "description": "The language tag for the label."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.termStore.localizedLabel": {
      "title": "localizedLabel",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "isDefault": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Indicates whether the label is the default label."
        },
        "languageTag": {
          "type": [
            "string",
            "null"
          ],
          "description": "The language tag for the label."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the label."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.termStore.localizedName": {
      "title": "localizedName",
      "required": [
        "@odata.type"
      ],
      "type": "object",
      "properties": {
        "languageTag": {
          "type": [
            "string",
            "null"
          ],
          "description": "The language tag for the label."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name in the localized language."
        },
        "@odata.type": {
          "type": "string"
        }
      }
    },
    "microsoft.graph.termStore.relation": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "relation",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "relationship": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.termStore.relationType"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The type of relation. The possible values are: pin, reuse."
            },
            "fromTerm": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.termStore.term"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The from [term] of the relation. The term from which the relationship is defined. A null value would indicate the relation is directly with the [set].",
              "x-ms-navigationProperty": true
            },
            "set": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.termStore.set"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The [set] in which the relation is relevant.",
              "x-ms-navigationProperty": true
            },
            "toTerm": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.termStore.term"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The to [term] of the relation. The term to which the relationship is defined.",
              "x-ms-navigationProperty": true
            },
            "@odata.type": {
              "type": "string"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.termStore.relation"
    },
    "microsoft.graph.termStore.relationType": {
      "title": "relationType",
      "enum": [
        "pin",
        "reuse",
        "unknownFutureValue"
      ],
      "type": "string"
    },
    "microsoft.graph.termStore.set": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "set",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "createdDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "Date and time of set creation. Read-only.",
              "format": "date-time"
            },
            "description": {
              "type": [
                "string",
                "null"
              ],
              "description": "Description that gives details on the term usage."
            },
            "localizedNames": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.localizedName"
              },
              "description": "Name of the set for each languageTag."
            },
            "properties": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.keyValue"
              },
              "description": "Custom properties for the set."
            },
            "children": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.term"
              },
              "description": "Children terms of set in term [store].",
              "x-ms-navigationProperty": true
            },
            "parentGroup": {
              "$ref": "#/$defs/microsoft.graph.termStore.group"
            },
            "relations": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.relation"
              },
              "description": "Indicates which terms have been pinned or reused directly under the set.",
              "x-ms-navigationProperty": true
            },
            "terms": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.term"
              },
              "description": "All the terms under the set.",
              "x-ms-navigationProperty": true
            },
            "@odata.type": {
              "type": "string"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.termStore.set"
    },
    "microsoft.graph.termStore.term": {
      "allOf": [
        {
          "$ref": "#/$defs/microsoft.graph.entity"
        },
        {
          "title": "term",
          "required": [
            "@odata.type"
          ],
          "type": "object",
          "properties": {
            "createdDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "Date and time of term creation. Read-only.",
              "format": "date-time"
            },
            "descriptions": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.localizedDescription"
              },
              "description": "Description about term that is dependent on the languageTag."
            },
            "labels": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.localizedLabel"
              },
              "description": "Label metadata for a term."
            },
            "lastModifiedDateTime": {
              "pattern": "^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$",
              "type": [
                "string",
                "null"
              ],
              "description": "Last date and time of term modification. Read-only.",
              "format": "date-time"
            },
            "properties": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.keyValue"
              },
              "description": "Collection of properties on the term."
            },
            "children": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.term"
              },
              "description": "Children of current term.",
              "x-ms-navigationProperty": true
            },
            "relations": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/microsoft.graph.termStore.relation"
              },
              "description": "To indicate which terms are related to the current term as either pinned or reused.",
              "x-ms-navigationProperty": true
            },
            "set": {
              "anyOf": [
                {
                  "$ref": "#/$defs/microsoft.graph.termStore.set"
                },
                {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              ],
              "description": "The [set] in which the term is created.",
              "x-ms-navigationProperty": true
            },
            "@odata.type": {
              "type": "string"
            }
          }
        }
      ],
      "x-ms-discriminator-value": "#microsoft.graph.termStore.term"
    },
    "microsoft.graph.termStore.termGroupScope": {
      "title": "termGroupScope",
      "enum": [
        "global",
        "system",
        "siteCollection",
        "unknownFutureValue"
      ],
      "type": "string"
    }
  }
}