{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://country-relationship.com/schema/country-relationship",
"title": "Country Relationships",
"type": "array",
"items": {
"type": "object",
"properties": {
"countryA": {
"$ref": "#/$defs/names"
},
"countryB":{
"$ref": "#/$defs/names"
},
"relationship": {
"$ref": "#/$defs/relationship"
}
},
"required": ["countryA", "countryB", "relationship"]
},
"$defs": {
"names": {
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "#/$defs/names",
"description": "The name of the country",
"type":"string"
},
"relationship": {
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "#/$defs/relationship",
"type": "object",
"properties": {
"typeOfRel": {
"type": "array",
"items": {
"type": "string",
"enum": [
"allies",
"enemy",
"neutral",
"trade-partners"
]
}
},
"startDate": {
"$ref": "#/$defs/date"
},
"endDate": {
"anyOf": [
{ "$ref": "#/$defs/date" },
{ "type": "null" }
]
},
"description": {
"type": "string",
"description": "Description about the relationship and its significance."
},
"source": {
"type": "string",
"description": "The source of the information (e.g. news article, government report, etc.)"
},
"status": {
"type": "string",
"description": "The current status of the relationship (e.g. active, ended, on hold, etc.)"
},
"impact": {
"type": "string",
"description": "The potential impact of the relationship on other countries or regions"
},
"notes": {
"type": "string",
"description": "Any additional notes or comments related to the relationship"
}
},
"required": [
"typeOfRel",
"startDate",
"description"
]
},
"date": {
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "#/$defs/date",
"type": "string",
"pattern": "^(0?[1-9]|[12][0-9]|3[01])[\/\\-](0?[1-9]|1[012])[\/\\-]\\d{4}$",
"description": "The start and end Date of the relationship."
}
}
}
/**
The actual data valid for schema
[
{
"countryA": "USA",
"countryB": "Russia",
"relationship": {
"typeOfRel": ["enemy"],
"startDate": "01-01-2014",
"endDate": null,
"description": "Tensions have risen due to political differences and military actions.",
"source": "CNN",
"status": "active",
"impact": "Potential for military conflict and economic sanctions.",
"notes": "Recent cyberattacks attributed to Russian hackers have further strained relations."
}
},
{
"countryA": "Japan",
"countryB": "South Korea",
"relationship": {
"typeOfRel": ["neutral", "trade-partners"],
"startDate": "05-10-2015",
"endDate": null,
"description": "Despite historical tensions, economic ties between the two countries have strengthened in recent years.",
"source": "BBC",
"status": "active",
"impact": "Positive economic benefits for both countries.",
"notes": "However, some political disputes remain unresolved, including issues related to historical grievances."
}
}
]
**/