Advertisement
okpalan

country-relatioship.json

Nov 9th, 2023 (edited)
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 4.25 KB | Source Code | 0 0
  1.   {  "$schema": "http://json-schema.org/draft-07/schema",
  2.     "$id": "http://country-relationship.com/schema/country-relationship",
  3.     "title": "Country Relationships",
  4.     "type": "array",
  5.     "items": {
  6.         "type": "object",
  7.         "properties": {
  8.             "countryA": {    
  9.                 "$ref": "#/$defs/names"
  10.             },
  11.             "countryB":{
  12.                 "$ref": "#/$defs/names"
  13.             },
  14.             "relationship": {
  15.                 "$ref": "#/$defs/relationship"
  16.             }
  17.         },
  18.         "required": ["countryA", "countryB", "relationship"]
  19.     },
  20.     "$defs": {
  21.         "names": {
  22.             "$schema": "http://json-schema.org/draft-07/schema",
  23.             "$id": "#/$defs/names",
  24.             "description": "The name of the country",
  25.             "type":"string"
  26.         },
  27.         "relationship": {
  28.             "$schema": "http://json-schema.org/draft-07/schema",
  29.             "$id": "#/$defs/relationship",
  30.             "type": "object",
  31.             "properties": {
  32.                 "typeOfRel": {
  33.                     "type": "array",
  34.                     "items": {
  35.                         "type": "string",
  36.                         "enum": [
  37.                             "allies",
  38.                             "enemy",
  39.                             "neutral",
  40.                             "trade-partners"
  41.                         ]
  42.                     }
  43.                 },
  44.                 "startDate": {
  45.                     "$ref": "#/$defs/date"
  46.                 },
  47.                 "endDate": {
  48.                     "anyOf": [
  49.                         { "$ref": "#/$defs/date" },
  50.                         { "type": "null" }
  51.                     ]
  52.                 },
  53.                 "description": {
  54.                     "type": "string",
  55.                     "description": "Description about the relationship and its significance."
  56.                 },
  57.                 "source": {
  58.                     "type": "string",
  59.                     "description": "The source of the information (e.g. news article, government report, etc.)"
  60.                 },
  61.                 "status": {
  62.                     "type": "string",
  63.                     "description": "The current status of the relationship (e.g. active, ended, on hold, etc.)"
  64.                 },
  65.                 "impact": {
  66.                     "type": "string",
  67.                     "description": "The potential impact of the relationship on other countries or regions"
  68.                 },
  69.                 "notes": {
  70.                     "type": "string",
  71.                     "description": "Any additional notes or comments related to the relationship"
  72.                 }
  73.             },
  74.             "required": [
  75.                 "typeOfRel",
  76.                 "startDate",
  77.                 "description"
  78.             ]
  79.         },
  80.         "date": {
  81.             "$schema": "http://json-schema.org/draft-07/schema",
  82.             "$id": "#/$defs/date",
  83.             "type": "string",
  84.             "pattern": "^(0?[1-9]|[12][0-9]|3[01])[\/\\-](0?[1-9]|1[012])[\/\\-]\\d{4}$",
  85.             "description": "The start and end Date of the relationship."
  86.         }
  87.     }
  88. }
  89.  
  90. /**
  91. The actual data valid for schema
  92. [
  93.   {
  94.     "countryA": "USA",
  95.     "countryB": "Russia",
  96.     "relationship": {
  97.       "typeOfRel": ["enemy"],
  98.       "startDate": "01-01-2014",
  99.       "endDate": null,
  100.       "description": "Tensions have risen due to political differences and military actions.",
  101.       "source": "CNN",
  102.       "status": "active",
  103.       "impact": "Potential for military conflict and economic sanctions.",
  104.       "notes": "Recent cyberattacks attributed to Russian hackers have further strained relations."
  105.     }
  106.   },
  107.   {
  108.     "countryA": "Japan",
  109.     "countryB": "South Korea",
  110.     "relationship": {
  111.       "typeOfRel": ["neutral", "trade-partners"],
  112.       "startDate": "05-10-2015",
  113.       "endDate": null,
  114.       "description": "Despite historical tensions, economic ties between the two countries have strengthened in recent years.",
  115.       "source": "BBC",
  116.       "status": "active",
  117.       "impact": "Positive economic benefits for both countries.",
  118.       "notes": "However, some political disputes remain unresolved, including issues related to historical grievances."
  119.     }
  120.   }
  121. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement