Skip to content

Instantly share code, notes, and snippets.

@robdyke
Last active March 20, 2019 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robdyke/d27a2b1f650b43fb02093790b5376811 to your computer and use it in GitHub Desktop.
Save robdyke/d27a2b1f650b43fb02093790b5376811 to your computer and use it in GitHub Desktop.
data products described in json
# Docker container image
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Data Package",
"description": "Data Package is a simple specification for data access and delivery.",
"type": "object",
"required": [
"resources"
],
"properties": {
"profile": {
"default": "data-package",
"propertyOrder": 10,
"title": "Profile",
"description": "The profile of this descriptor.",
"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.",
"type": "string",
"examples": [
"{\n \"profile\": \"tabular-data-package\"\n}\n",
"{\n \"profile\": \"http://example.com/my-profiles-json-schema.json\"\n}\n"
]
},
"name": {
"propertyOrder": 20,
"title": "Name",
"description": "An identifier string. Lower case characters with `.`, `_`, `-` and `/` are allowed.",
"type": "string",
"pattern": "^([-a-z0-9._/])+$",
"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.",
"examples": [
"{\n \"name\": \"my-nice-name\"\n}\n"
]
},
"id": {
"propertyOrder": 30,
"title": "ID",
"description": "A property reserved for globally unique identifiers. Examples of identifiers that are unique include UUIDs and DOIs.",
"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.",
"type": "string",
"examples": [
"{\n \"id\": \"b03ec84-77fd-4270-813b-0c698943f7ce\"\n}\n",
"{\n \"id\": \"http://dx.doi.org/10.1594/PANGAEA.726855\"\n}\n"
]
},
"title": {
"propertyOrder": 40,
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
},
"description": {
"propertyOrder": 50,
"format": "textarea",
"title": "Description",
"description": "A text description. Markdown is encouraged.",
"type": "string",
"examples": [
"{\n \"description\": \"# My Package description\\nAll about my package.\"\n}\n"
]
},
"homepage": {
"propertyOrder": 60,
"title": "Home Page",
"description": "The home on the web that is related to this data package.",
"type": "string",
"format": "uri",
"examples": [
"{\n \"homepage\": \"http://example.com/\"\n}\n"
]
},
"created": {
"propertyOrder": 70,
"title": "Created",
"description": "The datetime on which this descriptor was created.",
"context": "The datetime must conform to the string formats for datetime as described in [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.6)",
"type": "string",
"format": "date-time",
"examples": [
"{\n \"created\": \"1985-04-12T23:20:50.52Z\"\n}\n"
]
},
"contributors": {
"propertyOrder": 80,
"title": "Contributors",
"description": "The contributors to this descriptor.",
"type": "array",
"minItems": 1,
"items": {
"title": "Contributor",
"description": "A contributor to this descriptor.",
"properties": {
"title": {
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
},
"path": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"email": {
"title": "Email",
"description": "An email address.",
"type": "string",
"format": "email",
"examples": [
"{\n \"email\": \"example@example.com\"\n}\n"
]
},
"organisation": {
"title": "Organization",
"description": "An organizational affiliation for this contributor.",
"type": "string"
},
"role": {
"type": "string",
"enum": [
"publisher",
"author",
"maintainer",
"wrangler",
"contributor"
],
"default": "contributor"
}
},
"required": [
"title"
],
"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."
},
"examples": [
"{\n \"contributors\": [\n {\n \"title\": \"Joe Bloggs\"\n }\n ]\n}\n",
"{\n \"contributors\": [\n {\n \"title\": \"Joe Bloggs\",\n \"email\": \"joe@example.com\",\n \"role\": \"author\"\n }\n ]\n}\n"
]
},
"keywords": {
"propertyOrder": 90,
"title": "Keywords",
"description": "A list of keywords that describe this package.",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
},
"examples": [
"{\n \"keywords\": [\n \"data\",\n \"fiscal\",\n \"transparency\"\n ]\n}\n"
]
},
"image": {
"propertyOrder": 100,
"title": "Image",
"description": "A image to represent this package.",
"type": "string",
"examples": [
"{\n \"image\": \"http://example.com/image.jpg\"\n}\n",
"{\n \"image\": \"relative/to/image.jpg\"\n}\n"
]
},
"licenses": {
"propertyOrder": 110,
"title": "Licenses",
"description": "The license(s) under which this package is published.",
"type": "array",
"minItems": 1,
"items": {
"title": "License",
"description": "A license for this descriptor.",
"type": "object",
"properties": {
"name": {
"title": "Open Definition license identifier",
"description": "MUST be an Open Definition license identifier, see http://licenses.opendefinition.org/",
"type": "string",
"pattern": "^([-a-zA-Z0-9._])+$"
},
"path": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"title": {
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
}
},
"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."
},
"context": "This property is not legally binding and does not guarantee that the package is licensed under the terms defined herein.",
"examples": [
"{\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"
]
},
"resources": {
"propertyOrder": 120,
"title": "Data Resources",
"description": "An `array` of Data Resource objects, each compliant with the [Data Resource](/data-resource/) specification.",
"type": "array",
"minItems": 1,
"items": {
"title": "Data Resource",
"description": "Data Resource.",
"type": "object",
"oneOf": [
{
"required": [
"name",
"data"
]
},
{
"required": [
"name",
"path"
]
}
],
"properties": {
"profile": {
"propertyOrder": 10,
"default": "data-resource",
"title": "Profile",
"description": "The profile of this descriptor.",
"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.",
"type": "string",
"examples": [
"{\n \"profile\": \"tabular-data-package\"\n}\n",
"{\n \"profile\": \"http://example.com/my-profiles-json-schema.json\"\n}\n"
]
},
"name": {
"propertyOrder": 20,
"title": "Name",
"description": "An identifier string. Lower case characters with `.`, `_`, `-` and `/` are allowed.",
"type": "string",
"pattern": "^([-a-z0-9._/])+$",
"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.",
"examples": [
"{\n \"name\": \"my-nice-name\"\n}\n"
]
},
"path": {
"propertyOrder": 30,
"title": "Path",
"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.",
"oneOf": [
{
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
{
"type": "array",
"minItems": 1,
"items": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"examples": [
"[ \"file.csv\" ]\n",
"[ \"http://example.com/file.csv\" ]\n"
]
}
],
"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.",
"examples": [
"{\n \"path\": [\n \"file.csv\",\n \"file2.csv\"\n ]\n}\n",
"{\n \"path\": [\n \"http://example.com/file.csv\",\n \"http://example.com/file2.csv\"\n ]\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
]
},
"data": {
"propertyOrder": 230,
"title": "Data",
"description": "Inline data for this resource."
},
"schema": {
"propertyOrder": 40,
"title": "Schema",
"description": "A schema for this resource.",
"type": "object"
},
"title": {
"propertyOrder": 50,
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
},
"description": {
"propertyOrder": 60,
"format": "textarea",
"title": "Description",
"description": "A text description. Markdown is encouraged.",
"type": "string",
"examples": [
"{\n \"description\": \"# My Package description\\nAll about my package.\"\n}\n"
]
},
"homepage": {
"propertyOrder": 70,
"title": "Home Page",
"description": "The home on the web that is related to this data package.",
"type": "string",
"format": "uri",
"examples": [
"{\n \"homepage\": \"http://example.com/\"\n}\n"
]
},
"sources": {
"propertyOrder": 140,
"options": {
"hidden": true
},
"title": "Sources",
"description": "The raw sources for this resource.",
"type": "array",
"minItems": 0,
"items": {
"title": "Source",
"description": "A source file.",
"type": "object",
"required": [
"title"
],
"properties": {
"title": {
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
},
"path": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"email": {
"title": "Email",
"description": "An email address.",
"type": "string",
"format": "email",
"examples": [
"{\n \"email\": \"example@example.com\"\n}\n"
]
}
}
},
"examples": [
"{\n \"sources\": [\n {\n \"title\": \"World Bank and OECD\",\n \"path\": \"http://data.worldbank.org/indicator/NY.GDP.MKTP.CD\"\n }\n ]\n}\n"
]
},
"licenses": {
"description": "The license(s) under which the resource is published.",
"propertyOrder": 150,
"options": {
"hidden": true
},
"title": "Licenses",
"type": "array",
"minItems": 1,
"items": {
"title": "License",
"description": "A license for this descriptor.",
"type": "object",
"properties": {
"name": {
"title": "Open Definition license identifier",
"description": "MUST be an Open Definition license identifier, see http://licenses.opendefinition.org/",
"type": "string",
"pattern": "^([-a-zA-Z0-9._])+$"
},
"path": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"title": {
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
}
},
"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."
},
"context": "This property is not legally binding and does not guarantee that the package is licensed under the terms defined herein.",
"examples": [
"{\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"
]
},
"format": {
"propertyOrder": 80,
"title": "Format",
"description": "The file format of this resource.",
"context": "`csv`, `xls`, `json` are examples of common formats.",
"type": "string",
"examples": [
"{\n \"format\": \"xls\"\n}\n"
]
},
"mediatype": {
"propertyOrder": 90,
"title": "Media Type",
"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).",
"type": "string",
"pattern": "^(.+)/(.+)$",
"examples": [
"{\n \"mediatype\": \"text/csv\"\n}\n"
]
},
"encoding": {
"propertyOrder": 100,
"title": "Encoding",
"description": "The file encoding of this resource.",
"type": "string",
"default": "utf-8",
"examples": [
"{\n \"encoding\": \"utf-8\"\n}\n"
]
},
"bytes": {
"propertyOrder": 110,
"options": {
"hidden": true
},
"title": "Bytes",
"description": "The size of this resource in bytes.",
"type": "integer",
"examples": [
"{\n \"bytes\": 2082\n}\n"
]
},
"hash": {
"propertyOrder": 120,
"options": {
"hidden": true
},
"title": "Hash",
"type": "string",
"description": "The MD5 hash of this resource. Indicate other hashing algorithms with the {algorithm}:{hash} format.",
"pattern": "^([^:]+:[a-fA-F0-9]+|[a-fA-F0-9]{32}|)$",
"examples": [
"{\n \"hash\": \"d25c9c77f588f5dc32059d2da1136c02\"\n}\n",
"{\n \"hash\": \"SHA256:5262f12512590031bbcc9a430452bfd75c2791ad6771320bb4b5728bfb78c4d0\"\n}\n"
]
}
}
},
"examples": [
"{\n \"resources\": [\n {\n \"name\": \"my-data\",\n \"data\": [\n \"data.csv\"\n ],\n \"mediatype\": \"text/csv\"\n }\n ]\n}\n"
]
},
"sources": {
"propertyOrder": 200,
"options": {
"hidden": true
},
"title": "Sources",
"description": "The raw sources for this resource.",
"type": "array",
"minItems": 0,
"items": {
"title": "Source",
"description": "A source file.",
"type": "object",
"required": [
"title"
],
"properties": {
"title": {
"title": "Title",
"description": "A human-readable title.",
"type": "string",
"examples": [
"{\n \"title\": \"My Package Title\"\n}\n"
]
},
"path": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"examples": [
"{\n \"path\": \"file.csv\"\n}\n",
"{\n \"path\": \"http://example.com/file.csv\"\n}\n"
],
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"email": {
"title": "Email",
"description": "An email address.",
"type": "string",
"format": "email",
"examples": [
"{\n \"email\": \"example@example.com\"\n}\n"
]
}
}
},
"examples": [
"{\n \"sources\": [\n {\n \"title\": \"World Bank and OECD\",\n \"path\": \"http://data.worldbank.org/indicator/NY.GDP.MKTP.CD\"\n }\n ]\n}\n"
]
}
}
}
{
"name": "test-project",
"version": "1.0.0",
"description": "A Vue.js project",
"main": "src/main.js",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"test": "npm run unit",
"lint": "eslint --ext .js,.vue src test/unit",
"build": "node build/build.js"
},
"dependencies": {
"vue": "^2.5.2"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-airbnb-base": "^11.3.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-vue": "^4.0.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
# Something for packer.io
{
# general "metadata" like title, sources etc
"name" : "a-unique-human-readable-and-url-usable-identifier",
"title" : "A nice title",
"licenses" : [ ... ],
"sources" : [...],
# list of the data resources in this data package
"resources": [
{
... resource info described below ...
}
],
# optional
... additional information ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment