1{
2  "$schema": "http://json-schema.org/draft-04/schema#",
3  "title": "Data Package",
4  "description": "Data Package is a simple specification for data access and delivery.",
5  "type": "object",
6  "required": [
7    "resources"
8  ],
9  "properties": {
10    "profile": {
11      "default": "data-package",
12      "propertyOrder": 10,
13      "title": "Profile",
14      "description": "The profile of this descriptor.",
15      "context": "Every Package and Resource descriptor has a profile. The default profile, if none is declared, is `data-package` for Package and `data-resource` for Resource.",
16      "type": "string",
17      "examples": [
18        "{\n  \"profile\": \"tabular-data-package\"\n}\n",
19        "{\n  \"profile\": \"http://example.com/my-profiles-json-schema.json\"\n}\n"
20      ]
21    },
22    "name": {
23      "propertyOrder": 20,
24      "title": "Name",
25      "description": "An identifier string. Lower case characters with `.`, `_`, `-` and `/` are allowed.",
26      "type": "string",
27      "pattern": "^([-a-z0-9._/])+$",
28      "context": "This is ideally a url-usable and human-readable name. Name `SHOULD` be invariant, meaning it `SHOULD NOT` change when its parent descriptor is updated.",
29      "examples": [
30        "{\n  \"name\": \"my-nice-name\"\n}\n"
31      ]
32    },
33    "id": {
34      "propertyOrder": 30,
35      "title": "ID",
36      "description": "A property reserved for globally unique identifiers. Examples of identifiers that are unique include UUIDs and DOIs.",
37      "context": "A common usage pattern for Data Packages is as a packaging format within the bounds of a system or platform. In these cases, a unique identifier for a package is desired for common data handling workflows, such as updating an existing package. While at the level of the specification, global uniqueness cannot be validated, consumers using the `id` property `MUST` ensure identifiers are globally unique.",
38      "type": "string",
39      "examples": [
40        "{\n  \"id\": \"b03ec84-77fd-4270-813b-0c698943f7ce\"\n}\n",
41        "{\n  \"id\": \"http://dx.doi.org/10.1594/PANGAEA.726855\"\n}\n"
42      ]
43    },
44    "title": {
45      "propertyOrder": 40,
46      "title": "Title",
47      "description": "A human-readable title.",
48      "type": "string",
49      "examples": [
50        "{\n  \"title\": \"My Package Title\"\n}\n"
51      ]
52    },
53    "description": {
54      "propertyOrder": 50,
55      "format": "textarea",
56      "title": "Description",
57      "description": "A text description. Markdown is encouraged.",
58      "type": "string",
59      "examples": [
60        "{\n  \"description\": \"# My Package description\\nAll about my package.\"\n}\n"
61      ]
62    },
63    "homepage": {
64      "propertyOrder": 60,
65      "title": "Home Page",
66      "description": "The home on the web that is related to this data package.",
67      "type": "string",
68      "format": "uri",
69      "examples": [
70        "{\n  \"homepage\": \"http://example.com/\"\n}\n"
71      ]
72    },
73    "created": {
74      "propertyOrder": 70,
75      "title": "Created",
76      "description": "The datetime on which this descriptor was created.",
77      "context": "The datetime must conform to the string formats for datetime as described in [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.6)",
78      "type": "string",
79      "format": "date-time",
80      "examples": [
81        "{\n  \"created\": \"1985-04-12T23:20:50.52Z\"\n}\n"
82      ]
83    },
84    "contributors": {
85      "propertyOrder": 80,
86      "title": "Contributors",
87      "description": "The contributors to this descriptor.",
88      "type": "array",
89      "minItems": 1,
90      "items": {
91        "title": "Contributor",
92        "description": "A contributor to this descriptor.",
93        "properties": {
94          "title": {
95            "title": "Title",
96            "description": "A human-readable title.",
97            "type": "string",
98            "examples": [
99              "{\n  \"title\": \"My Package Title\"\n}\n"
100            ]
101          },
102          "path": {
103            "title": "Path",
104            "description": "A fully qualified URL, or a POSIX file path..",
105            "type": "string",
106            "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
107            "examples": [
108              "{\n  \"path\": \"file.csv\"\n}\n",
109              "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
110            ],
111            "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
112          },
113          "email": {
114            "title": "Email",
115            "description": "An email address.",
116            "type": "string",
117            "format": "email",
118            "examples": [
119              "{\n  \"email\": \"example@example.com\"\n}\n"
120            ]
121          },
122          "organisation": {
123            "title": "Organization",
124            "description": "An organizational affiliation for this contributor.",
125            "type": "string"
126          },
127          "role": {
128            "type": "string",
129            "enum": [
130              "publisher",
131              "author",
132              "maintainer",
133              "wrangler",
134              "contributor"
135            ],
136            "default": "contributor"
137          }
138        },
139        "required": [
140          "title"
141        ],
142        "context": "Use of this property does not imply that the person was the original creator of, or a contributor to, the data in the descriptor, but refers to the composition of the descriptor itself."
143      },
144      "examples": [
145        "{\n  \"contributors\": [\n    {\n      \"title\": \"Joe Bloggs\"\n    }\n  ]\n}\n",
146        "{\n  \"contributors\": [\n    {\n      \"title\": \"Joe Bloggs\",\n      \"email\": \"joe@example.com\",\n      \"role\": \"author\"\n    }\n  ]\n}\n"
147      ]
148    },
149    "keywords": {
150      "propertyOrder": 90,
151      "title": "Keywords",
152      "description": "A list of keywords that describe this package.",
153      "type": "array",
154      "minItems": 1,
155      "items": {
156        "type": "string"
157      },
158      "examples": [
159        "{\n  \"keywords\": [\n    \"data\",\n    \"fiscal\",\n    \"transparency\"\n  ]\n}\n"
160      ]
161    },
162    "image": {
163      "propertyOrder": 100,
164      "title": "Image",
165      "description": "A image to represent this package.",
166      "type": "string",
167      "examples": [
168        "{\n  \"image\": \"http://example.com/image.jpg\"\n}\n",
169        "{\n  \"image\": \"relative/to/image.jpg\"\n}\n"
170      ]
171    },
172    "licenses": {
173      "propertyOrder": 110,
174      "title": "Licenses",
175      "description": "The license(s) under which this package is published.",
176      "type": "array",
177      "minItems": 1,
178      "items": {
179        "title": "License",
180        "description": "A license for this descriptor.",
181        "type": "object",
182        "properties": {
183          "name": {
184            "title": "Open Definition license identifier",
185            "description": "MUST be an Open Definition license identifier, see http://licenses.opendefinition.org/",
186            "type": "string",
187            "pattern": "^([-a-zA-Z0-9._])+$"
188          },
189          "path": {
190            "title": "Path",
191            "description": "A fully qualified URL, or a POSIX file path..",
192            "type": "string",
193            "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
194            "examples": [
195              "{\n  \"path\": \"file.csv\"\n}\n",
196              "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
197            ],
198            "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
199          },
200          "title": {
201            "title": "Title",
202            "description": "A human-readable title.",
203            "type": "string",
204            "examples": [
205              "{\n  \"title\": \"My Package Title\"\n}\n"
206            ]
207          }
208        },
209        "context": "Use of this property does not imply that the person was the original creator of, or a contributor to, the data in the descriptor, but refers to the composition of the descriptor itself."
210      },
211      "context": "This property is not legally binding and does not guarantee that the package is licensed under the terms defined herein.",
212      "examples": [
213        "{\n  \"licenses\": [\n    {\n      \"name\": \"odc-pddl-1.0\",\n      \"path\": \"http://opendatacommons.org/licenses/pddl/\",\n      \"title\": \"Open Data Commons Public Domain Dedication and License v1.0\"\n    }\n  ]\n}\n"
214      ]
215    },
216    "resources": {
217      "propertyOrder": 120,
218      "title": "Data Resources",
219      "description": "An `array` of Data Resource objects, each compliant with the [Data Resource](/data-resource/) specification.",
220      "type": "array",
221      "minItems": 1,
222      "items": {
223        "title": "Data Resource",
224        "description": "Data Resource.",
225        "type": "object",
226        "oneOf": [
227          {
228            "required": [
229              "name",
230              "data"
231            ]
232          },
233          {
234            "required": [
235              "name",
236              "path"
237            ]
238          }
239        ],
240        "properties": {
241          "profile": {
242            "propertyOrder": 10,
243            "default": "data-resource",
244            "title": "Profile",
245            "description": "The profile of this descriptor.",
246            "context": "Every Package and Resource descriptor has a profile. The default profile, if none is declared, is `data-package` for Package and `data-resource` for Resource.",
247            "type": "string",
248            "examples": [
249              "{\n  \"profile\": \"tabular-data-package\"\n}\n",
250              "{\n  \"profile\": \"http://example.com/my-profiles-json-schema.json\"\n}\n"
251            ]
252          },
253          "name": {
254            "propertyOrder": 20,
255            "title": "Name",
256            "description": "An identifier string. Lower case characters with `.`, `_`, `-` and `/` are allowed.",
257            "type": "string",
258            "pattern": "^([-a-z0-9._/])+$",
259            "context": "This is ideally a url-usable and human-readable name. Name `SHOULD` be invariant, meaning it `SHOULD NOT` change when its parent descriptor is updated.",
260            "examples": [
261              "{\n  \"name\": \"my-nice-name\"\n}\n"
262            ]
263          },
264          "path": {
265            "propertyOrder": 30,
266            "title": "Path",
267            "description": "A reference to the data for this resource, as either a path as a string, or an array of paths as strings. of valid URIs.",
268            "oneOf": [
269              {
270                "title": "Path",
271                "description": "A fully qualified URL, or a POSIX file path..",
272                "type": "string",
273                "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
274                "examples": [
275                  "{\n  \"path\": \"file.csv\"\n}\n",
276                  "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
277                ],
278                "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
279              },
280              {
281                "type": "array",
282                "minItems": 1,
283                "items": {
284                  "title": "Path",
285                  "description": "A fully qualified URL, or a POSIX file path..",
286                  "type": "string",
287                  "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
288                  "examples": [
289                    "{\n  \"path\": \"file.csv\"\n}\n",
290                    "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
291                  ],
292                  "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
293                },
294                "examples": [
295                  "[ \"file.csv\" ]\n",
296                  "[ \"http://example.com/file.csv\" ]\n"
297                ]
298              }
299            ],
300            "context": "The dereferenced value of each referenced data source in `path` `MUST` be commensurate with a native, dereferenced representation of the data the resource describes. For example, in a *Tabular* Data Resource, this means that the dereferenced value of `path` `MUST` be an array.",
301            "examples": [
302              "{\n  \"path\": [\n    \"file.csv\",\n    \"file2.csv\"\n  ]\n}\n",
303              "{\n  \"path\": [\n    \"http://example.com/file.csv\",\n    \"http://example.com/file2.csv\"\n  ]\n}\n",
304              "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
305            ]
306          },
307          "data": {
308            "propertyOrder": 230,
309            "title": "Data",
310            "description": "Inline data for this resource."
311          },
312          "schema": {
313            "propertyOrder": 40,
314            "title": "Schema",
315            "description": "A schema for this resource.",
316            "type": "object"
317          },
318          "title": {
319            "propertyOrder": 50,
320            "title": "Title",
321            "description": "A human-readable title.",
322            "type": "string",
323            "examples": [
324              "{\n  \"title\": \"My Package Title\"\n}\n"
325            ]
326          },
327          "description": {
328            "propertyOrder": 60,
329            "format": "textarea",
330            "title": "Description",
331            "description": "A text description. Markdown is encouraged.",
332            "type": "string",
333            "examples": [
334              "{\n  \"description\": \"# My Package description\\nAll about my package.\"\n}\n"
335            ]
336          },
337          "homepage": {
338            "propertyOrder": 70,
339            "title": "Home Page",
340            "description": "The home on the web that is related to this data package.",
341            "type": "string",
342            "format": "uri",
343            "examples": [
344              "{\n  \"homepage\": \"http://example.com/\"\n}\n"
345            ]
346          },
347          "sources": {
348            "propertyOrder": 140,
349            "options": {
350              "hidden": true
351            },
352            "title": "Sources",
353            "description": "The raw sources for this resource.",
354            "type": "array",
355            "minItems": 0,
356            "items": {
357              "title": "Source",
358              "description": "A source file.",
359              "type": "object",
360              "required": [
361                "title"
362              ],
363              "properties": {
364                "title": {
365                  "title": "Title",
366                  "description": "A human-readable title.",
367                  "type": "string",
368                  "examples": [
369                    "{\n  \"title\": \"My Package Title\"\n}\n"
370                  ]
371                },
372                "path": {
373                  "title": "Path",
374                  "description": "A fully qualified URL, or a POSIX file path..",
375                  "type": "string",
376                  "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
377                  "examples": [
378                    "{\n  \"path\": \"file.csv\"\n}\n",
379                    "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
380                  ],
381                  "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
382                },
383                "email": {
384                  "title": "Email",
385                  "description": "An email address.",
386                  "type": "string",
387                  "format": "email",
388                  "examples": [
389                    "{\n  \"email\": \"example@example.com\"\n}\n"
390                  ]
391                }
392              }
393            },
394            "examples": [
395              "{\n  \"sources\": [\n    {\n      \"title\": \"World Bank and OECD\",\n      \"path\": \"http://data.worldbank.org/indicator/NY.GDP.MKTP.CD\"\n    }\n  ]\n}\n"
396            ]
397          },
398          "licenses": {
399            "description": "The license(s) under which the resource is published.",
400            "propertyOrder": 150,
401            "options": {
402              "hidden": true
403            },
404            "title": "Licenses",
405            "type": "array",
406            "minItems": 1,
407            "items": {
408              "title": "License",
409              "description": "A license for this descriptor.",
410              "type": "object",
411              "properties": {
412                "name": {
413                  "title": "Open Definition license identifier",
414                  "description": "MUST be an Open Definition license identifier, see http://licenses.opendefinition.org/",
415                  "type": "string",
416                  "pattern": "^([-a-zA-Z0-9._])+$"
417                },
418                "path": {
419                  "title": "Path",
420                  "description": "A fully qualified URL, or a POSIX file path..",
421                  "type": "string",
422                  "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
423                  "examples": [
424                    "{\n  \"path\": \"file.csv\"\n}\n",
425                    "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
426                  ],
427                  "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
428                },
429                "title": {
430                  "title": "Title",
431                  "description": "A human-readable title.",
432                  "type": "string",
433                  "examples": [
434                    "{\n  \"title\": \"My Package Title\"\n}\n"
435                  ]
436                }
437              },
438              "context": "Use of this property does not imply that the person was the original creator of, or a contributor to, the data in the descriptor, but refers to the composition of the descriptor itself."
439            },
440            "context": "This property is not legally binding and does not guarantee that the package is licensed under the terms defined herein.",
441            "examples": [
442              "{\n  \"licenses\": [\n    {\n      \"name\": \"odc-pddl-1.0\",\n      \"path\": \"http://opendatacommons.org/licenses/pddl/\",\n      \"title\": \"Open Data Commons Public Domain Dedication and License v1.0\"\n    }\n  ]\n}\n"
443            ]
444          },
445          "format": {
446            "propertyOrder": 80,
447            "title": "Format",
448            "description": "The file format of this resource.",
449            "context": "`csv`, `xls`, `json` are examples of common formats.",
450            "type": "string",
451            "examples": [
452              "{\n  \"format\": \"xls\"\n}\n"
453            ]
454          },
455          "mediatype": {
456            "propertyOrder": 90,
457            "title": "Media Type",
458            "description": "The media type of this resource. Can be any valid media type listed with [IANA](https://www.iana.org/assignments/media-types/media-types.xhtml).",
459            "type": "string",
460            "pattern": "^(.+)/(.+)$",
461            "examples": [
462              "{\n  \"mediatype\": \"text/csv\"\n}\n"
463            ]
464          },
465          "encoding": {
466            "propertyOrder": 100,
467            "title": "Encoding",
468            "description": "The file encoding of this resource.",
469            "type": "string",
470            "default": "utf-8",
471            "examples": [
472              "{\n  \"encoding\": \"utf-8\"\n}\n"
473            ]
474          },
475          "bytes": {
476            "propertyOrder": 110,
477            "options": {
478              "hidden": true
479            },
480            "title": "Bytes",
481            "description": "The size of this resource in bytes.",
482            "type": "integer",
483            "examples": [
484              "{\n  \"bytes\": 2082\n}\n"
485            ]
486          },
487          "hash": {
488            "propertyOrder": 120,
489            "options": {
490              "hidden": true
491            },
492            "title": "Hash",
493            "type": "string",
494            "description": "The MD5 hash of this resource. Indicate other hashing algorithms with the {algorithm}:{hash} format.",
495            "pattern": "^([^:]+:[a-fA-F0-9]+|[a-fA-F0-9]{32}|)$",
496            "examples": [
497              "{\n  \"hash\": \"d25c9c77f588f5dc32059d2da1136c02\"\n}\n",
498              "{\n  \"hash\": \"SHA256:5262f12512590031bbcc9a430452bfd75c2791ad6771320bb4b5728bfb78c4d0\"\n}\n"
499            ]
500          }
501        }
502      },
503      "examples": [
504        "{\n  \"resources\": [\n    {\n      \"name\": \"my-data\",\n      \"data\": [\n        \"data.csv\"\n      ],\n      \"mediatype\": \"text/csv\"\n    }\n  ]\n}\n"
505      ]
506    },
507    "sources": {
508      "propertyOrder": 200,
509      "options": {
510        "hidden": true
511      },
512      "title": "Sources",
513      "description": "The raw sources for this resource.",
514      "type": "array",
515      "minItems": 0,
516      "items": {
517        "title": "Source",
518        "description": "A source file.",
519        "type": "object",
520        "required": [
521          "title"
522        ],
523        "properties": {
524          "title": {
525            "title": "Title",
526            "description": "A human-readable title.",
527            "type": "string",
528            "examples": [
529              "{\n  \"title\": \"My Package Title\"\n}\n"
530            ]
531          },
532          "path": {
533            "title": "Path",
534            "description": "A fully qualified URL, or a POSIX file path..",
535            "type": "string",
536            "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
537            "examples": [
538              "{\n  \"path\": \"file.csv\"\n}\n",
539              "{\n  \"path\": \"http://example.com/file.csv\"\n}\n"
540            ],
541            "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
542          },
543          "email": {
544            "title": "Email",
545            "description": "An email address.",
546            "type": "string",
547            "format": "email",
548            "examples": [
549              "{\n  \"email\": \"example@example.com\"\n}\n"
550            ]
551          }
552        }
553      },
554      "examples": [
555        "{\n  \"sources\": [\n    {\n      \"title\": \"World Bank and OECD\",\n      \"path\": \"http://data.worldbank.org/indicator/NY.GDP.MKTP.CD\"\n    }\n  ]\n}\n"
556      ]
557    }
558  }
559}