Augmentations

Augmentations are extensions (collections of additional properties) added to an object. In JSON schema, you must include the augmentation as a property in the definition of the object it extends.

Schema example defining an augmentation

Here is an example of a NIEM augmentation j:CaseAugmentation in JSON schema:

{
  "$id": "http://release.niem.gov/niem/domains/jxdm/6.0/",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "additionalProperties": false,
  "definitions": {
    "j:CaseAugmentation": {
      "$ref": "#/definitions/j:CaseAugmentationType",
      "description": "Additional information about a case."
    },
    "j:CaseAugmentationType": {
      "additionalProperties": false,
      "description": "A data type for additional information about a case.",
      "properties": {
        "j:CaseCourt": {
          "description": "A court of law in which the case is being tried.",
          "$ref": "#/definitions/j:CaseCourt"
        },
        "j:CaseLineageCase": {
          "description": "A description of a case at a previous stage.",
          "$ref": "#/definitions/j:CaseLineageCase"
        },
        "j:CaseOfficial": {
          "description": "A justice official's involvement in a court case.",
          "items": {
            "$ref": "#/definitions/j:CaseOfficial"
          },
          "minItems": 0,
          "type": "array"
        }
      },
      "type": "object"
    },
    "j:CaseLineageCase": {
      "$ref": "./nc.schema.json#/definitions/nc:CaseType",
      "description": "A description of a case at a previous stage."
    },
    "j:CaseCourt": {
      "$ref": "#/definitions/j:CourtType",
      "description": "A court of law in which the case is being tried."
    },
    "j:CaseOfficial": {
      "$ref": "#/definitions/j:CaseOfficialType",
      "description": "A justice official's involvement in a court case."
    },
    "j:CaseOfficialType": {
      "additionalProperties": false,
      "description": "A data type for an official's involvement in a case.",
      "properties": {
        "j:JudicialOfficialRegistrationIdentification": {
          "description": "An identification assigned to a judicial official after registering within a state or region.",
          "$ref": "#/definitions/j:JudicialOfficialRegistrationIdentification"
        }
      },
      "required": [
      ],
      "type": "object"
    },
    "j:CourtName": {
      "$ref": "./xs.schema.json#/definitions/xs:string",
      "description": "A name of a unit of a court."
    },
    "j:CourtType": {
      "additionalProperties": false,
      "description": "A data type for a court or a unit of a court responsible for trying justice proceedings.",
      "properties": {
        "j:CourtName": {
          "description": "A name of a unit of a court.",
          "$ref": "#/definitions/j:CourtName"
        }
      },
      "type": "object"
    },
    "j:JudicialOfficialRegistrationIdentification": {
      "$ref": "./nc.schema.json#/definitions/nc:IdentificationType",
      "description": "An identification assigned to a judicial official after registering within a state or region."
    }
  },
  "properties": {
  },
  "required": [
  ]
}

Schema example using an augmentation

Here is an example of another JSON schema with the augmentation extending nc:CaseType:

