Country Relationships


SUBMITTED BY: okpalan86

DATE: April 19, 2023, 10:59 p.m.

FORMAT: JSON

SIZE: 4.4 kB

HITS: 634

  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema",
  3. "$id": "http://country-relationship.com/schema/country-relationship",
  4. "title": "Country Relationships",
  5. "type": "array",
  6. "items": {
  7. "type": "object",
  8. "properties": {
  9. "countryA": {
  10. "$ref": "#/$defs/names"
  11. },
  12. "countryB":{
  13. "$ref": "#/$defs/names"
  14. },
  15. "relationship": {
  16. "$ref": "#/$defs/relationship"
  17. }
  18. },
  19. "required": ["countryA", "countryB", "relationship"]
  20. },
  21. "$defs": {
  22. "names": {
  23. "$schema": "http://json-schema.org/draft-07/schema",
  24. "$id": "#/$defs/names",
  25. "description": "The name of the country",
  26. "type":"string"
  27. },
  28. "relationship": {
  29. "$schema": "http://json-schema.org/draft-07/schema",
  30. "$id": "#/$defs/relationship",
  31. "type": "object",
  32. "properties": {
  33. "typeOfRel": {
  34. "type": "array",
  35. "items": {
  36. "type": "string",
  37. "enum": [
  38. "allies",
  39. "enemy",
  40. "neutral",
  41. "trade-partners"
  42. ]
  43. }
  44. },
  45. "startDate": {
  46. "$ref": "#/$defs/date"
  47. },
  48. "endDate": {
  49. "anyOf": [
  50. { "$ref": "#/$defs/date" },
  51. { "type": "null" }
  52. ]
  53. },
  54. "description": {
  55. "type": "string",
  56. "description": "Description about the relationship and its significance."
  57. },
  58. "source": {
  59. "type": "string",
  60. "description": "The source of the information (e.g. news article, government report, etc.)"
  61. },
  62. "status": {
  63. "type": "string",
  64. "description": "The current status of the relationship (e.g. active, ended, on hold, etc.)"
  65. },
  66. "impact": {
  67. "type": "string",
  68. "description": "The potential impact of the relationship on other countries or regions"
  69. },
  70. "notes": {
  71. "type": "string",
  72. "description": "Any additional notes or comments related to the relationship"
  73. }
  74. },
  75. "required": [
  76. "typeOfRel",
  77. "startDate",
  78. "description"
  79. ]
  80. },
  81. "date": {
  82. "$schema": "http://json-schema.org/draft-07/schema",
  83. "$id": "#/$defs/date",
  84. "type": "string",
  85. "pattern": "^(0?[1-9]|[12][0-9]|3[01])[\/\\-](0?[1-9]|1[012])[\/\\-]\\d{4}$",
  86. "description": "The start and end Date of the relationship."
  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. ]
  122. **/

comments powered by Disqus