In the instance example below, the basic information about the person (name, birthdate) appears under the nc:RoleOfPerson element.
{
"j:CrashDriver": {
"nc:RoleOfPerson": {
"nc:PersonName": {
"nc:PersonFullName": "John Doe"
},
"nc:PersonBirthDate": {
"nc:Date": "1966-06-06"
}
},
"j:CrashDriverViolationCode": "A10",
"j:CrashDrivingViolationCode": "S16"
}
}
In the instance example below, the basic information about the person (name, birthdate) is linked from the nc:RoleOfPerson element to element nc:Person, which is defined elsewhere in the instance.
{
"j:CrashDriver": {
"nc:RoleOfPerson": {
"@id": "BRAVO"
}
},
"j:CrashDriverViolationCode": "A10",
"j:CrashDrivingViolationCode": "S16"
},
"nc:RoleOfPerson": {
"@id": "BRAVO",
"nc:PersonName": {
"nc:PersonFullName": "John Doe"
},
"nc:PersonBirthDate": {
"nc:Date": "1966-06-06"
}
}
}
This example shows a role type (CrashDriverType) and an element with that type (CrashDriver).
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"j:CrashDriver": {
"description": "A motor vehicle driver involved into a traffic accident.",
"oneOf": [
{
"$ref": "#/definitions/j:CrashDriverType"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/j:CrashDriverType"
}
}
]
}
}
"definitions": {
"j:CrashDriverType": {
"description": "A data type for a motor vehicle driver involved in a traffic accident.",
"allOf": [
{
"$ref": "#/definitions/_base"
},
{
"type": "object",
"properties": {
"nc:RoleOfPerson": {
"$ref": "#/properties/nc:RoleOfPerson"
},
"j:CrashDriverViolation": {
"$ref": "#/properties/j:CrashDriverViolation"
},
"j:CrashDrivingViolation": {
"$ref": "#/properties/j:CrashDrivingViolation"
}
}
}
]
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
}
"definitions": {
"ROLETYPE": {
"description": "A data type for ...",
"allOf": [
{
"$ref": "#/definitions/_base"
},
{
"type": "object",
"properties": {
"ROLE-OF-PROPERTY": {
"$ref": "#/properties/ROLE-OF-PROPERTY"
},
"ADDITIONAL-PROPERTY": {
"$ref": "#/properties/ADDITIONAL-PROPERTY"
}
}
}
]
}
}
}
The example below shows the definition of role-of element “RoleOfPerson” from Core.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"nc:RoleOfProperty": {
"description": "A person of whom the role object is a function.",
"oneOf": [
{
"$ref": "#/definitions/nc:PersonType"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/nc:PersonType"
}
}
]
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"nc:RoleOfNAME": {
"description": "DEFINITION",
"oneOf": [
{
"$ref": "#/definitions/OBJECT-TYPE"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/OBJECT-TYPE"
}
}
]
}
}
}