{
  "$id": "http://release.niem.gov/niem/niem-core/4.0/",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "additionalProperties": false,
  "definitions": {
    "nc:ActivityDate": {
      "$ref": "#/definitions/nc:DateType",
      "description": "A date of an activity."
    },
    "nc:ActivityDescriptionText": {
      "$ref": "./xs.schema.json#/definitions/xs:string",
      "description": "A description of an activity."
    },
    "nc:CaseTitleText": {
      "$ref": "./xs.schema.json#/definitions/xs:string",
      "description": "An official name of a case."
    },
    "nc:CaseType": {
      "additionalProperties": false,
      "description": "A data type for an aggregation of information about a set of related activities and events.",
      "properties": {
        "j:CaseAugmentation": {
          "description": "Additional information about a case.",
          "items": {
            "$ref": "./j.schema.json#/definitions/j:CaseAugmentation"
          },
          "minItems": 0,
          "type": "array"
        },
        "nc:ActivityDate": {
          "description": "A date of an activity.",
          "$ref": "#/definitions/nc:ActivityDate"
        },
        "nc:ActivityDescriptionText": {
          "description": "A description of an activity.",
          "$ref": "#/definitions/nc:ActivityDescriptionText"
        },
        "nc:CaseTitleText": {
          "description": "An official name of a case.",
          "$ref": "#/definitions/nc:CaseTitleText"
        }
      },
      "type": "object"
    },
    "nc:Date": {
      "$ref": "./xs.schema.json#/definitions/xs:date",
      "description": "A full date."
    },
    "nc:DateTime": {
      "$ref": "./xs.schema.json#/definitions/xs:dateTime",
      "description": "A full date and time."
    },
    "nc:DateType": {
      "additionalProperties": false,
      "description": "A data type for a calendar date.",
      "properties": {
        "nc:Date": {
          "description": "A full date.",
          "$ref": "#/definitions/nc:Date"
        },
        "nc:DateTime": {
          "description": "A full date and time.",
          "$ref": "#/definitions/nc:DateTime"
        }
      },
      "type": "object"
    },
    "nc:IdentificationID": {
      "$ref": "./xs.schema.json#/definitions/xs:string",
      "description": "An identifier."
    },
    "nc:IdentificationType": {
      "additionalProperties": false,
      "description": "A data type for a representation of an identity.",
      "properties": {
        "nc:IdentificationID": {
          "description": "An identifier.",
          "$ref": "#/definitions/nc:IdentificationID"
        }
      },
      "type": "object"
    }
  },
  "properties": {
    "nc:Case": {
      "$ref": "#/definitions/nc:CaseType",
      "description": "An aggregation of information about a set of related activities and events."
    }
  },
  "required": [
  ]
}

These schemas reference another schema: xs

Instance example

Here is a JSON instance of nc:Case extended with the augmentation:

{
  "@context": {
    "aamva_d20": "http://release.niem.gov/niem/codes/aamva_d20/4.0/#",
    "clsa": "http://reference.niem.gov/niem/specification/code-lists/1.0/code-lists-schema-appinfo/#",
    "ct": "http://release.niem.gov/niem/conformanceTargets/3.0/#",
    "j": "http://release.niem.gov/niem/domains/jxdm/6.0/#",
    "mmucc": "http://release.niem.gov/niem/codes/mmucc/4.0/#",
    "nc": "http://release.niem.gov/niem/niem-core/4.0/#",
    "ncic": "http://release.niem.gov/niem/codes/fbi_ncic/4.0/#",
    "niem-xs": "http://release.niem.gov/niem/proxy/xsd/4.0/#",
    "structures": "http://release.niem.gov/niem/structures/4.0/#",
    "term": "http://release.niem.gov/niem/localTerminology/3.0/#",
    "ucr": "http://release.niem.gov/niem/codes/fbi_ucr/4.0/#",
    "xs": "http://www.w3.org/2001/XMLSchema#"
  },
  "nc:Case": {
    "j:CaseAugmentation": [
      {
        "j:CaseCourt": {
          "j:CourtName": "Springfield Circuit Court"
        },
        "j:CaseLineageCase": {
          "j:CaseAugmentation": [
            {
              "j:CaseCourt": {
                "j:CourtName": "Springfield Circuit Court"
              }
            }
          ],
          "nc:ActivityDate": {
            "nc:Date": "2018-01-31"
          },
          "nc:ActivityDescriptionText": "original case",
          "nc:CaseTitleText": "Smith v. Jones"
        },
        "j:CaseOfficial": [
          {
            "j:JudicialOfficialRegistrationIdentification": {
              "nc:IdentificationID": "100"
            }
          }
        ]
      }
    ],
    "nc:ActivityDate": {
      "nc:Date": "2018-02-01"
    },
    "nc:ActivityDescriptionText": "counter claim",
    "nc:CaseTitleText": "Jones v. Smith"
  }
}