From a7da747499644b0ff1a6d7c5e3160d1b45391ab3 Mon Sep 17 00:00:00 2001 From: roll Date: Thu, 30 Nov 2023 09:14:30 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20bdc82?= =?UTF-8?q?093d3363e2c0c20c4d4f360d13b516fb1a6=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 6 +++--- LICENSE.html | 4 ++-- assets/js/{11.c25f6f04.js => 11.95cc6fa2.js} | 0 assets/js/{14.0892c777.js => 14.65071af7.js} | 2 +- assets/js/{15.74a14259.js => 15.14d9f21a.js} | 2 +- assets/js/{16.8c3fc9b4.js => 16.f9073eb5.js} | 2 +- assets/js/{17.4427245e.js => 17.11c3891e.js} | 2 +- assets/js/{18.503086c6.js => 18.661517b2.js} | 2 +- assets/js/{2.7ce9191a.js => 2.d6dd5bfd.js} | 0 assets/js/{20.6842625d.js => 20.cdf5cb64.js} | 2 +- assets/js/{21.a2d11985.js => 21.3fad06c6.js} | 2 +- assets/js/{25.ef9b4db4.js => 25.93436a0a.js} | 2 +- assets/js/{26.41a41339.js => 26.aa209af9.js} | 2 +- assets/js/{27.f0d2b4b1.js => 27.0b1aa329.js} | 2 +- assets/js/{28.ec459688.js => 28.64dcc20f.js} | 2 +- assets/js/{29.d686a7b6.js => 29.814104b2.js} | 2 +- assets/js/{30.f456e511.js => 30.7e1f8a56.js} | 2 +- assets/js/{4.627e831d.js => 4.a981ee64.js} | 0 assets/js/{5.3c75b492.js => 5.02f86579.js} | 0 assets/js/{6.9cbfe13d.js => 6.96220469.js} | 0 assets/js/{7.9ebea86b.js => 7.323437e3.js} | 0 assets/js/{8.7632112f.js => 8.ad8a6967.js} | 0 assets/js/{9.d491b2cb.js => 9.2e4ee646.js} | 2 +- assets/js/{app.2cbe3852.js => app.51b46ea3.js} | 4 ++-- contributing.html | 4 ++-- csv-dialect/index.html | 4 ++-- data-package-identifier/index.html | 4 ++-- data-package/index.html | 4 ++-- data-resource/index.html | 4 ++-- fiscal-data-package--budgets/index.html | 4 ++-- fiscal-data-package--spending/index.html | 4 ++-- fiscal-data-package/index.html | 4 ++-- guides/data-package/index.html | 4 ++-- guides/implementation/index.html | 4 ++-- index.html | 4 ++-- patterns/index.html | 4 ++-- profiles/index.html | 4 ++-- security/index.html | 4 ++-- table-schema/index.html | 4 ++-- tabular-data-package/index.html | 4 ++-- tabular-data-resource/index.html | 4 ++-- tabular-diff/index.html | 4 ++-- views/index.html | 4 ++-- 43 files changed, 59 insertions(+), 59 deletions(-) rename assets/js/{11.c25f6f04.js => 11.95cc6fa2.js} (100%) rename assets/js/{14.0892c777.js => 14.65071af7.js} (98%) rename assets/js/{15.74a14259.js => 15.14d9f21a.js} (99%) rename assets/js/{16.8c3fc9b4.js => 16.f9073eb5.js} (98%) rename assets/js/{17.4427245e.js => 17.11c3891e.js} (99%) rename assets/js/{18.503086c6.js => 18.661517b2.js} (99%) rename assets/js/{2.7ce9191a.js => 2.d6dd5bfd.js} (100%) rename assets/js/{20.6842625d.js => 20.cdf5cb64.js} (99%) rename assets/js/{21.a2d11985.js => 21.3fad06c6.js} (99%) rename assets/js/{25.ef9b4db4.js => 25.93436a0a.js} (98%) rename assets/js/{26.41a41339.js => 26.aa209af9.js} (99%) rename assets/js/{27.f0d2b4b1.js => 27.0b1aa329.js} (99%) rename assets/js/{28.ec459688.js => 28.64dcc20f.js} (99%) rename assets/js/{29.d686a7b6.js => 29.814104b2.js} (99%) rename assets/js/{30.f456e511.js => 30.7e1f8a56.js} (99%) rename assets/js/{4.627e831d.js => 4.a981ee64.js} (100%) rename assets/js/{5.3c75b492.js => 5.02f86579.js} (100%) rename assets/js/{6.9cbfe13d.js => 6.96220469.js} (100%) rename assets/js/{7.9ebea86b.js => 7.323437e3.js} (100%) rename assets/js/{8.7632112f.js => 8.ad8a6967.js} (100%) rename assets/js/{9.d491b2cb.js => 9.2e4ee646.js} (99%) rename assets/js/{app.2cbe3852.js => app.51b46ea3.js} (92%) diff --git a/404.html b/404.html index 139e4467..138fba41 100644 --- a/404.html +++ b/404.html @@ -8,13 +8,13 @@ - + -

404

Looks like we've got some broken links.
+ - + diff --git a/LICENSE.html b/LICENSE.html index e0945ead..7ea8975d 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -8,7 +8,7 @@ - + @@ -100,6 +100,6 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org (opens new window)

- + diff --git a/assets/js/11.c25f6f04.js b/assets/js/11.95cc6fa2.js similarity index 100% rename from assets/js/11.c25f6f04.js rename to assets/js/11.95cc6fa2.js diff --git a/assets/js/14.0892c777.js b/assets/js/14.65071af7.js similarity index 98% rename from assets/js/14.0892c777.js rename to assets/js/14.65071af7.js index 3985ea81..a1767850 100644 --- a/assets/js/14.0892c777.js +++ b/assets/js/14.65071af7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{384:function(t,a,e){"use strict";e.r(a);var s=e(26),n=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"frontmatter"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#frontmatter"}},[t._v("#")]),t._v(" Frontmatter")]),t._v(" "),e("p",[t._v("Frontmatter is the metadata in pages. It is an essential “API” between content authors and the theme designers. Here you can find the frontmatter definations for main category of pages.")]),t._v(" "),e("h3",{attrs:{id:"common-for-all-pages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-for-all-pages"}},[t._v("#")]),t._v(" Common for all pages")]),t._v(" "),e("p",[t._v("This frontmatter is common to all pages and maybe used in any of them. Every page MUST have a title. All other values are optional.")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[e("span",{pre:!0,attrs:{class:"token front-matter-block"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token font-matter yaml language-yaml"}},[t._v("title: Data Package\ntagline: # one sentence description\ndescription: # an exerpt or description\nimage: /data-package-diagram.png\nlayout: product | job [| blog]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")])]),t._v("\n")])])]),e("h3",{attrs:{id:"page-titles"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-titles"}},[t._v("#")]),t._v(" Page titles")]),t._v(" "),e("p",[t._v("Our convention is that page titles are set in frontmatter not in markdown. This allows them to be styled different etc.")]),t._v(" "),e("p",[t._v("✅")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[e("span",{pre:!0,attrs:{class:"token front-matter-block"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token font-matter yaml language-yaml"}},[t._v("title: My Page")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")])]),t._v("\n\nThis page is about X ...\n")])])]),e("p",[t._v("❌")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[e("span",{pre:!0,attrs:{class:"token title important"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("#")]),t._v(" My Page")]),t._v("\n\nThis page is about X\n")])])]),e("h3",{attrs:{id:"blog-posts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#blog-posts"}},[t._v("#")]),t._v(" Blog posts")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("---\ncategory: case-studies | grantee-profiles | pilots | grantee-profiles-2019\ndate: # date of publication in yyyy-mm-dd format\nauthor:\ntags: \n---\n")])])]),e("p",[t._v("When category == “case-studies” | “pilots”")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("interviewee: \nsubject_context: \n")])])]),e("p",[t._v("When category == “grantee-profiles”")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("github: \ntwitter:\nwebsite: \n")])])]),e("h3",{attrs:{id:"jobs-pages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#jobs-pages"}},[t._v("#")]),t._v(" Jobs pages")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[t._v("tagline:\npain:\ncontext: (?)\nhexagon:\n")])])]),e("h3",{attrs:{id:"product-pages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#product-pages"}},[t._v("#")]),t._v(" Product pages")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[t._v("hexagon:\ngithub: # list of github repos ...\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{386:function(t,a,e){"use strict";e.r(a);var s=e(26),n=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"frontmatter"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#frontmatter"}},[t._v("#")]),t._v(" Frontmatter")]),t._v(" "),e("p",[t._v("Frontmatter is the metadata in pages. It is an essential “API” between content authors and the theme designers. Here you can find the frontmatter definations for main category of pages.")]),t._v(" "),e("h3",{attrs:{id:"common-for-all-pages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-for-all-pages"}},[t._v("#")]),t._v(" Common for all pages")]),t._v(" "),e("p",[t._v("This frontmatter is common to all pages and maybe used in any of them. Every page MUST have a title. All other values are optional.")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[e("span",{pre:!0,attrs:{class:"token front-matter-block"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token font-matter yaml language-yaml"}},[t._v("title: Data Package\ntagline: # one sentence description\ndescription: # an exerpt or description\nimage: /data-package-diagram.png\nlayout: product | job [| blog]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")])]),t._v("\n")])])]),e("h3",{attrs:{id:"page-titles"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-titles"}},[t._v("#")]),t._v(" Page titles")]),t._v(" "),e("p",[t._v("Our convention is that page titles are set in frontmatter not in markdown. This allows them to be styled different etc.")]),t._v(" "),e("p",[t._v("✅")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[e("span",{pre:!0,attrs:{class:"token front-matter-block"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token font-matter yaml language-yaml"}},[t._v("title: My Page")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("---")])]),t._v("\n\nThis page is about X ...\n")])])]),e("p",[t._v("❌")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[e("span",{pre:!0,attrs:{class:"token title important"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("#")]),t._v(" My Page")]),t._v("\n\nThis page is about X\n")])])]),e("h3",{attrs:{id:"blog-posts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#blog-posts"}},[t._v("#")]),t._v(" Blog posts")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("---\ncategory: case-studies | grantee-profiles | pilots | grantee-profiles-2019\ndate: # date of publication in yyyy-mm-dd format\nauthor:\ntags: \n---\n")])])]),e("p",[t._v("When category == “case-studies” | “pilots”")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("interviewee: \nsubject_context: \n")])])]),e("p",[t._v("When category == “grantee-profiles”")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("github: \ntwitter:\nwebsite: \n")])])]),e("h3",{attrs:{id:"jobs-pages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#jobs-pages"}},[t._v("#")]),t._v(" Jobs pages")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[t._v("tagline:\npain:\ncontext: (?)\nhexagon:\n")])])]),e("h3",{attrs:{id:"product-pages"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#product-pages"}},[t._v("#")]),t._v(" Product pages")]),t._v(" "),e("div",{staticClass:"language-md extra-class"},[e("pre",{pre:!0,attrs:{class:"language-md"}},[e("code",[t._v("hexagon:\ngithub: # list of github repos ...\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/15.74a14259.js b/assets/js/15.14d9f21a.js similarity index 99% rename from assets/js/15.74a14259.js rename to assets/js/15.14d9f21a.js index c6eaa4d9..a2a6ac32 100644 --- a/assets/js/15.74a14259.js +++ b/assets/js/15.14d9f21a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{385:function(e,t,a){"use strict";a.r(t);var s=a(26),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),a("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),a("MetadataTable"),e._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),a("Language"),e._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),a("p",[e._v("CSV Dialect defines a simple format to describe the various dialects of CSV files in a language agnostic manner. It aims to deal with a reasonably large subset of the features which differ between dialects, such as terminator strings, quoting rules, escape rules and so on. The specification has been modeled around the union of the csv modules in Python and Ruby, and the bulk load capabilities of MySQL and PostgresQL.")]),e._v(" "),a("h3",{attrs:{id:"excluded"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#excluded"}},[e._v("#")]),e._v(" Excluded")]),e._v(" "),a("p",[e._v("CSV Dialect has nothing to do with the names, contents or types of the headers or data within the CSV file, only how it is formatted. However, CSV Dialect does allow the presence or absence of a header to be specified, similarly to "),a("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4180.txt",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC4180"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("p",[e._v("CSV Dialect is also orthogonal to the character encoding used in the CSV file. Note that it is possible for files in CSV format to contain data in more than one encoding.")]),e._v(" "),a("h3",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[e._v("#")]),e._v(" Usage")]),e._v(" "),a("p",[e._v("CSV Dialect is useful for programmes which might have to deal with multiple dialects of CSV file, but which can rely on being told out-of-band which dialect will be used in a given input stream. This reduces the need for heuristic inference of CSV dialects, and simplifies the implementation of CSV readers, which must juggle dialect inference, schema inference, unseekable input streams, character encoding issues, and the lazy reading of very large input streams.")]),e._v(" "),a("p",[e._v("Some related work can be found in "),a("a",{attrs:{href:"https://docs.google.com/spreadsheet/ccc?key=0AmU3V2vcPKrIdEhoU1NQSWtoQmJwcUNCelJtdkx2bFE&usp=sharing",target:"_blank",rel:"noopener noreferrer"}},[e._v("this comparison of csv dialect support"),a("OutboundLink")],1),e._v(", this "),a("a",{attrs:{href:"http://panda.readthedocs.org/en/latest/api.html#data-uploads",target:"_blank",rel:"noopener noreferrer"}},[e._v("example of similar JSON format"),a("OutboundLink")],1),e._v(", and in Python’s "),a("a",{attrs:{href:"http://www.python.org/dev/peps/pep-0305/",target:"_blank",rel:"noopener noreferrer"}},[e._v("PEP 305"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[e._v("#")]),e._v(" Specification")]),e._v(" "),a("p",[e._v("A CSV Dialect descriptor, "),a("code",[e._v("dialect")]),e._v(", "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" with the following properties:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("delimiter")]),e._v(" - specifies the character sequence which should separate fields (aka columns). Default = "),a("code",[e._v(",")]),e._v(". Example "),a("code",[e._v("\\t")]),e._v(". If not present, consumers should assume that it’s "),a("code",[e._v(",")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("lineTerminator")]),e._v(" - specifies the character sequence which should terminate rows. Default = "),a("code",[e._v("\\r\\n")])]),e._v(" "),a("li",[a("code",[e._v("quoteChar")]),e._v(" - specifies a one-character string to use as the quoting character. Default = "),a("code",[e._v('"')])]),e._v(" "),a("li",[a("code",[e._v("doubleQuote")]),e._v(" - controls the handling of quotes inside fields. If true, two consecutive quotes should be interpreted as one. Default = "),a("code",[e._v("true")])]),e._v(" "),a("li",[a("code",[e._v("escapeChar")]),e._v(" - specifies a one-character string to use for escaping (for example, "),a("code",[e._v("\\")]),e._v("), mutually exclusive with "),a("code",[e._v("quoteChar")]),e._v(". Not set by default")]),e._v(" "),a("li",[a("code",[e._v("nullSequence")]),e._v(" - specifies the null sequence (for example "),a("code",[e._v("\\N")]),e._v("). Not set by default")]),e._v(" "),a("li",[a("code",[e._v("skipInitialSpace")]),e._v(" - specifies how to interpret whitespace which immediately follows a delimiter; if "),a("code",[e._v("false")]),e._v(", it means that whitespace immediately after a delimiter should be treated as part of the following field. Default = "),a("code",[e._v("false")])]),e._v(" "),a("li",[a("code",[e._v("header")]),e._v(" - indicates whether the file includes a header row. If "),a("code",[e._v("true")]),e._v(" the first row in the file is a header row, not data. Default = "),a("code",[e._v("true")])]),e._v(" "),a("li",[a("code",[e._v("commentChar")]),e._v(" - indicates a one-character string to ignore any line whose row begins with this character. Not set by default")]),e._v(" "),a("li",[a("code",[e._v("caseSensitiveHeader")]),e._v(" - indicates that case in the header is meaningful. For example, columns "),a("code",[e._v("CAT")]),e._v(" and "),a("code",[e._v("Cat")]),e._v(" should not be equated. Default = "),a("code",[e._v("false")])]),e._v(" "),a("li",[a("code",[e._v("csvddfVersion")]),e._v(" - a number, in n.n format, e.g., "),a("code",[e._v("1.2")]),e._v(". If not present, consumers should assume latest schema version.")])]),e._v(" "),a("h3",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" Example")]),e._v(" "),a("p",[e._v("Here’s an example:")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"dialect"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"csvddfVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"delimiter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('";"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"doubleQuote"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lineTerminator"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"\\r\\n"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"quoteChar"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"\\""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"skipInitialSpace"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"header"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"commentChar"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"#"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{384:function(e,t,a){"use strict";a.r(t);var s=a(26),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),a("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),a("MetadataTable"),e._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),a("Language"),e._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),a("p",[e._v("CSV Dialect defines a simple format to describe the various dialects of CSV files in a language agnostic manner. It aims to deal with a reasonably large subset of the features which differ between dialects, such as terminator strings, quoting rules, escape rules and so on. The specification has been modeled around the union of the csv modules in Python and Ruby, and the bulk load capabilities of MySQL and PostgresQL.")]),e._v(" "),a("h3",{attrs:{id:"excluded"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#excluded"}},[e._v("#")]),e._v(" Excluded")]),e._v(" "),a("p",[e._v("CSV Dialect has nothing to do with the names, contents or types of the headers or data within the CSV file, only how it is formatted. However, CSV Dialect does allow the presence or absence of a header to be specified, similarly to "),a("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4180.txt",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC4180"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("p",[e._v("CSV Dialect is also orthogonal to the character encoding used in the CSV file. Note that it is possible for files in CSV format to contain data in more than one encoding.")]),e._v(" "),a("h3",{attrs:{id:"usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[e._v("#")]),e._v(" Usage")]),e._v(" "),a("p",[e._v("CSV Dialect is useful for programmes which might have to deal with multiple dialects of CSV file, but which can rely on being told out-of-band which dialect will be used in a given input stream. This reduces the need for heuristic inference of CSV dialects, and simplifies the implementation of CSV readers, which must juggle dialect inference, schema inference, unseekable input streams, character encoding issues, and the lazy reading of very large input streams.")]),e._v(" "),a("p",[e._v("Some related work can be found in "),a("a",{attrs:{href:"https://docs.google.com/spreadsheet/ccc?key=0AmU3V2vcPKrIdEhoU1NQSWtoQmJwcUNCelJtdkx2bFE&usp=sharing",target:"_blank",rel:"noopener noreferrer"}},[e._v("this comparison of csv dialect support"),a("OutboundLink")],1),e._v(", this "),a("a",{attrs:{href:"http://panda.readthedocs.org/en/latest/api.html#data-uploads",target:"_blank",rel:"noopener noreferrer"}},[e._v("example of similar JSON format"),a("OutboundLink")],1),e._v(", and in Python’s "),a("a",{attrs:{href:"http://www.python.org/dev/peps/pep-0305/",target:"_blank",rel:"noopener noreferrer"}},[e._v("PEP 305"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[e._v("#")]),e._v(" Specification")]),e._v(" "),a("p",[e._v("A CSV Dialect descriptor, "),a("code",[e._v("dialect")]),e._v(", "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" with the following properties:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("delimiter")]),e._v(" - specifies the character sequence which should separate fields (aka columns). Default = "),a("code",[e._v(",")]),e._v(". Example "),a("code",[e._v("\\t")]),e._v(". If not present, consumers should assume that it’s "),a("code",[e._v(",")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("lineTerminator")]),e._v(" - specifies the character sequence which should terminate rows. Default = "),a("code",[e._v("\\r\\n")])]),e._v(" "),a("li",[a("code",[e._v("quoteChar")]),e._v(" - specifies a one-character string to use as the quoting character. Default = "),a("code",[e._v('"')])]),e._v(" "),a("li",[a("code",[e._v("doubleQuote")]),e._v(" - controls the handling of quotes inside fields. If true, two consecutive quotes should be interpreted as one. Default = "),a("code",[e._v("true")])]),e._v(" "),a("li",[a("code",[e._v("escapeChar")]),e._v(" - specifies a one-character string to use for escaping (for example, "),a("code",[e._v("\\")]),e._v("), mutually exclusive with "),a("code",[e._v("quoteChar")]),e._v(". Not set by default")]),e._v(" "),a("li",[a("code",[e._v("nullSequence")]),e._v(" - specifies the null sequence (for example "),a("code",[e._v("\\N")]),e._v("). Not set by default")]),e._v(" "),a("li",[a("code",[e._v("skipInitialSpace")]),e._v(" - specifies how to interpret whitespace which immediately follows a delimiter; if "),a("code",[e._v("false")]),e._v(", it means that whitespace immediately after a delimiter should be treated as part of the following field. Default = "),a("code",[e._v("false")])]),e._v(" "),a("li",[a("code",[e._v("header")]),e._v(" - indicates whether the file includes a header row. If "),a("code",[e._v("true")]),e._v(" the first row in the file is a header row, not data. Default = "),a("code",[e._v("true")])]),e._v(" "),a("li",[a("code",[e._v("commentChar")]),e._v(" - indicates a one-character string to ignore any line whose row begins with this character. Not set by default")]),e._v(" "),a("li",[a("code",[e._v("caseSensitiveHeader")]),e._v(" - indicates that case in the header is meaningful. For example, columns "),a("code",[e._v("CAT")]),e._v(" and "),a("code",[e._v("Cat")]),e._v(" should not be equated. Default = "),a("code",[e._v("false")])]),e._v(" "),a("li",[a("code",[e._v("csvddfVersion")]),e._v(" - a number, in n.n format, e.g., "),a("code",[e._v("1.2")]),e._v(". If not present, consumers should assume latest schema version.")])]),e._v(" "),a("h3",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" Example")]),e._v(" "),a("p",[e._v("Here’s an example:")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"dialect"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"csvddfVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"delimiter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('";"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"doubleQuote"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lineTerminator"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"\\r\\n"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"quoteChar"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"\\""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"skipInitialSpace"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"header"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"commentChar"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"#"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/16.8c3fc9b4.js b/assets/js/16.f9073eb5.js similarity index 98% rename from assets/js/16.8c3fc9b4.js rename to assets/js/16.f9073eb5.js index 9399218d..80a15d0a 100644 --- a/assets/js/16.8c3fc9b4.js +++ b/assets/js/16.f9073eb5.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{388:function(t,a,e){"use strict";e.r(a);var r=e(26),n=Object(r.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"page-frontmatter-title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),e("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),e("MetadataTable"),t._v(" "),e("h2",{attrs:{id:"language"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),e("Language"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Data Package Identifiers are a simple way to identify a Data Package (and its location) using a string or small JSON object.")]),t._v(" "),e("p",[t._v("It exists because of the consistent need across applications to identify a Data Package. For example, in command line tools or libraries one will frequently want to take a Data Package Identifier as an argument.")]),t._v(" "),e("p",[t._v("For example, "),e("a",{attrs:{href:"http://datahub.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("DataHub"),e("OutboundLink")],1),t._v("’s "),e("code",[t._v("data-cli")]),t._v(" tool has commands like:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("# gdp is a Data Package identifier\ndata info gdp\n\n# https://github.com/datasets/gold-prices is a Data Package identifier\ndata install https://github.com/datasets/gold-prices\n")])])]),e("h3",{attrs:{id:"identifier-object-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#identifier-object-structure"}},[t._v("#")]),t._v(" Identifier Object Structure")]),t._v(" "),e("p",[t._v("The object structure looks like:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("{\n // URL to base of the Data Package\n // This URL should *always* have a trailing slash ('/')\n url: ...\n // URL to datapackage.json\n dataPackageJsonUrl: ...\n // name of the Data Package\n name: ...\n // version of the Data Package\n version: ...\n // if parsed from a Identifier String this is the original\n // specString\n original:\n}\n")])])]),e("p",[t._v("It can be parsed (and less importantly) serialized to a simple string. Spec strings will be frequently used on e.g. the command line to identify a data package.")]),t._v(" "),e("h3",{attrs:{id:"identifier-string"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#identifier-string"}},[t._v("#")]),t._v(" Identifier String")]),t._v(" "),e("p",[t._v("An Identifier String is a single string (rather than JSON object) that points to a Data Package. An Identifier String can be, in decreasing order of explicitness:")]),t._v(" "),e("ul",[e("li",[t._v("A URL that points directly to the "),e("code",[t._v("datapackage.json")]),t._v(" (no resolution needed):")])]),t._v(" "),e("p",[e("a",{attrs:{href:"http://mywebsite.com/mydatapackage/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://mywebsite.com/mydatapackage/datapackage.json"),e("OutboundLink")],1)]),t._v(" "),e("ul",[e("li",[t._v("A URL that points directly to the Data Package (that is, the directory containing the "),e("code",[t._v("datapackage.json")]),t._v("):")])]),t._v(" "),e("p",[e("a",{attrs:{href:"http://mywebsite.com/mydatapackage/",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://mywebsite.com/mydatapackage/"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("resolves to:")]),t._v(" "),e("p",[e("a",{attrs:{href:"http://mywebsite.com/mydatapackage/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://mywebsite.com/mydatapackage/datapackage.json"),e("OutboundLink")],1)]),t._v(" "),e("ul",[e("li",[t._v("A GitHub URL:")])]),t._v(" "),e("p",[e("a",{attrs:{href:"http://github.com/datasets/gold-prices",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://github.com/datasets/gold-prices"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("resolves to:")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://raw.githubusercontent.com/datasets/gold-prices/master/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://raw.githubusercontent.com/datasets/gold-prices/master/datapackage.json"),e("OutboundLink")],1)]),t._v(" "),e("ul",[e("li",[t._v("The "),e("code",[t._v("name")]),t._v(" of a dataset in the "),e("a",{attrs:{href:"https://datahub.io/core",target:"_blank",rel:"noopener noreferrer"}},[t._v("Core Datasets registry"),e("OutboundLink")],1),t._v(":")])]),t._v(" "),e("p",[t._v("gold-prices")]),t._v(" "),e("p",[t._v("resolves to:")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://datahub.io/core/gold-prices/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://datahub.io/core/gold-prices/datapackage.json"),e("OutboundLink")],1)])],1)}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{385:function(t,a,e){"use strict";e.r(a);var r=e(26),n=Object(r.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"page-frontmatter-title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),e("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),e("MetadataTable"),t._v(" "),e("h2",{attrs:{id:"language"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),e("Language"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("Data Package Identifiers are a simple way to identify a Data Package (and its location) using a string or small JSON object.")]),t._v(" "),e("p",[t._v("It exists because of the consistent need across applications to identify a Data Package. For example, in command line tools or libraries one will frequently want to take a Data Package Identifier as an argument.")]),t._v(" "),e("p",[t._v("For example, "),e("a",{attrs:{href:"http://datahub.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("DataHub"),e("OutboundLink")],1),t._v("’s "),e("code",[t._v("data-cli")]),t._v(" tool has commands like:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("# gdp is a Data Package identifier\ndata info gdp\n\n# https://github.com/datasets/gold-prices is a Data Package identifier\ndata install https://github.com/datasets/gold-prices\n")])])]),e("h3",{attrs:{id:"identifier-object-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#identifier-object-structure"}},[t._v("#")]),t._v(" Identifier Object Structure")]),t._v(" "),e("p",[t._v("The object structure looks like:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("{\n // URL to base of the Data Package\n // This URL should *always* have a trailing slash ('/')\n url: ...\n // URL to datapackage.json\n dataPackageJsonUrl: ...\n // name of the Data Package\n name: ...\n // version of the Data Package\n version: ...\n // if parsed from a Identifier String this is the original\n // specString\n original:\n}\n")])])]),e("p",[t._v("It can be parsed (and less importantly) serialized to a simple string. Spec strings will be frequently used on e.g. the command line to identify a data package.")]),t._v(" "),e("h3",{attrs:{id:"identifier-string"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#identifier-string"}},[t._v("#")]),t._v(" Identifier String")]),t._v(" "),e("p",[t._v("An Identifier String is a single string (rather than JSON object) that points to a Data Package. An Identifier String can be, in decreasing order of explicitness:")]),t._v(" "),e("ul",[e("li",[t._v("A URL that points directly to the "),e("code",[t._v("datapackage.json")]),t._v(" (no resolution needed):")])]),t._v(" "),e("p",[e("a",{attrs:{href:"http://mywebsite.com/mydatapackage/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://mywebsite.com/mydatapackage/datapackage.json"),e("OutboundLink")],1)]),t._v(" "),e("ul",[e("li",[t._v("A URL that points directly to the Data Package (that is, the directory containing the "),e("code",[t._v("datapackage.json")]),t._v("):")])]),t._v(" "),e("p",[e("a",{attrs:{href:"http://mywebsite.com/mydatapackage/",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://mywebsite.com/mydatapackage/"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("resolves to:")]),t._v(" "),e("p",[e("a",{attrs:{href:"http://mywebsite.com/mydatapackage/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://mywebsite.com/mydatapackage/datapackage.json"),e("OutboundLink")],1)]),t._v(" "),e("ul",[e("li",[t._v("A GitHub URL:")])]),t._v(" "),e("p",[e("a",{attrs:{href:"http://github.com/datasets/gold-prices",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://github.com/datasets/gold-prices"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("resolves to:")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://raw.githubusercontent.com/datasets/gold-prices/master/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://raw.githubusercontent.com/datasets/gold-prices/master/datapackage.json"),e("OutboundLink")],1)]),t._v(" "),e("ul",[e("li",[t._v("The "),e("code",[t._v("name")]),t._v(" of a dataset in the "),e("a",{attrs:{href:"https://datahub.io/core",target:"_blank",rel:"noopener noreferrer"}},[t._v("Core Datasets registry"),e("OutboundLink")],1),t._v(":")])]),t._v(" "),e("p",[t._v("gold-prices")]),t._v(" "),e("p",[t._v("resolves to:")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://datahub.io/core/gold-prices/datapackage.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://datahub.io/core/gold-prices/datapackage.json"),e("OutboundLink")],1)])],1)}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/17.4427245e.js b/assets/js/17.11c3891e.js similarity index 99% rename from assets/js/17.4427245e.js rename to assets/js/17.11c3891e.js index 2fa01e53..382e92b0 100644 --- a/assets/js/17.4427245e.js +++ b/assets/js/17.11c3891e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{386:function(t,a,e){"use strict";e.r(a);var s=e(26),r=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"page-frontmatter-title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),e("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),e("MetadataTable"),t._v(" "),e("h2",{attrs:{id:"language"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),e("Language"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("A Data Package consists of:")]),t._v(" "),e("ul",[e("li",[t._v("Metadata that describes the structure and contents of the package")]),t._v(" "),e("li",[t._v("Resources such as data files that form the contents of the package")])]),t._v(" "),e("p",[t._v("The Data Package metadata is stored in a “descriptor”. This descriptor is what makes a collection of data a Data Package. The structure of this descriptor is the main content of the specification below.")]),t._v(" "),e("p",[t._v("In addition to this descriptor a data package will include other resources such as data files. The Data Package specification does NOT impose any requirements on their form or structure and can therefore be used for packaging "),e("strong",[t._v("any kind of data")]),t._v(".")]),t._v(" "),e("p",[t._v("The data included in the package may be provided as:")]),t._v(" "),e("ul",[e("li",[t._v("Files bundled locally with the package descriptor")]),t._v(" "),e("li",[t._v("Remote resources, referenced by URL")]),t._v(" "),e("li",[t._v("“Inline” data (see below) which is included directly in the descriptor")])]),t._v(" "),e("h3",{attrs:{id:"illustrative-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#illustrative-structure"}},[t._v("#")]),t._v(" Illustrative Structure")]),t._v(" "),e("p",[t._v("A minimal data package on disk would be a directory containing a single file:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("datapackage.json # (required) metadata and schemas for this data package\n")])])]),e("p",[t._v("Lacking a single external source of data would make this of limited use. A slightly less minimal version would be:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("datapackage.json\n# a data file (CSV in this case)\ndata.csv\n")])])]),e("p",[t._v("Additional files such as a README, scripts (for processing or analyzing the data) and other material may be provided. By convention scripts go in a scripts directory and thus, a more elaborate data package could look like this:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("datapackage.json # (required) metadata and schemas for this data package\nREADME.md # (optional) README in markdown format\n\n# data files may go either in data subdirectory or in main directory\nmydata.csv\ndata/otherdata.csv\n\n# the directory for code scripts - again these can go in the base directory\nscripts/my-preparation-script.py\n")])])]),e("p",[t._v("Several example data packages can be found in the "),e("a",{attrs:{href:"https://github.com/datasets",target:"_blank",rel:"noopener noreferrer"}},[t._v("datasets organization on github"),e("OutboundLink")],1),t._v(", including:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/datasets/gdp",target:"_blank",rel:"noopener noreferrer"}},[t._v("World GDP"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/datasets/country-codes",target:"_blank",rel:"noopener noreferrer"}},[t._v("ISO 3166-2 country codes"),e("OutboundLink")],1)])]),t._v(" "),e("h2",{attrs:{id:"specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[t._v("#")]),t._v(" Specification")]),t._v(" "),e("h3",{attrs:{id:"descriptor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#descriptor"}},[t._v("#")]),t._v(" Descriptor")]),t._v(" "),e("p",[t._v("The descriptor is the central file in a Data Package. It provides:")]),t._v(" "),e("ul",[e("li",[t._v("General metadata such as the package’s title, license, publisher etc")]),t._v(" "),e("li",[t._v("A list of the data “resources” that make up the package including their location on disk or online and other relevant information (including, possibly, schema information about these data resources in a structured form)")])]),t._v(" "),e("p",[t._v("A Data Package descriptor "),e("code",[t._v("MUST")]),t._v(" be a valid JSON "),e("code",[t._v("object")]),t._v(". (JSON is defined in "),e("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4627.txt",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC 4627"),e("OutboundLink")],1),t._v("). When available as a file it "),e("code",[t._v("MUST")]),t._v(" be named "),e("code",[t._v("datapackage.json")]),t._v(" and it "),e("code",[t._v("MUST")]),t._v(" be placed in the top-level directory (relative to any other resources provided as part of the data package).")]),t._v(" "),e("p",[t._v("The descriptor "),e("code",[t._v("MUST")]),t._v(" contain a "),e("code",[t._v("resources")]),t._v(" property describing the data resources.")]),t._v(" "),e("p",[t._v("All other properties are considered "),e("code",[t._v("metadata")]),t._v(" properties. The descriptor "),e("code",[t._v("MAY")]),t._v(" contain any number of other "),e("code",[t._v("metadata")]),t._v(" properties. The following sections provides a description of required and optional metadata properties for a Data Package descriptor.")]),t._v(" "),e("p",[t._v("Adherence to the specification does not imply that additional, non-specified properties cannot be used: a descriptor "),e("code",[t._v("MAY")]),t._v(" include any number of properties in additional to those described as required and optional properties. For example, if you were storing time series data and wanted to list the temporal coverage of the data in the Data Package you could add a property "),e("code",[t._v("temporal")]),t._v(" (cf "),e("a",{attrs:{href:"http://dublincore.org/documents/usageguide/qualifiers.shtml#temporal",target:"_blank",rel:"noopener noreferrer"}},[t._v("Dublin Core"),e("OutboundLink")],1),t._v("):")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"temporal"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"19th Century"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"start"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1800-01-01"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"end"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1899-12-31"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("This flexibility enables specific communities to extend Data Packages as appropriate for the data they manage. As an example, the "),e("RouterLink",{attrs:{to:"/tabular-data-package/"}},[t._v("Tabular Data Package")]),t._v(" specification extends Data Package to the case where all the data is tabular and stored in CSV.")],1),t._v(" "),e("p",[t._v("Here is an illustrative example of a datapackage JSON file:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n # general "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadata"')]),t._v(" like title"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" sources etc\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a-unique-human-readable-and-url-usable-identifier"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A nice title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n # list "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("of")]),t._v(" the data resources "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" data "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v(" resource info described below "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n # optional\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v(" additional information "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"resource-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#resource-information"}},[t._v("#")]),t._v(" Resource Information")]),t._v(" "),e("p",[t._v("Packaged data resources are described in the "),e("code",[t._v("resources")]),t._v(" property of the package descriptor. This property "),e("code",[t._v("MUST")]),t._v(" be an array of "),e("code",[t._v("objects")]),t._v(". Each object "),e("code",[t._v("MUST")]),t._v(" follow the "),e("RouterLink",{attrs:{to:"/data-resource/"}},[t._v("Data Resource specification")]),t._v(".")],1),t._v(" "),e("h3",{attrs:{id:"metadata"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#metadata"}},[t._v("#")]),t._v(" Metadata")]),t._v(" "),e("h4",{attrs:{id:"required-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#required-properties"}},[t._v("#")]),t._v(" Required Properties")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("resources")]),t._v(" property is required, with at least one resource.")]),t._v(" "),e("h4",{attrs:{id:"recommended-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#recommended-properties"}},[t._v("#")]),t._v(" Recommended Properties")]),t._v(" "),e("p",[t._v("In addition to the required properties, the following properties "),e("code",[t._v("SHOULD")]),t._v(" be included in every package descriptor:")]),t._v(" "),e("h5",{attrs:{id:"name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#name"}},[t._v("#")]),t._v(" "),e("code",[t._v("name")])]),t._v(" "),e("p",[t._v("A short url-usable (and preferably human-readable) name of the package. This "),e("code",[t._v("MUST")]),t._v(" be lower-case and contain only alphanumeric characters along with “.”, “_” or “-” characters. It will function as a unique identifier and therefore "),e("code",[t._v("SHOULD")]),t._v(" be unique in relation to any registry in which this package will be deposited (and preferably globally unique).")]),t._v(" "),e("p",[t._v("The name "),e("code",[t._v("SHOULD")]),t._v(" be invariant, meaning that it "),e("code",[t._v("SHOULD NOT")]),t._v(" change when a data package is updated, unless the new package version should be considered a distinct package, e.g. due to significant changes in structure or interpretation. Version distinction "),e("code",[t._v("SHOULD")]),t._v(" be left to the version property. As a corollary, the name also "),e("code",[t._v("SHOULD NOT")]),t._v(" include an indication of time range covered.")]),t._v(" "),e("h5",{attrs:{id:"id"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#id"}},[t._v("#")]),t._v(" "),e("code",[t._v("id")])]),t._v(" "),e("p",[t._v("A property reserved for globally unique identifiers. Examples of identifiers that are unique include UUIDs and DOIs.")]),t._v(" "),e("p",[t._v("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 "),e("code",[t._v("id")]),t._v(" property "),e("code",[t._v("MUST")]),t._v(" ensure identifiers are globally unique.")]),t._v(" "),e("p",[t._v("Examples:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b03ec84-77fd-4270-813b-0c698943f7ce"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://doi.org/10.1594/PANGAEA.726855"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h5",{attrs:{id:"licenses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#licenses"}},[t._v("#")]),t._v(" "),e("code",[t._v("licenses")])]),t._v(" "),e("p",[t._v("The license(s) under which the package is provided.")]),t._v(" "),e("p",[e("strong",[t._v("This property is not legally binding and does not guarantee the package is licensed under the terms defined in this property.")])]),t._v(" "),e("p",[e("code",[t._v("licenses")]),t._v(" "),e("code",[t._v("MUST")]),t._v(" be an array. Each item in the array is a License. Each "),e("code",[t._v("MUST")]),t._v(" be an "),e("code",[t._v("object")]),t._v(". The object "),e("code",[t._v("MUST")]),t._v(" contain a "),e("code",[t._v("name")]),t._v(" property and/or a "),e("code",[t._v("path")]),t._v(" property. It "),e("code",[t._v("MAY")]),t._v(" contain a "),e("code",[t._v("title")]),t._v(" property.")]),t._v(" "),e("p",[t._v("Here is an example:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ODC-PDDL-1.0"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://opendatacommons.org/licenses/pddl/"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Open Data Commons Public Domain Dedication and License v1.0"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v("name")]),t._v(": The "),e("code",[t._v("name")]),t._v(" "),e("code",[t._v("MUST")]),t._v(" be an "),e("a",{attrs:{href:"http://licenses.opendefinition.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Open Definition license ID"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("code",[t._v("path")]),t._v(": A "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(" string, that is a fully qualified HTTP address, or a relative POSIX path (see "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("the url-or-path definition in Data Resource for details")]),t._v(").")],1),t._v(" "),e("li",[e("code",[t._v("title")]),t._v(": A human-readable title.")])]),t._v(" "),e("h5",{attrs:{id:"profile"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#profile"}},[t._v("#")]),t._v(" "),e("code",[t._v("profile")])]),t._v(" "),e("p",[t._v("A string identifying the "),e("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profile")]),t._v(" of this descriptor as per the "),e("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profiles")]),t._v(" specification.")],1),t._v(" "),e("p",[t._v("Examples:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-package"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/my-profiles-json-schema.json"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h4",{attrs:{id:"optional-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optional-properties"}},[t._v("#")]),t._v(" Optional Properties")]),t._v(" "),e("p",[t._v("The following are commonly used properties that the package descriptor "),e("code",[t._v("MAY")]),t._v(" contain:")]),t._v(" "),e("h5",{attrs:{id:"title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#title"}},[t._v("#")]),t._v(" "),e("code",[t._v("title")])]),t._v(" "),e("p",[t._v("A "),e("code",[t._v("string")]),t._v(" providing a title or one sentence description for this package")]),t._v(" "),e("h5",{attrs:{id:"description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#description"}},[t._v("#")]),t._v(" "),e("code",[t._v("description")])]),t._v(" "),e("p",[t._v("A description of the package. The description "),e("code",[t._v("MUST")]),t._v(" be "),e("a",{attrs:{href:"http://commonmark.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("markdown"),e("OutboundLink")],1),t._v(" formatted – this also allows for simple plain text as plain text is itself valid markdown. The first paragraph (up to the first double line break) should be usable as summary information for the package.")]),t._v(" "),e("h5",{attrs:{id:"homepage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#homepage"}},[t._v("#")]),t._v(" "),e("code",[t._v("homepage")])]),t._v(" "),e("p",[t._v("A URL for the home on the web that is related to this data package.")]),t._v(" "),e("h5",{attrs:{id:"version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version"}},[t._v("#")]),t._v(" "),e("code",[t._v("version")])]),t._v(" "),e("p",[t._v("A version string identifying the version of the package. It should conform to the "),e("a",{attrs:{href:"http://semver.org",target:"_blank",rel:"noopener noreferrer"}},[t._v("Semantic Versioning"),e("OutboundLink")],1),t._v(" requirements and should follow the "),e("RouterLink",{attrs:{to:"/patterns/#data-package-version"}},[t._v("Data Package Version")]),t._v(" pattern.")],1),t._v(" "),e("h5",{attrs:{id:"sources"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sources"}},[t._v("#")]),t._v(" "),e("code",[t._v("sources")])]),t._v(" "),e("p",[t._v("The raw sources for this data package. It "),e("code",[t._v("MUST")]),t._v(" be an array of Source objects. Each Source object "),e("code",[t._v("MUST")]),t._v(" have a "),e("code",[t._v("title")]),t._v(" and "),e("code",[t._v("MAY")]),t._v(" have "),e("code",[t._v("path")]),t._v(" and/or "),e("code",[t._v("email")]),t._v(" properties. Example:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"World Bank and OECD"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://data.worldbank.org/indicator/NY.GDP.MKTP.CD"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v("title")]),t._v(": title of the source (e.g. document or organization name)")]),t._v(" "),e("li",[e("code",[t._v("path")]),t._v(": A "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(" string, that is a fully qualified HTTP address, or a relative POSIX path (see "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("the url-or-path definition in Data Resource for details")]),t._v(").")],1),t._v(" "),e("li",[e("code",[t._v("email")]),t._v(": An email address")])]),t._v(" "),e("h5",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" "),e("code",[t._v("contributors")])]),t._v(" "),e("p",[t._v("The people or organizations who contributed to this Data Package. It "),e("code",[t._v("MUST")]),t._v(" be an array. Each entry is a Contributor and "),e("code",[t._v("MUST")]),t._v(" be an "),e("code",[t._v("object")]),t._v(". A Contributor "),e("code",[t._v("MUST")]),t._v(" have a "),e("code",[t._v("title")]),t._v(" property and MAY contain "),e("code",[t._v("path")]),t._v(", "),e("code",[t._v("email")]),t._v(", "),e("code",[t._v("role")]),t._v(" and "),e("code",[t._v("organization")]),t._v(" properties. An example of the object structure is as follows:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contributors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Joe Bloggs"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"email"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"joe@bloggs.com"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://www.bloggs.com"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"author"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v("title")]),t._v(": name/title of the contributor (name for person, name/title of organization)")]),t._v(" "),e("li",[e("code",[t._v("path")]),t._v(": a fully qualified http URL pointing to a relevant location online for the contributor")]),t._v(" "),e("li",[e("code",[t._v("email")]),t._v(": An email address")]),t._v(" "),e("li",[e("code",[t._v("role")]),t._v(": a string describing the role of the contributor. It’s "),e("code",[t._v("RECOMMENDED")]),t._v(" to be one of: "),e("code",[t._v("author")]),t._v(", "),e("code",[t._v("publisher")]),t._v(", "),e("code",[t._v("maintainer")]),t._v(", "),e("code",[t._v("wrangler")]),t._v(", and "),e("code",[t._v("contributor")]),t._v(". Defaults to "),e("code",[t._v("contributor")]),t._v(".\n"),e("ul",[e("li",[t._v("Note on semantics: use of the “author” property does not imply that that person was the original creator of the data in the data package - merely that they created and/or maintain the data package. It is common for data packages to “package” up data from elsewhere. The original origin of the data can be indicated with the "),e("code",[t._v("sources")]),t._v(" property - see above.")])])]),t._v(" "),e("li",[e("code",[t._v("organization")]),t._v(": a string describing the organization this contributor is affiliated to.")])]),t._v(" "),e("h5",{attrs:{id:"keywords"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#keywords"}},[t._v("#")]),t._v(" "),e("code",[t._v("keywords")])]),t._v(" "),e("p",[t._v("An Array of string keywords to assist users searching for the package in catalogs.")]),t._v(" "),e("h5",{attrs:{id:"image"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#image"}},[t._v("#")]),t._v(" "),e("code",[t._v("image")])]),t._v(" "),e("p",[t._v("An image to use for this data package. For example, when showing the package in a listing.")]),t._v(" "),e("p",[t._v("The value of the image property "),e("code",[t._v("MUST")]),t._v(" be a string pointing to the location of the image. The string must be a "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(", that is a fully qualified HTTP address, or a relative POSIX path (see "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("the url-or-path definition in Data Resource for details")]),t._v(").")],1),t._v(" "),e("h5",{attrs:{id:"created"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#created"}},[t._v("#")]),t._v(" "),e("code",[t._v("created")])]),t._v(" "),e("p",[t._v("The datetime on which this was created.")]),t._v(" "),e("p",[t._v("Note: semantics may vary between publishers – for some this is the datetime the data was created, for others the datetime the package was created.")]),t._v(" "),e("p",[t._v("The datetime must conform to the string formats for datetime as described in "),e("a",{attrs:{href:"https://tools.ietf.org/html/rfc3339#section-5.6",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC3339"),e("OutboundLink")],1),t._v(". Example:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"created"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1985-04-12T23:20:50.52Z"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])],1)}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{387:function(t,a,e){"use strict";e.r(a);var s=e(26),r=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"page-frontmatter-title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),e("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),e("MetadataTable"),t._v(" "),e("h2",{attrs:{id:"language"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),e("Language"),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("A Data Package consists of:")]),t._v(" "),e("ul",[e("li",[t._v("Metadata that describes the structure and contents of the package")]),t._v(" "),e("li",[t._v("Resources such as data files that form the contents of the package")])]),t._v(" "),e("p",[t._v("The Data Package metadata is stored in a “descriptor”. This descriptor is what makes a collection of data a Data Package. The structure of this descriptor is the main content of the specification below.")]),t._v(" "),e("p",[t._v("In addition to this descriptor a data package will include other resources such as data files. The Data Package specification does NOT impose any requirements on their form or structure and can therefore be used for packaging "),e("strong",[t._v("any kind of data")]),t._v(".")]),t._v(" "),e("p",[t._v("The data included in the package may be provided as:")]),t._v(" "),e("ul",[e("li",[t._v("Files bundled locally with the package descriptor")]),t._v(" "),e("li",[t._v("Remote resources, referenced by URL")]),t._v(" "),e("li",[t._v("“Inline” data (see below) which is included directly in the descriptor")])]),t._v(" "),e("h3",{attrs:{id:"illustrative-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#illustrative-structure"}},[t._v("#")]),t._v(" Illustrative Structure")]),t._v(" "),e("p",[t._v("A minimal data package on disk would be a directory containing a single file:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("datapackage.json # (required) metadata and schemas for this data package\n")])])]),e("p",[t._v("Lacking a single external source of data would make this of limited use. A slightly less minimal version would be:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("datapackage.json\n# a data file (CSV in this case)\ndata.csv\n")])])]),e("p",[t._v("Additional files such as a README, scripts (for processing or analyzing the data) and other material may be provided. By convention scripts go in a scripts directory and thus, a more elaborate data package could look like this:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("datapackage.json # (required) metadata and schemas for this data package\nREADME.md # (optional) README in markdown format\n\n# data files may go either in data subdirectory or in main directory\nmydata.csv\ndata/otherdata.csv\n\n# the directory for code scripts - again these can go in the base directory\nscripts/my-preparation-script.py\n")])])]),e("p",[t._v("Several example data packages can be found in the "),e("a",{attrs:{href:"https://github.com/datasets",target:"_blank",rel:"noopener noreferrer"}},[t._v("datasets organization on github"),e("OutboundLink")],1),t._v(", including:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/datasets/gdp",target:"_blank",rel:"noopener noreferrer"}},[t._v("World GDP"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/datasets/country-codes",target:"_blank",rel:"noopener noreferrer"}},[t._v("ISO 3166-2 country codes"),e("OutboundLink")],1)])]),t._v(" "),e("h2",{attrs:{id:"specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[t._v("#")]),t._v(" Specification")]),t._v(" "),e("h3",{attrs:{id:"descriptor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#descriptor"}},[t._v("#")]),t._v(" Descriptor")]),t._v(" "),e("p",[t._v("The descriptor is the central file in a Data Package. It provides:")]),t._v(" "),e("ul",[e("li",[t._v("General metadata such as the package’s title, license, publisher etc")]),t._v(" "),e("li",[t._v("A list of the data “resources” that make up the package including their location on disk or online and other relevant information (including, possibly, schema information about these data resources in a structured form)")])]),t._v(" "),e("p",[t._v("A Data Package descriptor "),e("code",[t._v("MUST")]),t._v(" be a valid JSON "),e("code",[t._v("object")]),t._v(". (JSON is defined in "),e("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4627.txt",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC 4627"),e("OutboundLink")],1),t._v("). When available as a file it "),e("code",[t._v("MUST")]),t._v(" be named "),e("code",[t._v("datapackage.json")]),t._v(" and it "),e("code",[t._v("MUST")]),t._v(" be placed in the top-level directory (relative to any other resources provided as part of the data package).")]),t._v(" "),e("p",[t._v("The descriptor "),e("code",[t._v("MUST")]),t._v(" contain a "),e("code",[t._v("resources")]),t._v(" property describing the data resources.")]),t._v(" "),e("p",[t._v("All other properties are considered "),e("code",[t._v("metadata")]),t._v(" properties. The descriptor "),e("code",[t._v("MAY")]),t._v(" contain any number of other "),e("code",[t._v("metadata")]),t._v(" properties. The following sections provides a description of required and optional metadata properties for a Data Package descriptor.")]),t._v(" "),e("p",[t._v("Adherence to the specification does not imply that additional, non-specified properties cannot be used: a descriptor "),e("code",[t._v("MAY")]),t._v(" include any number of properties in additional to those described as required and optional properties. For example, if you were storing time series data and wanted to list the temporal coverage of the data in the Data Package you could add a property "),e("code",[t._v("temporal")]),t._v(" (cf "),e("a",{attrs:{href:"http://dublincore.org/documents/usageguide/qualifiers.shtml#temporal",target:"_blank",rel:"noopener noreferrer"}},[t._v("Dublin Core"),e("OutboundLink")],1),t._v("):")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"temporal"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"19th Century"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"start"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1800-01-01"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"end"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1899-12-31"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("This flexibility enables specific communities to extend Data Packages as appropriate for the data they manage. As an example, the "),e("RouterLink",{attrs:{to:"/tabular-data-package/"}},[t._v("Tabular Data Package")]),t._v(" specification extends Data Package to the case where all the data is tabular and stored in CSV.")],1),t._v(" "),e("p",[t._v("Here is an illustrative example of a datapackage JSON file:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n # general "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"metadata"')]),t._v(" like title"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" sources etc\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a-unique-human-readable-and-url-usable-identifier"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A nice title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n # list "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("of")]),t._v(" the data resources "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" data "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v(" resource info described below "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n # optional\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v(" additional information "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"resource-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#resource-information"}},[t._v("#")]),t._v(" Resource Information")]),t._v(" "),e("p",[t._v("Packaged data resources are described in the "),e("code",[t._v("resources")]),t._v(" property of the package descriptor. This property "),e("code",[t._v("MUST")]),t._v(" be an array of "),e("code",[t._v("objects")]),t._v(". Each object "),e("code",[t._v("MUST")]),t._v(" follow the "),e("RouterLink",{attrs:{to:"/data-resource/"}},[t._v("Data Resource specification")]),t._v(".")],1),t._v(" "),e("h3",{attrs:{id:"metadata"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#metadata"}},[t._v("#")]),t._v(" Metadata")]),t._v(" "),e("h4",{attrs:{id:"required-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#required-properties"}},[t._v("#")]),t._v(" Required Properties")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("resources")]),t._v(" property is required, with at least one resource.")]),t._v(" "),e("h4",{attrs:{id:"recommended-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#recommended-properties"}},[t._v("#")]),t._v(" Recommended Properties")]),t._v(" "),e("p",[t._v("In addition to the required properties, the following properties "),e("code",[t._v("SHOULD")]),t._v(" be included in every package descriptor:")]),t._v(" "),e("h5",{attrs:{id:"name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#name"}},[t._v("#")]),t._v(" "),e("code",[t._v("name")])]),t._v(" "),e("p",[t._v("A short url-usable (and preferably human-readable) name of the package. This "),e("code",[t._v("MUST")]),t._v(" be lower-case and contain only alphanumeric characters along with “.”, “_” or “-” characters. It will function as a unique identifier and therefore "),e("code",[t._v("SHOULD")]),t._v(" be unique in relation to any registry in which this package will be deposited (and preferably globally unique).")]),t._v(" "),e("p",[t._v("The name "),e("code",[t._v("SHOULD")]),t._v(" be invariant, meaning that it "),e("code",[t._v("SHOULD NOT")]),t._v(" change when a data package is updated, unless the new package version should be considered a distinct package, e.g. due to significant changes in structure or interpretation. Version distinction "),e("code",[t._v("SHOULD")]),t._v(" be left to the version property. As a corollary, the name also "),e("code",[t._v("SHOULD NOT")]),t._v(" include an indication of time range covered.")]),t._v(" "),e("h5",{attrs:{id:"id"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#id"}},[t._v("#")]),t._v(" "),e("code",[t._v("id")])]),t._v(" "),e("p",[t._v("A property reserved for globally unique identifiers. Examples of identifiers that are unique include UUIDs and DOIs.")]),t._v(" "),e("p",[t._v("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 "),e("code",[t._v("id")]),t._v(" property "),e("code",[t._v("MUST")]),t._v(" ensure identifiers are globally unique.")]),t._v(" "),e("p",[t._v("Examples:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b03ec84-77fd-4270-813b-0c698943f7ce"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://doi.org/10.1594/PANGAEA.726855"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h5",{attrs:{id:"licenses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#licenses"}},[t._v("#")]),t._v(" "),e("code",[t._v("licenses")])]),t._v(" "),e("p",[t._v("The license(s) under which the package is provided.")]),t._v(" "),e("p",[e("strong",[t._v("This property is not legally binding and does not guarantee the package is licensed under the terms defined in this property.")])]),t._v(" "),e("p",[e("code",[t._v("licenses")]),t._v(" "),e("code",[t._v("MUST")]),t._v(" be an array. Each item in the array is a License. Each "),e("code",[t._v("MUST")]),t._v(" be an "),e("code",[t._v("object")]),t._v(". The object "),e("code",[t._v("MUST")]),t._v(" contain a "),e("code",[t._v("name")]),t._v(" property and/or a "),e("code",[t._v("path")]),t._v(" property. It "),e("code",[t._v("MAY")]),t._v(" contain a "),e("code",[t._v("title")]),t._v(" property.")]),t._v(" "),e("p",[t._v("Here is an example:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ODC-PDDL-1.0"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://opendatacommons.org/licenses/pddl/"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Open Data Commons Public Domain Dedication and License v1.0"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v("name")]),t._v(": The "),e("code",[t._v("name")]),t._v(" "),e("code",[t._v("MUST")]),t._v(" be an "),e("a",{attrs:{href:"http://licenses.opendefinition.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Open Definition license ID"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("code",[t._v("path")]),t._v(": A "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(" string, that is a fully qualified HTTP address, or a relative POSIX path (see "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("the url-or-path definition in Data Resource for details")]),t._v(").")],1),t._v(" "),e("li",[e("code",[t._v("title")]),t._v(": A human-readable title.")])]),t._v(" "),e("h5",{attrs:{id:"profile"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#profile"}},[t._v("#")]),t._v(" "),e("code",[t._v("profile")])]),t._v(" "),e("p",[t._v("A string identifying the "),e("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profile")]),t._v(" of this descriptor as per the "),e("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profiles")]),t._v(" specification.")],1),t._v(" "),e("p",[t._v("Examples:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-package"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/my-profiles-json-schema.json"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h4",{attrs:{id:"optional-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optional-properties"}},[t._v("#")]),t._v(" Optional Properties")]),t._v(" "),e("p",[t._v("The following are commonly used properties that the package descriptor "),e("code",[t._v("MAY")]),t._v(" contain:")]),t._v(" "),e("h5",{attrs:{id:"title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#title"}},[t._v("#")]),t._v(" "),e("code",[t._v("title")])]),t._v(" "),e("p",[t._v("A "),e("code",[t._v("string")]),t._v(" providing a title or one sentence description for this package")]),t._v(" "),e("h5",{attrs:{id:"description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#description"}},[t._v("#")]),t._v(" "),e("code",[t._v("description")])]),t._v(" "),e("p",[t._v("A description of the package. The description "),e("code",[t._v("MUST")]),t._v(" be "),e("a",{attrs:{href:"http://commonmark.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("markdown"),e("OutboundLink")],1),t._v(" formatted – this also allows for simple plain text as plain text is itself valid markdown. The first paragraph (up to the first double line break) should be usable as summary information for the package.")]),t._v(" "),e("h5",{attrs:{id:"homepage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#homepage"}},[t._v("#")]),t._v(" "),e("code",[t._v("homepage")])]),t._v(" "),e("p",[t._v("A URL for the home on the web that is related to this data package.")]),t._v(" "),e("h5",{attrs:{id:"version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version"}},[t._v("#")]),t._v(" "),e("code",[t._v("version")])]),t._v(" "),e("p",[t._v("A version string identifying the version of the package. It should conform to the "),e("a",{attrs:{href:"http://semver.org",target:"_blank",rel:"noopener noreferrer"}},[t._v("Semantic Versioning"),e("OutboundLink")],1),t._v(" requirements and should follow the "),e("RouterLink",{attrs:{to:"/patterns/#data-package-version"}},[t._v("Data Package Version")]),t._v(" pattern.")],1),t._v(" "),e("h5",{attrs:{id:"sources"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sources"}},[t._v("#")]),t._v(" "),e("code",[t._v("sources")])]),t._v(" "),e("p",[t._v("The raw sources for this data package. It "),e("code",[t._v("MUST")]),t._v(" be an array of Source objects. Each Source object "),e("code",[t._v("MUST")]),t._v(" have a "),e("code",[t._v("title")]),t._v(" and "),e("code",[t._v("MAY")]),t._v(" have "),e("code",[t._v("path")]),t._v(" and/or "),e("code",[t._v("email")]),t._v(" properties. Example:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"World Bank and OECD"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://data.worldbank.org/indicator/NY.GDP.MKTP.CD"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v("title")]),t._v(": title of the source (e.g. document or organization name)")]),t._v(" "),e("li",[e("code",[t._v("path")]),t._v(": A "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(" string, that is a fully qualified HTTP address, or a relative POSIX path (see "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("the url-or-path definition in Data Resource for details")]),t._v(").")],1),t._v(" "),e("li",[e("code",[t._v("email")]),t._v(": An email address")])]),t._v(" "),e("h5",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" "),e("code",[t._v("contributors")])]),t._v(" "),e("p",[t._v("The people or organizations who contributed to this Data Package. It "),e("code",[t._v("MUST")]),t._v(" be an array. Each entry is a Contributor and "),e("code",[t._v("MUST")]),t._v(" be an "),e("code",[t._v("object")]),t._v(". A Contributor "),e("code",[t._v("MUST")]),t._v(" have a "),e("code",[t._v("title")]),t._v(" property and MAY contain "),e("code",[t._v("path")]),t._v(", "),e("code",[t._v("email")]),t._v(", "),e("code",[t._v("role")]),t._v(" and "),e("code",[t._v("organization")]),t._v(" properties. An example of the object structure is as follows:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contributors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Joe Bloggs"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"email"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"joe@bloggs.com"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://www.bloggs.com"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"role"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"author"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v("title")]),t._v(": name/title of the contributor (name for person, name/title of organization)")]),t._v(" "),e("li",[e("code",[t._v("path")]),t._v(": a fully qualified http URL pointing to a relevant location online for the contributor")]),t._v(" "),e("li",[e("code",[t._v("email")]),t._v(": An email address")]),t._v(" "),e("li",[e("code",[t._v("role")]),t._v(": a string describing the role of the contributor. It’s "),e("code",[t._v("RECOMMENDED")]),t._v(" to be one of: "),e("code",[t._v("author")]),t._v(", "),e("code",[t._v("publisher")]),t._v(", "),e("code",[t._v("maintainer")]),t._v(", "),e("code",[t._v("wrangler")]),t._v(", and "),e("code",[t._v("contributor")]),t._v(". Defaults to "),e("code",[t._v("contributor")]),t._v(".\n"),e("ul",[e("li",[t._v("Note on semantics: use of the “author” property does not imply that that person was the original creator of the data in the data package - merely that they created and/or maintain the data package. It is common for data packages to “package” up data from elsewhere. The original origin of the data can be indicated with the "),e("code",[t._v("sources")]),t._v(" property - see above.")])])]),t._v(" "),e("li",[e("code",[t._v("organization")]),t._v(": a string describing the organization this contributor is affiliated to.")])]),t._v(" "),e("h5",{attrs:{id:"keywords"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#keywords"}},[t._v("#")]),t._v(" "),e("code",[t._v("keywords")])]),t._v(" "),e("p",[t._v("An Array of string keywords to assist users searching for the package in catalogs.")]),t._v(" "),e("h5",{attrs:{id:"image"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#image"}},[t._v("#")]),t._v(" "),e("code",[t._v("image")])]),t._v(" "),e("p",[t._v("An image to use for this data package. For example, when showing the package in a listing.")]),t._v(" "),e("p",[t._v("The value of the image property "),e("code",[t._v("MUST")]),t._v(" be a string pointing to the location of the image. The string must be a "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(", that is a fully qualified HTTP address, or a relative POSIX path (see "),e("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("the url-or-path definition in Data Resource for details")]),t._v(").")],1),t._v(" "),e("h5",{attrs:{id:"created"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#created"}},[t._v("#")]),t._v(" "),e("code",[t._v("created")])]),t._v(" "),e("p",[t._v("The datetime on which this was created.")]),t._v(" "),e("p",[t._v("Note: semantics may vary between publishers – for some this is the datetime the data was created, for others the datetime the package was created.")]),t._v(" "),e("p",[t._v("The datetime must conform to the string formats for datetime as described in "),e("a",{attrs:{href:"https://tools.ietf.org/html/rfc3339#section-5.6",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC3339"),e("OutboundLink")],1),t._v(". Example:")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"created"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1985-04-12T23:20:50.52Z"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])],1)}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/18.503086c6.js b/assets/js/18.661517b2.js similarity index 99% rename from assets/js/18.503086c6.js rename to assets/js/18.661517b2.js index a09fba39..4be5d059 100644 --- a/assets/js/18.503086c6.js +++ b/assets/js/18.661517b2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{387:function(t,e,a){"use strict";a.r(e);var s=a(26),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("The "),a("strong",[t._v("Data Resource")]),t._v(" format describes a data resource such as an individual file or table."),a("br"),t._v("\nThe essence of a Data Resource is a locator for the data it describes."),a("br"),t._v("\nA range of other properties can be declared to provide a richer set of metadata.")]),t._v(" "),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("A minimal Data Resource looks as follows:")]),t._v(" "),a("p",[t._v("With data accessible via the local filesystem.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-path.csv"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("With data accessible via http.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/resource-path.csv"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A minimal Data Resource pointing to some inline data looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name-data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A comprehensive Data Resource example with all required, recommended and optional properties looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"solar-system"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/solar-system.csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Solar System"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My favourite data about the solar system."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mediatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"encoding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"utf-8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bytes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"descriptor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor"}},[t._v("#")]),t._v(" Descriptor")]),t._v(" "),a("p",[t._v("A Data Resource descriptor MUST be a valid JSON "),a("code",[t._v("object")]),t._v(". (JSON is defined in "),a("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4627.txt",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC 4627"),a("OutboundLink")],1),t._v(").")]),t._v(" "),a("p",[t._v("Key properties of the descriptor are described below. A descriptor MAY include any number of properties in additional to those described below as required and optional properties.")]),t._v(" "),a("h3",{attrs:{id:"data-location"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-location"}},[t._v("#")]),t._v(" Data Location")]),t._v(" "),a("p",[t._v("A resource MUST contain a property describing the location of the"),a("br"),t._v("\ndata associated to the resource. The location of resource data MUST be"),a("br"),t._v("\nspecified by the presence of one (and only one) of these two properties:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("path")]),t._v(": for data in files located online or locally on disk.")]),t._v(" "),a("li",[a("code",[t._v("data")]),t._v(": for data inline in the descriptor itself.")])]),t._v(" "),a("h4",{attrs:{id:"path-data-in-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#path-data-in-files"}},[t._v("#")]),t._v(" "),a("code",[t._v("path")]),t._v(" Data in Files")]),t._v(" "),a("p",[a("code",[t._v("path")]),t._v(" MUST be a string – or an array of strings (see “Data in Multiple"),a("br"),t._v("\nFiles”). Each string MUST be a “url-or-path” as defined in the next section.")]),t._v(" "),a("h5",{attrs:{id:"url-or-path"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#url-or-path"}},[t._v("#")]),t._v(" URL or Path")]),t._v(" "),a("p",[t._v("A “url-or-path” is a "),a("code",[t._v("string")]),t._v(" with the following additional constraints:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("MUST")]),t._v(" either be a URL or a POSIX path")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Uniform_Resource_Locator",target:"_blank",rel:"noopener noreferrer"}},[t._v("URLs"),a("OutboundLink")],1),t._v(" MUST be fully qualified. MUST be using either http or https scheme. (Absence of a scheme indicates "),a("code",[t._v("MUST")]),t._v(" be a POSIX path)")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Path_%28computing%29#POSIX_pathname_definition",target:"_blank",rel:"noopener noreferrer"}},[t._v("POSIX paths"),a("OutboundLink")],1),t._v(" (unix-style with "),a("code",[t._v("/")]),t._v(" as separator) are supported for referencing local files, with the security restraint that they "),a("code",[t._v("MUST")]),t._v(" be relative siblings or children of the descriptor. Absolute paths (/) and relative parent paths (…/) MUST NOT be used, and implementations SHOULD NOT support these path types.")])]),t._v(" "),a("p",[t._v("Examples:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('# fully qualified url\n"path": "http://ex.datapackages.org/big-csv/my-big.csv"\n\n# relative path\n# note: this will work both as a relative path on disk and on online\n"path": "my-data-directory/my-csv.csv"\n')])])]),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[a("code",[t._v("/")]),t._v(" (absolute path) and "),a("code",[t._v("../")]),t._v(" (relative parent path) are forbidden to avoid security vulnerabilities when implementing data package software. These limitations on resource "),a("code",[t._v("path")]),t._v(" ensure that resource paths only point to files within the data package directory and its subdirectories. This prevents data package software being exploited by a malicious user to gain unintended access to sensitive information.")]),t._v(" "),a("p",[t._v("For example, suppose a data package hosting service stores packages on disk and allows access via an API. A malicious user uploads a data package with a resource path like "),a("code",[t._v("/etc/passwd")]),t._v(". The user then requests the data for that resource and the server naively opens "),a("code",[t._v("/etc/passwd")]),t._v(" and returns that data to the caller.")]),t._v(" "),a("p",[t._v("Prior to release 1.0.0-beta.18 (Nov 17 2016) there was a "),a("code",[t._v("url")]),t._v(" property distinct from "),a("code",[t._v("path")]),t._v(". In order to support backwards compatibility, implementors MAY want to automatically convert a "),a("code",[t._v("url")]),t._v(" property to a "),a("code",[t._v("path")]),t._v(" property and issue a warning.")])]),t._v(" "),a("h4",{attrs:{id:"data-in-multiple-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-in-multiple-files"}},[t._v("#")]),t._v(" Data in Multiple Files")]),t._v(" "),a("p",[t._v("Usually, a resource will have only a single file associated to it. However, sometimes it may be convenient to have a single resource whose data is split across multiple files – perhaps the data is large and having it in one file would be inconvenient.")]),t._v(" "),a("p",[t._v("To support this use case the "),a("code",[t._v("path")]),t._v(" property MAY be an array of strings rather"),a("br"),t._v("\nthan a single string:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('"path": [ "myfile1.csv", "myfile2.csv" ]\n')])])]),a("p",[t._v("It is NOT permitted to mix fully qualified URLs and relative paths in a "),a("code",[t._v("path")]),t._v(" array: strings MUST either all be relative paths or all URLs.")]),t._v(" "),a("p",[a("strong",[t._v("NOTE:")]),t._v(" All files in the array MUST be similar in terms of structure, format etc. Implementors MUST be able to concatenate together the files in the simplest way and treat the result as one large file. For tabular data there is the issue of header rows. See the "),a("RouterLink",{attrs:{to:"/tabular-data-package/"}},[t._v("Tabular Data Package spec")]),t._v(" for more on this.")],1),t._v(" "),a("h4",{attrs:{id:"data-inline-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-inline-data"}},[t._v("#")]),t._v(" "),a("code",[t._v("data")]),t._v(" Inline Data")]),t._v(" "),a("p",[t._v("Resource data rather than being stored in external files can be shipped "),a("code",[t._v("inline")]),t._v(" on a Resource using the "),a("code",[t._v("data")]),t._v(" property.")]),t._v(" "),a("p",[t._v("The value of the data property can be any type of data. However, restrictions of JSON require that the value be a string so for binary data you will need to encode (e.g. to Base64). Information on the type and encoding of the value of the data property SHOULD be provided by the format (or mediatype) property and the encoding property.")]),t._v(" "),a("p",[t._v("Specifically: the value of the data property MUST be:")]),t._v(" "),a("ul",[a("li",[t._v("EITHER: a "),a("strong",[t._v("JSON")]),t._v(" array or "),a("strong",[t._v("Object")]),t._v("- the data is then assumed to be JSON data and SHOULD be processed as such")]),t._v(" "),a("li",[t._v("OR: a "),a("strong",[t._v("JSON")]),t._v(" string - in this case the format or mediatype properties MUST be provided.")])]),t._v(" "),a("p",[t._v("Thus, a consumer of resource object MAY assume if no format or mediatype property is provided that the data is JSON and attempt to process it as such.")]),t._v(" "),a("p",[a("strong",[t._v("Examples 1 - inline JSON:")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v('{\n ...\n "resources": [\n {\n "format": "json",\n # some json data e.g.\n "data": [\n { "a": 1, "b": 2 },\n { .... }\n ]\n }\n ]\n}\n')])])]),a("p",[a("strong",[t._v("Example 2 - inline CSV:")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v('{\n ...\n "resources": [\n {\n "format": "csv",\n "data": "A,B,C\\n1,2,3\\n4,5,6"\n }\n ]\n}\n')])])]),a("h3",{attrs:{id:"metadata-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#metadata-properties"}},[t._v("#")]),t._v(" Metadata Properties")]),t._v(" "),a("h4",{attrs:{id:"required-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#required-properties"}},[t._v("#")]),t._v(" Required Properties")]),t._v(" "),a("p",[t._v("A descriptor MUST contain the following properties:")]),t._v(" "),a("h4",{attrs:{id:"name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#name"}},[t._v("#")]),t._v(" "),a("code",[t._v("name")])]),t._v(" "),a("p",[t._v("A resource MUST contain a "),a("code",[t._v("name")]),t._v(" property. The name is a simple name or"),a("br"),t._v("\nidentifier to be used for this resource.")]),t._v(" "),a("ul",[a("li",[t._v("If present, the name MUST be unique amongst all resources in this data"),a("br"),t._v("\npackage.")]),t._v(" "),a("li",[t._v("It MUST consist only of lowercase alphanumeric characters plus “.”, “-” and “_”.")]),t._v(" "),a("li",[t._v("It would be usual for the name to correspond to the file name (minus the"),a("br"),t._v("\nextension) of the data file the resource describes.")])]),t._v(" "),a("h4",{attrs:{id:"recommended-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recommended-properties"}},[t._v("#")]),t._v(" Recommended Properties")]),t._v(" "),a("h4",{attrs:{id:"profile"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#profile"}},[t._v("#")]),t._v(" "),a("code",[t._v("profile")])]),t._v(" "),a("p",[t._v("A string identifying the "),a("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profile")]),t._v(" of this descriptor as per the "),a("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profiles")]),t._v(" specification.")],1),t._v(" "),a("p",[t._v("Examples:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "profile": "http://example.com/my-profiles-json-schema.json"\n}\n')])])]),a("h4",{attrs:{id:"optional-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#optional-properties"}},[t._v("#")]),t._v(" Optional Properties")]),t._v(" "),a("p",[t._v("A descriptor MAY contain any number of additional properties. Common properties include:")]),t._v(" "),a("ul",[a("li",[a("p",[a("code",[t._v("title")]),t._v(": a title or label for the resource.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("description")]),t._v(": a description of the resource.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("format")]),t._v(": ‘csv’, ‘xls’, ‘json’ etc. Would be expected to be the standard file"),a("br"),t._v("\nextension for this type of resource.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("mediatype")]),t._v(": the mediatype/mimetype of the resource e.g. “text/csv”, or “application/vnd.ms-excel”. Mediatypes are maintained by the Internet Assigned Numbers Authority (IANA) in a "),a("a",{attrs:{href:"https://www.iana.org/assignments/media-types/media-types.xhtml",target:"_blank",rel:"noopener noreferrer"}},[t._v("media type registry"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("encoding")]),t._v(": specify the character encoding of the resource’s data file. The values should be one of"),a("br"),t._v("\nthe “Preferred MIME Names” for "),a("a",{attrs:{href:"http://www.iana.org/assignments/character-sets/character-sets.xhtml",target:"_blank",rel:"noopener noreferrer"}},[t._v("a character encoding registered with IANA"),a("OutboundLink")],1),t._v(". If no"),a("br"),t._v("\nvalue for this key is specified then the default is UTF-8.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("bytes")]),t._v(": size of the file in bytes.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("hash")]),t._v(": the MD5 hash for this resource. Other algorithms can be indicated by prefixing"),a("br"),t._v("\nthe hash’s value with the algorithm name in lower-case. For example:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v('"hash": "sha1:8843d7f92416211de9ebb963ff4ce28125932878"\n')])])])]),t._v(" "),a("li",[a("p",[a("code",[t._v("sources")]),t._v(": as for "),a("RouterLink",{attrs:{to:"/data-package/"}},[t._v("Data Package metadata")]),t._v(".")],1)]),t._v(" "),a("li",[a("p",[a("code",[t._v("licenses")]),t._v(": as for "),a("RouterLink",{attrs:{to:"/data-package/"}},[t._v("Data Package metadata")]),t._v(". If not specified the resource"),a("br"),t._v("\ninherits from the data package.")],1)])]),t._v(" "),a("h3",{attrs:{id:"resource-schemas"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#resource-schemas"}},[t._v("#")]),t._v(" Resource Schemas")]),t._v(" "),a("p",[t._v("A Data Resource MAY have a "),a("code",[t._v("schema")]),t._v(" property to describe the schema of the resource data.")]),t._v(" "),a("p",[t._v("The value for the "),a("code",[t._v("schema")]),t._v(" property on a "),a("code",[t._v("resource")]),t._v(" MUST be an "),a("code",[t._v("object")]),t._v(" representing the schema OR a "),a("code",[t._v("string")]),t._v(" that identifies the location of the schema.")]),t._v(" "),a("p",[t._v("If a "),a("code",[t._v("string")]),t._v(" it must be a "),a("a",{attrs:{href:"#url-or-path"}},[t._v("url-or-path as defined above")]),t._v(", that is a fully qualified http URL or a relative POSIX path. The file at the location specified by this url-or-path string "),a("code",[t._v("MUST")]),t._v(" be a JSON document containing the schema.")]),t._v(" "),a("p",[t._v("NOTE: the Data Package specification places no restrictions on the form of the schema Object. This flexibility enables specific communities to define schemas appropriate for the data they manage. As an example, the "),a("RouterLink",{attrs:{to:"/tabular-data-package/"}},[t._v("Tabular Data Package")]),t._v(" specification requires the schema to conform to "),a("RouterLink",{attrs:{to:"/table-schema/"}},[t._v("Table Schema")]),t._v(".")],1)],1)}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{388:function(t,e,a){"use strict";a.r(e);var s=a(26),r=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("The "),a("strong",[t._v("Data Resource")]),t._v(" format describes a data resource such as an individual file or table."),a("br"),t._v("\nThe essence of a Data Resource is a locator for the data it describes."),a("br"),t._v("\nA range of other properties can be declared to provide a richer set of metadata.")]),t._v(" "),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("A minimal Data Resource looks as follows:")]),t._v(" "),a("p",[t._v("With data accessible via the local filesystem.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-path.csv"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("With data accessible via http.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/resource-path.csv"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A minimal Data Resource pointing to some inline data looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name-data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A comprehensive Data Resource example with all required, recommended and optional properties looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"solar-system"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/solar-system.csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Solar System"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My favourite data about the solar system."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mediatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"encoding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"utf-8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bytes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"descriptor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor"}},[t._v("#")]),t._v(" Descriptor")]),t._v(" "),a("p",[t._v("A Data Resource descriptor MUST be a valid JSON "),a("code",[t._v("object")]),t._v(". (JSON is defined in "),a("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4627.txt",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC 4627"),a("OutboundLink")],1),t._v(").")]),t._v(" "),a("p",[t._v("Key properties of the descriptor are described below. A descriptor MAY include any number of properties in additional to those described below as required and optional properties.")]),t._v(" "),a("h3",{attrs:{id:"data-location"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-location"}},[t._v("#")]),t._v(" Data Location")]),t._v(" "),a("p",[t._v("A resource MUST contain a property describing the location of the"),a("br"),t._v("\ndata associated to the resource. The location of resource data MUST be"),a("br"),t._v("\nspecified by the presence of one (and only one) of these two properties:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("path")]),t._v(": for data in files located online or locally on disk.")]),t._v(" "),a("li",[a("code",[t._v("data")]),t._v(": for data inline in the descriptor itself.")])]),t._v(" "),a("h4",{attrs:{id:"path-data-in-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#path-data-in-files"}},[t._v("#")]),t._v(" "),a("code",[t._v("path")]),t._v(" Data in Files")]),t._v(" "),a("p",[a("code",[t._v("path")]),t._v(" MUST be a string – or an array of strings (see “Data in Multiple"),a("br"),t._v("\nFiles”). Each string MUST be a “url-or-path” as defined in the next section.")]),t._v(" "),a("h5",{attrs:{id:"url-or-path"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#url-or-path"}},[t._v("#")]),t._v(" URL or Path")]),t._v(" "),a("p",[t._v("A “url-or-path” is a "),a("code",[t._v("string")]),t._v(" with the following additional constraints:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("MUST")]),t._v(" either be a URL or a POSIX path")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Uniform_Resource_Locator",target:"_blank",rel:"noopener noreferrer"}},[t._v("URLs"),a("OutboundLink")],1),t._v(" MUST be fully qualified. MUST be using either http or https scheme. (Absence of a scheme indicates "),a("code",[t._v("MUST")]),t._v(" be a POSIX path)")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Path_%28computing%29#POSIX_pathname_definition",target:"_blank",rel:"noopener noreferrer"}},[t._v("POSIX paths"),a("OutboundLink")],1),t._v(" (unix-style with "),a("code",[t._v("/")]),t._v(" as separator) are supported for referencing local files, with the security restraint that they "),a("code",[t._v("MUST")]),t._v(" be relative siblings or children of the descriptor. Absolute paths (/) and relative parent paths (…/) MUST NOT be used, and implementations SHOULD NOT support these path types.")])]),t._v(" "),a("p",[t._v("Examples:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('# fully qualified url\n"path": "http://ex.datapackages.org/big-csv/my-big.csv"\n\n# relative path\n# note: this will work both as a relative path on disk and on online\n"path": "my-data-directory/my-csv.csv"\n')])])]),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[a("code",[t._v("/")]),t._v(" (absolute path) and "),a("code",[t._v("../")]),t._v(" (relative parent path) are forbidden to avoid security vulnerabilities when implementing data package software. These limitations on resource "),a("code",[t._v("path")]),t._v(" ensure that resource paths only point to files within the data package directory and its subdirectories. This prevents data package software being exploited by a malicious user to gain unintended access to sensitive information.")]),t._v(" "),a("p",[t._v("For example, suppose a data package hosting service stores packages on disk and allows access via an API. A malicious user uploads a data package with a resource path like "),a("code",[t._v("/etc/passwd")]),t._v(". The user then requests the data for that resource and the server naively opens "),a("code",[t._v("/etc/passwd")]),t._v(" and returns that data to the caller.")]),t._v(" "),a("p",[t._v("Prior to release 1.0.0-beta.18 (Nov 17 2016) there was a "),a("code",[t._v("url")]),t._v(" property distinct from "),a("code",[t._v("path")]),t._v(". In order to support backwards compatibility, implementors MAY want to automatically convert a "),a("code",[t._v("url")]),t._v(" property to a "),a("code",[t._v("path")]),t._v(" property and issue a warning.")])]),t._v(" "),a("h4",{attrs:{id:"data-in-multiple-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-in-multiple-files"}},[t._v("#")]),t._v(" Data in Multiple Files")]),t._v(" "),a("p",[t._v("Usually, a resource will have only a single file associated to it. However, sometimes it may be convenient to have a single resource whose data is split across multiple files – perhaps the data is large and having it in one file would be inconvenient.")]),t._v(" "),a("p",[t._v("To support this use case the "),a("code",[t._v("path")]),t._v(" property MAY be an array of strings rather"),a("br"),t._v("\nthan a single string:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('"path": [ "myfile1.csv", "myfile2.csv" ]\n')])])]),a("p",[t._v("It is NOT permitted to mix fully qualified URLs and relative paths in a "),a("code",[t._v("path")]),t._v(" array: strings MUST either all be relative paths or all URLs.")]),t._v(" "),a("p",[a("strong",[t._v("NOTE:")]),t._v(" All files in the array MUST be similar in terms of structure, format etc. Implementors MUST be able to concatenate together the files in the simplest way and treat the result as one large file. For tabular data there is the issue of header rows. See the "),a("RouterLink",{attrs:{to:"/tabular-data-package/"}},[t._v("Tabular Data Package spec")]),t._v(" for more on this.")],1),t._v(" "),a("h4",{attrs:{id:"data-inline-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-inline-data"}},[t._v("#")]),t._v(" "),a("code",[t._v("data")]),t._v(" Inline Data")]),t._v(" "),a("p",[t._v("Resource data rather than being stored in external files can be shipped "),a("code",[t._v("inline")]),t._v(" on a Resource using the "),a("code",[t._v("data")]),t._v(" property.")]),t._v(" "),a("p",[t._v("The value of the data property can be any type of data. However, restrictions of JSON require that the value be a string so for binary data you will need to encode (e.g. to Base64). Information on the type and encoding of the value of the data property SHOULD be provided by the format (or mediatype) property and the encoding property.")]),t._v(" "),a("p",[t._v("Specifically: the value of the data property MUST be:")]),t._v(" "),a("ul",[a("li",[t._v("EITHER: a "),a("strong",[t._v("JSON")]),t._v(" array or "),a("strong",[t._v("Object")]),t._v("- the data is then assumed to be JSON data and SHOULD be processed as such")]),t._v(" "),a("li",[t._v("OR: a "),a("strong",[t._v("JSON")]),t._v(" string - in this case the format or mediatype properties MUST be provided.")])]),t._v(" "),a("p",[t._v("Thus, a consumer of resource object MAY assume if no format or mediatype property is provided that the data is JSON and attempt to process it as such.")]),t._v(" "),a("p",[a("strong",[t._v("Examples 1 - inline JSON:")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v('{\n ...\n "resources": [\n {\n "format": "json",\n # some json data e.g.\n "data": [\n { "a": 1, "b": 2 },\n { .... }\n ]\n }\n ]\n}\n')])])]),a("p",[a("strong",[t._v("Example 2 - inline CSV:")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v('{\n ...\n "resources": [\n {\n "format": "csv",\n "data": "A,B,C\\n1,2,3\\n4,5,6"\n }\n ]\n}\n')])])]),a("h3",{attrs:{id:"metadata-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#metadata-properties"}},[t._v("#")]),t._v(" Metadata Properties")]),t._v(" "),a("h4",{attrs:{id:"required-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#required-properties"}},[t._v("#")]),t._v(" Required Properties")]),t._v(" "),a("p",[t._v("A descriptor MUST contain the following properties:")]),t._v(" "),a("h4",{attrs:{id:"name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#name"}},[t._v("#")]),t._v(" "),a("code",[t._v("name")])]),t._v(" "),a("p",[t._v("A resource MUST contain a "),a("code",[t._v("name")]),t._v(" property. The name is a simple name or"),a("br"),t._v("\nidentifier to be used for this resource.")]),t._v(" "),a("ul",[a("li",[t._v("If present, the name MUST be unique amongst all resources in this data"),a("br"),t._v("\npackage.")]),t._v(" "),a("li",[t._v("It MUST consist only of lowercase alphanumeric characters plus “.”, “-” and “_”.")]),t._v(" "),a("li",[t._v("It would be usual for the name to correspond to the file name (minus the"),a("br"),t._v("\nextension) of the data file the resource describes.")])]),t._v(" "),a("h4",{attrs:{id:"recommended-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recommended-properties"}},[t._v("#")]),t._v(" Recommended Properties")]),t._v(" "),a("h4",{attrs:{id:"profile"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#profile"}},[t._v("#")]),t._v(" "),a("code",[t._v("profile")])]),t._v(" "),a("p",[t._v("A string identifying the "),a("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profile")]),t._v(" of this descriptor as per the "),a("RouterLink",{attrs:{to:"/profiles/"}},[t._v("profiles")]),t._v(" specification.")],1),t._v(" "),a("p",[t._v("Examples:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "profile": "http://example.com/my-profiles-json-schema.json"\n}\n')])])]),a("h4",{attrs:{id:"optional-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#optional-properties"}},[t._v("#")]),t._v(" Optional Properties")]),t._v(" "),a("p",[t._v("A descriptor MAY contain any number of additional properties. Common properties include:")]),t._v(" "),a("ul",[a("li",[a("p",[a("code",[t._v("title")]),t._v(": a title or label for the resource.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("description")]),t._v(": a description of the resource.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("format")]),t._v(": ‘csv’, ‘xls’, ‘json’ etc. Would be expected to be the standard file"),a("br"),t._v("\nextension for this type of resource.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("mediatype")]),t._v(": the mediatype/mimetype of the resource e.g. “text/csv”, or “application/vnd.ms-excel”. Mediatypes are maintained by the Internet Assigned Numbers Authority (IANA) in a "),a("a",{attrs:{href:"https://www.iana.org/assignments/media-types/media-types.xhtml",target:"_blank",rel:"noopener noreferrer"}},[t._v("media type registry"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("encoding")]),t._v(": specify the character encoding of the resource’s data file. The values should be one of"),a("br"),t._v("\nthe “Preferred MIME Names” for "),a("a",{attrs:{href:"http://www.iana.org/assignments/character-sets/character-sets.xhtml",target:"_blank",rel:"noopener noreferrer"}},[t._v("a character encoding registered with IANA"),a("OutboundLink")],1),t._v(". If no"),a("br"),t._v("\nvalue for this key is specified then the default is UTF-8.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("bytes")]),t._v(": size of the file in bytes.")])]),t._v(" "),a("li",[a("p",[a("code",[t._v("hash")]),t._v(": the MD5 hash for this resource. Other algorithms can be indicated by prefixing"),a("br"),t._v("\nthe hash’s value with the algorithm name in lower-case. For example:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[t._v('"hash": "sha1:8843d7f92416211de9ebb963ff4ce28125932878"\n')])])])]),t._v(" "),a("li",[a("p",[a("code",[t._v("sources")]),t._v(": as for "),a("RouterLink",{attrs:{to:"/data-package/"}},[t._v("Data Package metadata")]),t._v(".")],1)]),t._v(" "),a("li",[a("p",[a("code",[t._v("licenses")]),t._v(": as for "),a("RouterLink",{attrs:{to:"/data-package/"}},[t._v("Data Package metadata")]),t._v(". If not specified the resource"),a("br"),t._v("\ninherits from the data package.")],1)])]),t._v(" "),a("h3",{attrs:{id:"resource-schemas"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#resource-schemas"}},[t._v("#")]),t._v(" Resource Schemas")]),t._v(" "),a("p",[t._v("A Data Resource MAY have a "),a("code",[t._v("schema")]),t._v(" property to describe the schema of the resource data.")]),t._v(" "),a("p",[t._v("The value for the "),a("code",[t._v("schema")]),t._v(" property on a "),a("code",[t._v("resource")]),t._v(" MUST be an "),a("code",[t._v("object")]),t._v(" representing the schema OR a "),a("code",[t._v("string")]),t._v(" that identifies the location of the schema.")]),t._v(" "),a("p",[t._v("If a "),a("code",[t._v("string")]),t._v(" it must be a "),a("a",{attrs:{href:"#url-or-path"}},[t._v("url-or-path as defined above")]),t._v(", that is a fully qualified http URL or a relative POSIX path. The file at the location specified by this url-or-path string "),a("code",[t._v("MUST")]),t._v(" be a JSON document containing the schema.")]),t._v(" "),a("p",[t._v("NOTE: the Data Package specification places no restrictions on the form of the schema Object. This flexibility enables specific communities to define schemas appropriate for the data they manage. As an example, the "),a("RouterLink",{attrs:{to:"/tabular-data-package/"}},[t._v("Tabular Data Package")]),t._v(" specification requires the schema to conform to "),a("RouterLink",{attrs:{to:"/table-schema/"}},[t._v("Table Schema")]),t._v(".")],1)],1)}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/2.7ce9191a.js b/assets/js/2.d6dd5bfd.js similarity index 100% rename from assets/js/2.7ce9191a.js rename to assets/js/2.d6dd5bfd.js diff --git a/assets/js/20.6842625d.js b/assets/js/20.cdf5cb64.js similarity index 99% rename from assets/js/20.6842625d.js rename to assets/js/20.cdf5cb64.js index 9eb2eb5d..38ae94f6 100644 --- a/assets/js/20.6842625d.js +++ b/assets/js/20.cdf5cb64.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{390:function(e,t,r){"use strict";r.r(t);var a=r(26),i=Object(a.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("div",{staticClass:"custom-block warning"},[r("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),r("p",[e._v("This is a draft specification and still under development. If you have comments or suggestions please file them in the "),r("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue tracker"),r("OutboundLink")],1),e._v(". If you have explicit changes please fork the "),r("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("git repo"),r("OutboundLink")],1),e._v(" and submit a pull request.")])]),e._v(" "),r("h1",{attrs:{id:"page-frontmatter-title"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),r("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),r("MetadataTable"),e._v(" "),r("h2",{attrs:{id:"language"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),r("Language"),e._v(" "),r("h2",{attrs:{id:"changelog"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#changelog"}},[e._v("#")]),e._v(" Changelog")]),e._v(" "),r("ul",[r("li",[r("code",[e._v("1.0.0rc1")]),e._v(": Initial text")])]),e._v(" "),r("h2",{attrs:{id:"introduction"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),r("p",[e._v("This document contains a "),r("em",[e._v("ColumnType")]),e._v(" taxonomy to be used for publishing spending data files. It should be used in conjunction with the budget taxonomy, as it contains some common "),r("em",[e._v("ColumnTypes")]),e._v(" as well.")]),e._v(" "),r("p",[e._v("The "),r("em",[e._v("ColumnTypes")]),e._v(" contained in this taxonomy contain:")]),e._v(" "),r("ul",[r("li",[e._v("Transactions Identifiers")]),e._v(" "),r("li",[e._v("Details about administrators, procurers, suppliers and recipients")]),e._v(" "),r("li",[e._v("Some Geographic related types (esp. for addresses)")])]),e._v(" "),r("h2",{attrs:{id:"references"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[e._v("#")]),e._v(" References")]),e._v(" "),r("ul",[r("li",[r("RouterLink",{attrs:{to:"/fiscal-data-package/"}},[e._v("The Fiscal Data Package Spec")])],1)]),e._v(" "),r("h2",{attrs:{id:"location"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#location"}},[e._v("#")]),e._v(" Location")]),e._v(" "),r("p",[e._v("The canonic location for this taxonomy’s "),r("em",[e._v("ColumnType")]),e._v(" definition - to be used in fiscal data package descriptors - is")]),e._v(" "),r("p",[r("code",[e._v("https://specs.frictionlessdata.io/taxonomies/fiscal/spending.json")])]),e._v(" "),r("h2",{attrs:{id:"the-taxonomy"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#the-taxonomy"}},[e._v("#")]),e._v(" The Taxonomy")]),e._v(" "),r("h4",{attrs:{id:"amounts-and-their-properties"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#amounts-and-their-properties"}},[e._v("#")]),e._v(" Amounts and their properties")]),e._v(" "),r("h4",{attrs:{id:"geographic-information"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geographic-information"}},[e._v("#")]),e._v(" Geographic Information")]),e._v(" "),r("h5",{attrs:{id:"geo-address-city-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-city-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:city:code")])]),e._v(" "),r("p",[e._v("The code of the city part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:county:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-city-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-city-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:city:label")])]),e._v(" "),r("p",[e._v("The name of the city part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:city:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-country-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-country-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:country:code")])]),e._v(" "),r("p",[e._v("The code of the country part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-country-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-country-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:country:label")])]),e._v(" "),r("p",[e._v("The name of the country part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:country:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-county-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-county-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:county:code")])]),e._v(" "),r("p",[e._v("The code of the county part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:region:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-county-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-county-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:county:label")])]),e._v(" "),r("p",[e._v("The name of the county part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:county:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-region-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-region-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:region:code")])]),e._v(" "),r("p",[e._v("The code of the region part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:country:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-region-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-region-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:region:label")])]),e._v(" "),r("p",[e._v("The name of the region part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:region:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-street-address-description"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-street-address-description"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:street-address:description")])]),e._v(" "),r("p",[e._v("Actual street address in whole address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-zip-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-zip-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:zip:code")])]),e._v(" "),r("p",[e._v("The postal code in the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:city:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h4",{attrs:{id:"actors-involved-in-the-transaction-administrator-procurer"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#actors-involved-in-the-transaction-administrator-procurer"}},[e._v("#")]),e._v(" Actors involved in the Transaction (Administrator, Procurer)")]),e._v(" "),r("h5",{attrs:{id:"administrator-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#administrator-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("administrator:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Administrator")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"administrator-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#administrator-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("administrator:generic:name")])]),e._v(" "),r("p",[e._v("The display name for the Administrator")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("administrator:generic:id")])])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-account"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-account"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:account")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank account of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-branch-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-branch-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:branch:code")])]),e._v(" "),r("p",[e._v("Unique identifier of the bank’s branch of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-branch-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-branch-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:branch:name")])]),e._v(" "),r("p",[e._v("Name of the bank’s branch of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("procurer:bank:branch:code")])])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:code")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"procurer-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"procurer-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:generic:name")])]),e._v(" "),r("p",[e._v("The display name of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("procurer:generic:id")])])]),e._v(" "),r("h4",{attrs:{id:"recipient-of-the-transaction"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-of-the-transaction"}},[e._v("#")]),e._v(" Recipient of the Transaction")]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-account"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-account"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:account")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank account of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-branch-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-branch-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:branch:code")])]),e._v(" "),r("p",[e._v("Unique identifier of the bank’s branch of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-branch-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-branch-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:branch:name")])]),e._v(" "),r("p",[e._v("Name of the bank’s branch of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:bank:branch:name")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:code")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-code-type"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-code-type"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:code-type")])]),e._v(" "),r("p",[e._v("Unique identifier for the codelist from which the legal entity code comes from")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("recipient:generic:id")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:code")])]),e._v(" "),r("p",[e._v("Unique identifier for the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:code-type")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:label")])]),e._v(" "),r("p",[e._v("Trading name (or other) of the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:code")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-point-of-contact-description"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-point-of-contact-description"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:point-of-contact:description")])]),e._v(" "),r("p",[e._v("Text describing the representative of the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:code")])]),e._v(" "),r("p",[e._v("Code of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-description"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-description"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:description")])]),e._v(" "),r("p",[e._v("Name of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:label")])]),e._v(" "),r("p",[e._v("Name of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:code")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-status"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-status"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:status")])]),e._v(" "),r("p",[e._v("Status of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:name")])]),e._v(" "),r("p",[e._v("The display name for the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:generic:id")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-url"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-url"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:url")])]),e._v(" "),r("p",[e._v("An Internet address for the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h4",{attrs:{id:"supplier-details"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supplier-details"}},[e._v("#")]),e._v(" Supplier Details")]),e._v(" "),r("h5",{attrs:{id:"supplier-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supplier-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("supplier:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Supplier")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"supplier-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supplier-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("supplier:generic:name")])]),e._v(" "),r("p",[e._v("The display name for the Supplier")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("supplier:generic:id")])])]),e._v(" "),r("h4",{attrs:{id:"transaction-details"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-details"}},[e._v("#")]),e._v(" Transaction Details")]),e._v(" "),r("h5",{attrs:{id:"transaction-id-budget-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-budget-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:budget-code")])]),e._v(" "),r("p",[e._v("Unique identifier for the Budget Line for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:code")])]),e._v(" "),r("p",[e._v("A Unique identifier for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-contract-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-contract-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:contract-id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Contract for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-court-order"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-court-order"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:court-order")])]),e._v(" "),r("p",[e._v("Unique identifier for the Court Order for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-invoice-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-invoice-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:invoice-id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Invoice for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-purchase-order"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-purchase-order"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:purchase-order")])]),e._v(" "),r("p",[e._v("Unique identifier for the Purchase Order for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-tender-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-tender-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:tender-id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Tender for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-tender-kind"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-tender-kind"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:tender-kind")])]),e._v(" "),r("p",[e._v("Unique identifier for the Tender Kind for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-transaction-kind"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-transaction-kind"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:transaction-kind")])]),e._v(" "),r("p",[e._v("Unique identifier for the Transaction Kind for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])])],1)}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{391:function(e,t,r){"use strict";r.r(t);var a=r(26),i=Object(a.a)({},(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("div",{staticClass:"custom-block warning"},[r("p",{staticClass:"custom-block-title"},[e._v("WARNING")]),e._v(" "),r("p",[e._v("This is a draft specification and still under development. If you have comments or suggestions please file them in the "),r("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue tracker"),r("OutboundLink")],1),e._v(". If you have explicit changes please fork the "),r("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("git repo"),r("OutboundLink")],1),e._v(" and submit a pull request.")])]),e._v(" "),r("h1",{attrs:{id:"page-frontmatter-title"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),r("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),r("MetadataTable"),e._v(" "),r("h2",{attrs:{id:"language"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),r("Language"),e._v(" "),r("h2",{attrs:{id:"changelog"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#changelog"}},[e._v("#")]),e._v(" Changelog")]),e._v(" "),r("ul",[r("li",[r("code",[e._v("1.0.0rc1")]),e._v(": Initial text")])]),e._v(" "),r("h2",{attrs:{id:"introduction"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),r("p",[e._v("This document contains a "),r("em",[e._v("ColumnType")]),e._v(" taxonomy to be used for publishing spending data files. It should be used in conjunction with the budget taxonomy, as it contains some common "),r("em",[e._v("ColumnTypes")]),e._v(" as well.")]),e._v(" "),r("p",[e._v("The "),r("em",[e._v("ColumnTypes")]),e._v(" contained in this taxonomy contain:")]),e._v(" "),r("ul",[r("li",[e._v("Transactions Identifiers")]),e._v(" "),r("li",[e._v("Details about administrators, procurers, suppliers and recipients")]),e._v(" "),r("li",[e._v("Some Geographic related types (esp. for addresses)")])]),e._v(" "),r("h2",{attrs:{id:"references"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[e._v("#")]),e._v(" References")]),e._v(" "),r("ul",[r("li",[r("RouterLink",{attrs:{to:"/fiscal-data-package/"}},[e._v("The Fiscal Data Package Spec")])],1)]),e._v(" "),r("h2",{attrs:{id:"location"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#location"}},[e._v("#")]),e._v(" Location")]),e._v(" "),r("p",[e._v("The canonic location for this taxonomy’s "),r("em",[e._v("ColumnType")]),e._v(" definition - to be used in fiscal data package descriptors - is")]),e._v(" "),r("p",[r("code",[e._v("https://specs.frictionlessdata.io/taxonomies/fiscal/spending.json")])]),e._v(" "),r("h2",{attrs:{id:"the-taxonomy"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#the-taxonomy"}},[e._v("#")]),e._v(" The Taxonomy")]),e._v(" "),r("h4",{attrs:{id:"amounts-and-their-properties"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#amounts-and-their-properties"}},[e._v("#")]),e._v(" Amounts and their properties")]),e._v(" "),r("h4",{attrs:{id:"geographic-information"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geographic-information"}},[e._v("#")]),e._v(" Geographic Information")]),e._v(" "),r("h5",{attrs:{id:"geo-address-city-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-city-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:city:code")])]),e._v(" "),r("p",[e._v("The code of the city part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:county:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-city-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-city-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:city:label")])]),e._v(" "),r("p",[e._v("The name of the city part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:city:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-country-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-country-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:country:code")])]),e._v(" "),r("p",[e._v("The code of the country part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-country-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-country-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:country:label")])]),e._v(" "),r("p",[e._v("The name of the country part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:country:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-county-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-county-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:county:code")])]),e._v(" "),r("p",[e._v("The code of the county part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:region:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-county-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-county-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:county:label")])]),e._v(" "),r("p",[e._v("The name of the county part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:county:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-region-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-region-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:region:code")])]),e._v(" "),r("p",[e._v("The code of the region part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:country:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-region-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-region-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:region:label")])]),e._v(" "),r("p",[e._v("The name of the region part of the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("geo:address:region:code")])])]),e._v(" "),r("h5",{attrs:{id:"geo-address-street-address-description"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-street-address-description"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:street-address:description")])]),e._v(" "),r("p",[e._v("Actual street address in whole address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"geo-address-zip-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#geo-address-zip-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("geo:address:zip:code")])]),e._v(" "),r("p",[e._v("The postal code in the address")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("geo:address:city:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h4",{attrs:{id:"actors-involved-in-the-transaction-administrator-procurer"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#actors-involved-in-the-transaction-administrator-procurer"}},[e._v("#")]),e._v(" Actors involved in the Transaction (Administrator, Procurer)")]),e._v(" "),r("h5",{attrs:{id:"administrator-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#administrator-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("administrator:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Administrator")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"administrator-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#administrator-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("administrator:generic:name")])]),e._v(" "),r("p",[e._v("The display name for the Administrator")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("administrator:generic:id")])])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-account"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-account"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:account")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank account of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-branch-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-branch-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:branch:code")])]),e._v(" "),r("p",[e._v("Unique identifier of the bank’s branch of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-branch-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-branch-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:branch:name")])]),e._v(" "),r("p",[e._v("Name of the bank’s branch of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("procurer:bank:branch:code")])])]),e._v(" "),r("h5",{attrs:{id:"procurer-bank-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-bank-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:bank:code")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"procurer-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"procurer-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#procurer-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("procurer:generic:name")])]),e._v(" "),r("p",[e._v("The display name of the Procurer")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("procurer:generic:id")])])]),e._v(" "),r("h4",{attrs:{id:"recipient-of-the-transaction"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-of-the-transaction"}},[e._v("#")]),e._v(" Recipient of the Transaction")]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-account"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-account"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:account")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank account of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-branch-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-branch-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:branch:code")])]),e._v(" "),r("p",[e._v("Unique identifier of the bank’s branch of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-branch-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-branch-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:branch:name")])]),e._v(" "),r("p",[e._v("Name of the bank’s branch of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:bank:branch:name")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-bank-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-bank-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:bank:code")])]),e._v(" "),r("p",[e._v("Unique identifier for the bank of the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-code-type"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-code-type"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:code-type")])]),e._v(" "),r("p",[e._v("Unique identifier for the codelist from which the legal entity code comes from")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("recipient:generic:id")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:code")])]),e._v(" "),r("p",[e._v("Unique identifier for the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:code-type")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:label")])]),e._v(" "),r("p",[e._v("Trading name (or other) of the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:code")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-point-of-contact-description"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-point-of-contact-description"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:point-of-contact:description")])]),e._v(" "),r("p",[e._v("Text describing the representative of the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:code")])]),e._v(" "),r("p",[e._v("Code of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("prior")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:code")])]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-description"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-description"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:description")])]),e._v(" "),r("p",[e._v("Name of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-label"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-label"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:label")])]),e._v(" "),r("p",[e._v("Name of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:code")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-legal-entity-receiving-project-status"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-legal-entity-receiving-project-status"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:legal-entity:receiving-project:status")])]),e._v(" "),r("p",[e._v("Status of the specific project inside the legal entity")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:name")])]),e._v(" "),r("p",[e._v("The display name for the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("recipient:generic:id")])])]),e._v(" "),r("h5",{attrs:{id:"recipient-generic-url"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#recipient-generic-url"}},[e._v("#")]),e._v(" "),r("code",[e._v("recipient:generic:url")])]),e._v(" "),r("p",[e._v("An Internet address for the Recipient")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h4",{attrs:{id:"supplier-details"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supplier-details"}},[e._v("#")]),e._v(" Supplier Details")]),e._v(" "),r("h5",{attrs:{id:"supplier-generic-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supplier-generic-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("supplier:generic:id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Supplier")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"supplier-generic-name"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supplier-generic-name"}},[e._v("#")]),e._v(" "),r("code",[e._v("supplier:generic:name")])]),e._v(" "),r("p",[e._v("The display name for the Supplier")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("labelOf")]),e._v(": "),r("code",[e._v("supplier:generic:id")])])]),e._v(" "),r("h4",{attrs:{id:"transaction-details"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-details"}},[e._v("#")]),e._v(" Transaction Details")]),e._v(" "),r("h5",{attrs:{id:"transaction-id-budget-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-budget-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:budget-code")])]),e._v(" "),r("p",[e._v("Unique identifier for the Budget Line for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-code"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-code"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:code")])]),e._v(" "),r("p",[e._v("A Unique identifier for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-contract-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-contract-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:contract-id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Contract for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-court-order"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-court-order"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:court-order")])]),e._v(" "),r("p",[e._v("Unique identifier for the Court Order for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-invoice-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-invoice-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:invoice-id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Invoice for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-purchase-order"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-purchase-order"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:purchase-order")])]),e._v(" "),r("p",[e._v("Unique identifier for the Purchase Order for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-tender-id"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-tender-id"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:tender-id")])]),e._v(" "),r("p",[e._v("Unique identifier for the Tender for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")]),e._v(" "),r("li",[r("em",[e._v("unique")]),e._v(": True")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-tender-kind"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-tender-kind"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:tender-kind")])]),e._v(" "),r("p",[e._v("Unique identifier for the Tender Kind for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])]),e._v(" "),r("h5",{attrs:{id:"transaction-id-transaction-kind"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#transaction-id-transaction-kind"}},[e._v("#")]),e._v(" "),r("code",[e._v("transaction-id:transaction-kind")])]),e._v(" "),r("p",[e._v("Unique identifier for the Transaction Kind for this transaction")]),e._v(" "),r("ul",[r("li",[r("em",[e._v("dataType")]),e._v(": string")])])],1)}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/21.a2d11985.js b/assets/js/21.3fad06c6.js similarity index 99% rename from assets/js/21.a2d11985.js rename to assets/js/21.3fad06c6.js index baa6be6d..65c3b225 100644 --- a/assets/js/21.a2d11985.js +++ b/assets/js/21.3fad06c6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{391:function(t,a,e){"use strict";e.r(a);var s=e(26),n=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("This is a draft specification and still under development. If you have comments or suggestions please file them in the "),e("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("issue tracker"),e("OutboundLink")],1),t._v(". If you have explicit changes please fork the "),e("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("git repo"),e("OutboundLink")],1),t._v(" and submit a pull request.")])]),t._v(" "),e("h1",{attrs:{id:"page-frontmatter-title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),e("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),e("MetadataTable"),t._v(" "),e("h2",{attrs:{id:"language"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),e("Language"),t._v(" "),e("h2",{attrs:{id:"changelog"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#changelog"}},[t._v("#")]),t._v(" Changelog")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("1.0.0rc1")]),t._v(": Updated distinction between spec and standard")]),t._v(" "),e("li",[e("code",[t._v("1.0.0rc")]),t._v(": A complete rewrite of the spec")]),t._v(" "),e("li",[e("code",[t._v("0.3.0")]),t._v(": incorporates all changes up to "),e("code",[t._v("0.3.0-alpha9")])]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha9")]),t._v(": (!) rename mapping to model. Remove ‘ocdid’ as recommended attribute for location dimension.")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha8")]),t._v(": remove transaction identifier")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha7")]),t._v(": remove quality level guidance")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha6")]),t._v(": dimension fields -> attributes, revert measures/dimensions/attributes to objects, add "),e("code",[t._v("parent")]),t._v(" and "),e("code",[t._v("labelfor")]),t._v(" keys on dimension attributes")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha5")]),t._v(": variety of improvements and corrections including #35, #37 etc")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha4")]),t._v(": reintroduce a lot of the content of data recommendations from v0.2")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha3")]),t._v(": rework mapping structure in various ways")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha2")]),t._v(": rename Budget Data Package to Fiscal Data Package")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha")]),t._v(": very substantial rework of spec to use “mapping” approach between physical and logical model. Core framework, based on Tabular Data Package, is unchanged.")]),t._v(" "),e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package/0.2/"}},[e("code",[t._v("0.2.0")])]),t._v(": large numbers of changes and clarifications for particular fields but no substantive change to the overall spec")],1),t._v(" "),e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package/0.1/"}},[e("code",[t._v("0.1.0")])]),t._v(": first complete version of the specification")],1)]),t._v(" "),e("p",[t._v("[toc]")]),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("This document contains the “Fiscal Data Package” specification - a lightweight and user-oriented format for publishing and consuming fiscal data.")]),t._v(" "),e("p",[t._v("The motivation behind the fiscal data package was to create a specification which is "),e("em",[t._v("open by nature")]),t._v(" - based on other open standards, supported by open tools and software, modular, extensible and promoted transparently by a large community.")]),t._v(" "),e("p",[t._v("It is designed to be lightweight and simple to use - providing a small but flexible set of features, based on real-world requirements and not theoretical ones. All the while, the built-in extensibility allows this spec to adapt to many different use cases and domains. It is also possible to gradually use more and more part of this specification - thus making it easier to implement this spec with existing data while slowly improving the data quality.")]),t._v(" "),e("p",[t._v("A main concern of this specification is the ability to work with data "),e("em",[t._v("as it is currently exists")]),t._v(", without forcing publishers to modify the contents or structure of their current data files in order to “adapt” them to the specification.")]),t._v(" "),e("p",[t._v("It concerns with how fiscal data should be packaged and providing means for publishers to best convey the meaning of the data - so it can be optimally used by consumers. This specification also provides details regarding file-formats, data-types, meta-data and structuring the data in files.")]),t._v(" "),e("p",[t._v("On the other hand, this specification is, "),e("em",[t._v("by design")]),t._v(", non-opinionated about which data "),e("em",[t._v("should")]),t._v(" be published by publishers - which data-sets, which fields and and the internal processes these reflect.")]),t._v(" "),e("p",[t._v("Alongside this specification are two fiscal taxonomies which serve as standards for publishing "),e("em",[t._v("budget")]),t._v(" files and "),e("em",[t._v("spending")]),t._v(" files. These can be found here:")]),t._v(" "),e("ul",[e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package--budgets/"}},[t._v("The Budget Fiscal Data Package Standard")])],1),t._v(" "),e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package--spending/"}},[t._v("The Spending Fiscal Data Package Standard")])],1)]),t._v(" "),e("h3",{attrs:{id:"lessons-learned-from-v0-3-of-this-spec"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#lessons-learned-from-v0-3-of-this-spec"}},[t._v("#")]),t._v(" Lessons learned from v0.3 of this spec")]),t._v(" "),e("p",[t._v("Via a wide range of technical implementation, partner piloting, and fiscal data projects with other civic tech and data journalist partners, we’ve learned a lot about what works in Fiscal Data package v0.3, and what does not. We want to take these learnings and make a more robust and future proof v1.0 of the specification.")]),t._v(" "),e("h4",{attrs:{id:"modelling"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modelling"}},[t._v("#")]),t._v(" Modelling")]),t._v(" "),e("p",[t._v("Version 0.3 of the spec contained an elaborate system for modelling of the fiscal data. In practice, this system turned out to be too complicated for normal users and error prone (as inconsistent modelling could be created).")]),t._v(" "),e("p",[t._v("To add to that, modelling was not versatile enough to account for the very different source files existing with real users, nor was it expressive enough to convey the specific semantics required by these users.")]),t._v(" "),e("p",[t._v("A few examples of this strictness includes:")]),t._v(" "),e("ul",[e("li",[t._v("The predefined set of classifications for dimensions. This hard-coded list did not capture the richness of fiscal data ‘in the wild’, as it contained too few and too broad options.")]),t._v(" "),e("li",[t._v("Measure columns were assumed to be of a specific currency, disregarding datasets in which the currency is provided in a separate column (or non monetary measures).")]),t._v(" "),e("li",[t._v("Measure columns were assumed to be of a specific budgeting phase (out of 4 options) and of a single direction (income/expenditure), ignoring data sets which have different phases, or that the phase or direction are provided in a separate column - or data sets which are not related to budgets altogether…")])]),t._v(" "),e("h4",{attrs:{id:"file-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#file-structure"}},[t._v("#")]),t._v(" File structure")]),t._v(" "),e("p",[t._v("While machines will always prefer to read data files in their denormalised (or unpivoted) form - as it’s the most verbose and straightforward one - publishers will often choose a more compact, pivoted form. Other publishers would take out from the file some of the data, and append it as a separate code list file.")]),t._v(" "),e("p",[t._v("Version 0.3 of the spec assumed data files would only be provided in a very specific pivoted form - which might apply to some cases, but practically failed on many other pivoting variations that were encountered.")]),t._v(" "),e("h3",{attrs:{id:"what-s-different"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-s-different"}},[t._v("#")]),t._v(" What’s different?")]),t._v(" "),e("p",[t._v("In a nutshell, the notable changes from v0.3 to v1 are as follows:")]),t._v(" "),e("ul",[e("li",[t._v("Consistent usage of “fiscal concepts” to model fiscal data (i.e. "),e("em",[t._v("ColumnTypes")]),t._v("), instead of the mix of metadata properties, measures and dimensions in v0.3 (all concepts are either a measure or a dimension)")]),t._v(" "),e("li",[t._v("The representation of concepts on data resources, instead of on a distinct "),e("code",[t._v("model")]),t._v(" property")]),t._v(" "),e("li",[t._v("Improve implementation and semantics around direction and phase")]),t._v(" "),e("li",[t._v("Have explicit recommendations on the desirable concepts for given types of fiscal data (budget, spend, etc.)")]),t._v(" "),e("li",[t._v("Update to be based on Tabular Data Package v1")])]),t._v(" "),e("h2",{attrs:{id:"terminology"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#terminology"}},[t._v("#")]),t._v(" Terminology")]),t._v(" "),e("h3",{attrs:{id:"what-is-fiscal-data"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-fiscal-data"}},[t._v("#")]),t._v(" What is Fiscal Data?")]),t._v(" "),e("p",[t._v("In the context of this specification, we will define a fiscal dataset, at its core, to be one providing information on a series of fiscal transactions.")]),t._v(" "),e("p",[t._v("Each of these transactions consists of the following concepts:")]),t._v(" "),e("ul",[e("li",[t._v("The "),e("em",[t._v("source")]),t._v(" of the transaction")]),t._v(" "),e("li",[t._v("The "),e("em",[t._v("recipient")]),t._v(" of the transaction")]),t._v(" "),e("li",[e("em",[t._v("When")]),t._v(" the transaction occurred")]),t._v(" "),e("li",[t._v("A single "),e("em",[t._v("amount")]),t._v(" of money (or equivalent) that was transferred in the transaction")]),t._v(" "),e("li",[t._v("Other properties describing the transaction")])]),t._v(" "),e("p",[t._v("These concepts must appear in all fiscal data - there is no transaction without knowing who gave how much money, to whom and when. However, in some cases, the transactions are aggregated - either because the exact recipient is not known yet (which is usually the case when planning a budget) or because it’s preferable to present data aggregated over a period of time (usually a single fiscal year).")]),t._v(" "),e("p",[t._v("In aggregated data sets, you would find only a subset of these concepts. For example, a planned budget file would aggregate transactions over a period of a fiscal year, indicating the source of the transaction and its amount but without specifying the exact recipients (which are still unknown at the time of planning).")]),t._v(" "),e("p",[t._v("Properties describing the transaction could be:")]),t._v(" "),e("ul",[e("li",[t._v("Unique identifiers of the transaction")]),t._v(" "),e("li",[t._v("Classifications of sorts, providing context for the source of the money or what is its purpose")]),t._v(" "),e("li",[t._v("Details regarding the procurement or budgeting process related to the amount (e.g. allocated vs. executed budgeting phase)")]),t._v(" "),e("li",[t._v("Information regarding the mechanism used to transfer the money")]),t._v(" "),e("li",[t._v("Description of the amount itself - currency, multiplication factor")])]),t._v(" "),e("p",[t._v("Other properties are naturally possible - all depending on the actual financial systems that are involved in the transaction.")]),t._v(" "),e("h4",{attrs:{id:"example"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),e("p",[t._v("We’ll demonstrate the theoretical concepts with a concrete example - the Smith Family Fiscal Data.")]),t._v(" "),e("p",[t._v("On September 30th, the family gathered and decided on a budget for the upcoming week:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Week")]),t._v(" "),e("th",[t._v("ID")]),t._v(" "),e("th",[t._v("Buyer")]),t._v(" "),e("th",[t._v("Purpose")]),t._v(" "),e("th",[t._v("Payment Method")]),t._v(" "),e("th",[t._v("Planned Amount")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$100")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Books")]),t._v(" "),e("td",[t._v("Paypal Account")]),t._v(" "),e("td",[t._v("$15")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Shop Gift Card")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Fuel")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$40")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("Marty")]),t._v(" "),e("td",[t._v("Candy")]),t._v(" "),e("td",[t._v("Allowance - Cash")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Taxes")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("p",[t._v("In this example we can see most of the concepts we’d often see in budget files:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("Week")]),t._v(" is the "),e("em",[t._v("Fiscal Period")])]),t._v(" "),e("li",[e("em",[t._v("Buyer")]),t._v(" serves as the "),e("em",[t._v("Administrative Classification")])]),t._v(" "),e("li",[e("em",[t._v("Purpose")]),t._v(" would be the "),e("em",[t._v("Functional Classification")])]),t._v(" "),e("li",[e("em",[t._v("Payment Method")]),t._v(" is the "),e("em",[t._v("Economic Classification")])]),t._v(" "),e("li",[t._v("and the "),e("em",[t._v("Amount")]),t._v(" is, naturally, the budgeted amount.")])]),t._v(" "),e("p",[t._v("This above data table is an example of an "),e("em",[t._v("aggregated data set")]),t._v(". We don’t see individual purchases, but rather a plan of the purchases over the week, summed according to purpose, buyer and purchase method.")]),t._v(" "),e("p",[t._v("When the week ended, the family gathered once again and reviewed the actual spending that took place during that week:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Date")]),t._v(" "),e("th",[t._v("Budget ID")]),t._v(" "),e("th",[t._v("Item")]),t._v(" "),e("th",[t._v("Where")]),t._v(" "),e("th",[t._v("Amount")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1/2")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("30L Fuel")]),t._v(" "),e("td",[t._v("Gas Station")]),t._v(" "),e("td",[t._v("$15.5")])]),t._v(" "),e("tr",[e("td",[t._v("1/2")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("Housing Tax")]),t._v(" "),e("td",[t._v("City Hall")]),t._v(" "),e("td",[t._v("$20")])]),t._v(" "),e("tr",[e("td",[t._v("2/2")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("Shirts")]),t._v(" "),e("td",[t._v("Mall")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("2/2")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("Trousers")]),t._v(" "),e("td",[t._v("Mall")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("3/2")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("Groceries")]),t._v(" "),e("td",[t._v("Market")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("4/2")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("31L Fuel")]),t._v(" "),e("td",[t._v("Gas Station")]),t._v(" "),e("td",[t._v("$16.2")])]),t._v(" "),e("tr",[e("td",[t._v("6/2")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("Bubble Gum")]),t._v(" "),e("td",[t._v("Candy Shop")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("7/2")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("28L Fuel")]),t._v(" "),e("td",[t._v("Gas Station")]),t._v(" "),e("td",[t._v("$13.3")])])])]),t._v(" "),e("p",[t._v("We can see that this data provides detailed information about the individual transactions that were made. In our example:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("Where")]),t._v(" would be the "),e("em",[t._v("Recipient")]),t._v(" of the transaction, and")]),t._v(" "),e("li",[e("em",[t._v("Item")]),t._v(" would be the "),e("em",[t._v("Purpose")]),t._v(" of the transaction")])]),t._v(" "),e("p",[t._v("Combined with the original budget (using the "),e("em",[t._v("ID")]),t._v(" columns), we can know "),e("em",[t._v("Who")]),t._v(" did each purchase, for what purpose and with which payment method.")]),t._v(" "),e("p",[t._v("We can then aggregate the transactions and get an "),e("em",[t._v("Executed Budget")]),t._v(" data set, which contains both the planned and executed figures for each aggregated row:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Week")]),t._v(" "),e("th",[t._v("ID")]),t._v(" "),e("th",[t._v("Buyer")]),t._v(" "),e("th",[t._v("Purpose")]),t._v(" "),e("th",[t._v("Payment Method")]),t._v(" "),e("th",[t._v("Planned")]),t._v(" "),e("th",[t._v("Executed")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$100")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Books")]),t._v(" "),e("td",[t._v("PayPal Account")]),t._v(" "),e("td",[t._v("$15")]),t._v(" "),e("td",[t._v("$0")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Shop Gift Card")]),t._v(" "),e("td",[t._v("$25")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Fuel")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$40")]),t._v(" "),e("td",[t._v("$45")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("Marty")]),t._v(" "),e("td",[t._v("Candy")]),t._v(" "),e("td",[t._v("Allowance - Cash")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Taxes")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$20")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("h3",{attrs:{id:"what-is-a-fiscal-data-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-a-fiscal-data-file"}},[t._v("#")]),t._v(" What is a Fiscal Data File?")]),t._v(" "),e("p",[t._v("In the context of this specification, a fiscal data file is a physical representation of fiscal data (as defined above), in a series of computer files.")]),t._v(" "),e("p",[t._v("This representation might consist of a single, denormalised, data-table (with one row per transaction) - or take a more normalised form, spanning multiple, separate tables.")]),t._v(" "),e("p",[t._v("Note: We use the terms ‘normalised’ and ‘denormalised’ in this document quite a bit, so it’s best to take a moment and understand what they mean. In short, a normalised form is a way of structuring data so that redundancy is minimised. A denormalised form has the simplest form but also the most redundant one. More on this can be found in this "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Database_normalization",target:"_blank",rel:"noopener noreferrer"}},[t._v("Wikipedia Page"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("Table columns will hold some property (or properties) of the above concepts - some will hold amounts, some will hold information regarding the recipient etc. As the exact nature of each of these concepts varies greatly by context, the possibilities for properties appearing in a fiscal data file column are also great.")]),t._v(" "),e("p",[t._v("A fiscal data file might contain all information necessary to reconstruct the fiscal data, or it might have some implicit information which is not part of the data. As an example, imagine the following scenarios:")]),t._v(" "),e("ul",[e("li",[t._v("A budget file named ‘2015_budget.csv’, not including the ‘year’ column as it’s already in the file name")]),t._v(" "),e("li",[t._v("A budget file with no ‘year’ column, instead having ‘2017’, ‘2018’, and ‘2019’ columns.")])]),t._v(" "),e("p",[t._v("In these two scenarios, we need to the file’s metadata and augment the actual data records contained in the file - in order to be able to correctly reconstruct the original data.")]),t._v(" "),e("p",[t._v("As with any tabular data, a physical representation of data also includes selection of file formats, data formatting and locale specifics (which are out of scope for this specification and are handled in the Tabular Data Package specification).")]),t._v(" "),e("h4",{attrs:{id:"example-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[t._v("#")]),t._v(" Example")]),t._v(" "),e("p",[t._v("Let’s imagine we asked Lorraine and George to email us their weekly family budget. Although working on the same data set, each took a very different approach as to how to represent the data in an actual data file.")]),t._v(" "),e("p",[t._v("George, which is an accountant, sent us an CSV file named "),e("code",[t._v("week_of_1_7_oct.csv")]),t._v(". The CSV file contained these cells:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Who?")]),t._v(" "),e("th",[t._v("What for?")]),t._v(" "),e("th",[t._v("How?")]),t._v(" "),e("th",[t._v("Plan")]),t._v(" "),e("th",[t._v("Actual")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$100")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Books")]),t._v(" "),e("td",[t._v("Paypal Account")]),t._v(" "),e("td",[t._v("$15")]),t._v(" "),e("td",[t._v("$0")])]),t._v(" "),e("tr",[e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Shop Gift Card")]),t._v(" "),e("td",[t._v("$25")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Fuel")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$40")]),t._v(" "),e("td",[t._v("$45")])]),t._v(" "),e("tr",[e("td",[t._v("Marty")]),t._v(" "),e("td",[t._v("Candy")]),t._v(" "),e("td",[t._v("Allowance - Cash")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Taxes")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$20")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("p",[t._v("Lorraine, a Data Scientist, took a different approach. In the email that she sent, there were attached 5 different CSV files:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Budget.csv")]),t._v(":")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Week Start")]),t._v(" "),e("th",[t._v("ID")]),t._v(" "),e("th",[t._v("BuyerID")]),t._v(" "),e("th",[t._v("PurposeID")]),t._v(" "),e("th",[t._v("PaymentMethodID")]),t._v(" "),e("th",[t._v("PhaseID")]),t._v(" "),e("th",[t._v("Amount")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P1")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$100")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P1")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P2")]),t._v(" "),e("td",[t._v("PM2")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$15")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P2")]),t._v(" "),e("td",[t._v("PM2")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$0")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM3")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM3")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P4")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$40")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P4")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$45")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("B3")]),t._v(" "),e("td",[t._v("P5")]),t._v(" "),e("td",[t._v("PM4")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("B3")]),t._v(" "),e("td",[t._v("P5")]),t._v(" "),e("td",[t._v("PM4")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P6")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$20")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P6")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Buyer.csv")]),t._v(":")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("BuyerID")]),t._v(" "),e("th",[t._v("Buyer")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("George")])]),t._v(" "),e("tr",[e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("Lorraine")])]),t._v(" "),e("tr",[e("td",[t._v("B3")]),t._v(" "),e("td",[t._v("Marty")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Purpose.csv")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("PurposeID")]),t._v(" "),e("th",[t._v("Purpose")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("P1")]),t._v(" "),e("td",[t._v("Food")])]),t._v(" "),e("tr",[e("td",[t._v("P2")]),t._v(" "),e("td",[t._v("Books")])]),t._v(" "),e("tr",[e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("Clothing")])]),t._v(" "),e("tr",[e("td",[t._v("P4")]),t._v(" "),e("td",[t._v("Fuel")])]),t._v(" "),e("tr",[e("td",[t._v("P5")]),t._v(" "),e("td",[t._v("Candy")])]),t._v(" "),e("tr",[e("td",[t._v("P6")]),t._v(" "),e("td",[t._v("Taxes")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("PaymentMethod.csv")]),t._v(":")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("PaymentMethodID")]),t._v(" "),e("th",[t._v("Payment Method")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("Credit Card")])]),t._v(" "),e("tr",[e("td",[t._v("PM2")]),t._v(" "),e("td",[t._v("PayPal Account")])]),t._v(" "),e("tr",[e("td",[t._v("PM3")]),t._v(" "),e("td",[t._v("Shop Gift Card")])]),t._v(" "),e("tr",[e("td",[t._v("PM4")]),t._v(" "),e("td",[t._v("Allowance - Cash")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Phase.csv")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("PhaseID")]),t._v(" "),e("th",[t._v("Phase")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("P")]),t._v(" "),e("td",[t._v("Planned")])]),t._v(" "),e("tr",[e("td",[t._v("A")]),t._v(" "),e("td",[t._v("Actual")])])])]),t._v(" "),e("p",[e("em",[e("strong",[t._v("How is Lorraine’s method different from Georges’?")])])]),t._v(" "),e("ol",[e("li",[t._v("We can see that Lorraine’s method has far less data duplication - all field values are mapped to unique identifiers and the full names are detailed in separate, smaller tables.")]),t._v(" "),e("li",[t._v("Another observation is that there is only one single amount column. The distinction between the two amount columns ("),e("em",[t._v("Planned")]),t._v(" and "),e("em",[t._v("Actual")]),t._v(") was transformed into a new "),e("em",[t._v("Phase")]),t._v(" column.")]),t._v(" "),e("li",[t._v("Unlike George’s file, Lorraine has all the required information as part of the data - specifically, the time period has its own column and is not only mentioned in the name of the sheet")]),t._v(" "),e("li",[t._v("Finally, Lorraine chose a more common way of presenting the date - using the ISO standard YYYY-MM-DD format.")])]),t._v(" "),e("h3",{attrs:{id:"what-is-the-fiscal-data-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-the-fiscal-data-package"}},[t._v("#")]),t._v(" What is the Fiscal Data Package?")]),t._v(" "),e("p",[t._v("A Fiscal Data Package is a means to "),e("em",[t._v("describe")]),t._v(" an existing fiscal data file so that data can be consistently and accurately extracted into its logical representation, without the need for any external assumptions or preconditions.")]),t._v(" "),e("p",[t._v("A rich taxonomy of fiscal concepts ("),e("em",[t._v("ColumnTypes")]),t._v(") allows these descriptors to provide some "),e("em",[t._v("meaning")]),t._v(" to the resulting data. The different columns in the data are mapped into common, generic fiscal concepts which allow users of the data to understand it without having to understand the very specifics of the financial system that produced it. Furthermore, users are allowed to extend that taxonomy in a way that allows them to provide these context specific details while still keeping the mapping to a common concept.")]),t._v(" "),e("h4",{attrs:{id:"example-1-george-s-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-1-george-s-file"}},[t._v("#")]),t._v(" Example 1 - George’s file")]),t._v(" "),e("p",[t._v("We’ll go over the concepts of the Fiscal Data Package via a few examples.")]),t._v(" "),e("p",[t._v("First, we shall model George’s file from the previous section.")]),t._v(" "),e("p",[t._v("The Fiscal Data Package is an extension of a Tabular Data Package, so our output should be a valid "),e("code",[t._v("datapackage.json")]),t._v(" file - the data package descriptor:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"smith-budget-by-george"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Smith Family Budget (George\'s version)"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("We start by providing a little metadata for the entire dataset…")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"budget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"week_of_1_7_oct.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("And then some metadata on the resource itself."),e("br"),t._v("\nNow we describe the different columns in the file:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Who?"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"administrative-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("The first column is the “Who?” column - the administrative classification in our example dataset. We state that the column is of a "),e("em",[t._v("string")]),t._v(" type and we provide a proper "),e("em",[t._v("ColumnType")]),t._v(" to state that this is an "),e("em",[t._v("Administrative Classification Code")]),t._v(" (more on ColumnTypes later on).")]),t._v(" "),e("p",[t._v("We now continue to model the rest of the fields:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"What for?"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"functional-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"How?"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"economic-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally we want to handle the amounts - also known as ‘measures’: ‘Plan’ and ‘Actual’. How do we represent correctly the difference between the two?")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Plan"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"bareNumber"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Plan"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Actual"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"bareNumber"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Actual"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Although both planned and actual values appear in the same row, each one of them is, in fact, a separate data point. Conceptually, we could imagine a new table where each row is converted into two rows, for example")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("George")]),t._v(" "),e("th",[t._v("Food")]),t._v(" "),e("th",[t._v("Credit Card")]),t._v(" "),e("th",[t._v("$100")]),t._v(" "),e("th",[t._v("$107.60")])])]),t._v(" "),e("tbody")]),t._v(" "),e("p",[t._v("Would be converted to")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("George")]),t._v(" "),e("th",[t._v("Food")]),t._v(" "),e("th",[t._v("Credit Card")]),t._v(" "),e("th",[t._v("$100")]),t._v(" "),e("th",[t._v("Plan")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$107.60")]),t._v(" "),e("td",[t._v("Actual")])])])]),t._v(" "),e("p",[t._v("So that we’re left with just one “measure” and an extra “phase” column.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("normalize")]),t._v(" attribute does exactly that - and it works together with the "),e("code",[t._v("extraField")]),t._v(" property which declares all the columns which are not part of the physical source file:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Amount"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalizationTarget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("true")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("The first extra field is the normalisation target."),e("br"),t._v("\nBoth amounts (from ‘Plan’ and ‘Actual’) will be placed here. Notice we gave this column the "),e("code",[t._v("value")]),t._v(" ColumnType, denoting it as a value (or a "),e("em",[t._v("“Measure”")]),t._v(").")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase:id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("The second extra field will hold the “phase” - based on the values in the "),e("code",[t._v("normalize")]),t._v(" property in the table schema fields."),e("br"),t._v("\nWhen denormalising, these two extra fields should replace the existing ‘Plan’ and ‘Actual’ columns.")]),t._v(" "),e("p",[t._v("Finally, we want to move the “fiscal period” from the filename to a proper column in the data itself. We do that by declaring a “constant” field. While we’re at it we also add a proper currency column - just in case the Smith’s decide one day to open an offshore bank account.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Week Start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:fiscal:activity-start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1/10/2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"%d/%m/%Y"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Currency"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value-currency:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h4",{attrs:{id:"example-2-lorraine-s-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-2-lorraine-s-file"}},[t._v("#")]),t._v(" Example 2 - Lorraine’s file")]),t._v(" "),e("p",[t._v("Let’s model Lorraine’s file now.")]),t._v(" "),e("p",[t._v("We’ll start with the same metadata:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"smith-budget-by-lorraine"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Smith Family Budget (Lorraine\'s version)"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("And then we start describing the different resources - in Lorraine’s case, we’ve got 5 of them."),e("br"),t._v("\nThe first one is the “buyer” table:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"buyer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Buyer.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Buyer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"administrative-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("This resource is pretty simple - we have only two columns, one of which is an identifier and the other is the actual buyer - which we mapped to a proper fiscal concept ("),e("em",[t._v("Administrative Classification")]),t._v(").")]),t._v(" "),e("p",[t._v("Let’s map a few more resources - these are pretty much the same:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purpose"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Purpose.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Purpose"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"functional-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"payment_method"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethod.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Payment Method"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"economic-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Phase.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase:id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally we tie all of these resources together into the main table (also known as the “facts table” - the “fact” in our case being a single transaction or budget item):")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"budget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Budget.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Week Start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:fiscal:activity-start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"%Y-%m-%d"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"budget-line-id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerId"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Amount"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"bareNumber"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Now, let’s use the magic of "),e("RouterLink",{attrs:{to:"/table-schema/#foreign-keys"}},[t._v("foreign keys")]),t._v(" to connect the main table to all the secondary tables:")],1),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"foreignKeys"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"buyer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purpose"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"payment_method"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally, all is left is to add the currency column (as in George’s file) and to wrap up.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Currency"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value-currency:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h2",{attrs:{id:"the-fiscal-data-package-descriptor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-fiscal-data-package-descriptor"}},[t._v("#")]),t._v(" The Fiscal Data Package Descriptor")]),t._v(" "),e("h3",{attrs:{id:"overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),e("p",[t._v("The Fiscal Data Descriptor is a fully-compatible extension of the Tabular Data Package specification (i.e., any fiscal data package should be fully readable by any tabular data package compatible software).")]),t._v(" "),e("p",[t._v("The purpose of this extension is to provide a domain specific modelling of a fiscal dataset.")]),t._v(" "),e("p",[t._v("There are quite a few motivations for such modelling:")]),t._v(" "),e("ul",[e("li",[t._v("Allowing fiscal data consumers to better understand the actual fiscal concept each column in the data set refers to")]),t._v(" "),e("li",[t._v("Provide means to re-structure the data in a predictable form: normalised, denormalised or other")]),t._v(" "),e("li",[t._v("Enabling smart and contextual comparisons of different datasets from different sources")])]),t._v(" "),e("p",[t._v("However, "),e("strong",[t._v("by design")]),t._v(", all parts of this extension are optional. In other words, the extent of modelling provided by the publisher of a fiscal data package is fully flexible and could range from the simple case of a tabular data package (with no modelling) - all through to a fully modelled dataset.")]),t._v(" "),e("p",[t._v("It is left to the implementors to place any restrictions, if any, on the minimal level of modelling that they require or on how to treat missing parts of the model (e.g. ignore, infer etc.)")]),t._v(" "),e("h3",{attrs:{id:"fiscal-modelling"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#fiscal-modelling"}},[t._v("#")]),t._v(" Fiscal Modelling")]),t._v(" "),e("p",[t._v("This specification allows modelling of fiscal data in two distinct levels: the structural level and the semantic level.")]),t._v(" "),e("p",[e("strong",[t._v("Structural Level")])]),t._v(" "),e("p",[t._v("We want to properly describe the structure of a dataset - so that data consumers are able to restructure the dataset based on their own needs and requirements.")]),t._v(" "),e("p",[t._v("The method for describing a dataset’s structure is to detail the difference between the provided form a dataset to its fully denormalised form. Essentially we’re listing a set of transformations, that when applied, would convert the dataset from the former to the latter.")]),t._v(" "),e("p",[t._v("Using the knowledge of how the denormalised data looks like, consumers can then better understand how to read, store or otherwise manipulate the data so it fits their existing systems and processes.")]),t._v(" "),e("p",[t._v("A denormalised presentation of a data set needs to fulfill these conditions:")]),t._v(" "),e("ul",[e("li",[t._v("all data is contained in a single data table")]),t._v(" "),e("li",[t._v("each row contains just one single data point with a single value")]),t._v(" "),e("li",[t._v("all data and metadata is provided within the data table")])]),t._v(" "),e("p",[t._v("The specification provides 3 possible transformations that might be used to describe how the dataset could be denormalised:")]),t._v(" "),e("ol",[e("li",[e("em",[t._v("Foreign Keys")]),t._v(" - connect separate data tables via an ID column present in both tables. This method is already part of the Tabular Data Package specification and will not be covered here.")]),t._v(" "),e("li",[e("em",[t._v("Denormalising Measures")]),t._v(" - convert a row with multiple measures in the source data into multiple rows, each with a single value.")]),t._v(" "),e("li",[e("em",[t._v("Constant Fields")]),t._v(" - represent metadata as constant columns in the data table")])]),t._v(" "),e("p",[e("strong",[t._v("Semantic Mapping")])]),t._v(" "),e("p",[t._v("Semantic mapping is the process of assigning meaning to the data. Basically we want to map each column in the dataset to a “real-world” fiscal concept, so that data consumers have better understanding of the data itself - and the data might be compared to other datasets (which share a semantic similarity).")]),t._v(" "),e("p",[t._v("This specification provides means for mapping each column in the original data (or its denormalised form) onto a fiscal concept, using a taxonomy of "),e("em",[t._v("ColumnTypes")]),t._v(" which cover a wide range of real-world fiscal concepts (and can be easily extended to cover custom cases).")]),t._v(" "),e("h3",{attrs:{id:"the-extrafields-property"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-extrafields-property"}},[t._v("#")]),t._v(" The "),e("code",[t._v("extraFields")]),t._v(" property")]),t._v(" "),e("p",[t._v("The main vehicle for the structural modelling is the "),e("code",[t._v("extraFields")]),t._v(" property - a property added to a tabular resource schema (as a sibling to the "),e("code",[t._v("fields")]),t._v(" property), similarly containing field definitions.")]),t._v(" "),e("p",[t._v("All the fields that are listed in the "),e("code",[t._v("extraFields")]),t._v(" property are ones that appear in the denormalised form but not on the original data. The contents of these columns is derived from the dataset itself (or from the descriptor). Each of these fields there also specifies how their content relates to the original dataset.")]),t._v(" "),e("h3",{attrs:{id:"denormalising-measures"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#denormalising-measures"}},[t._v("#")]),t._v(" Denormalising Measures")]),t._v(" "),e("p",[t._v("In many cases, publishers will prefer to have Approved, Modified and Executed values of a budget as separate columns, instead of duplicating the same line just to provide 3 figures. It is more readable to humans and more concise (i.e. creates a smaller file size).")]),t._v(" "),e("p",[t._v("In other cases, the budget figures for the current, next and after next years will appear as separate columns instead of in separate rows. This allows readers to more easily compare the budget figures across consecutive years.")]),t._v(" "),e("p",[t._v("In fact, we might even encounter data-set where both phase and year columns were reduced in the same way.")]),t._v(" "),e("p",[t._v("This practice is very common as a simple form of normalisation being done on a published dataset. However, some data is lost along the way - in our examples, we’ve lost the ‘Budget Phase’ column in the former, and ‘Fiscal Year’ column in the latter.")]),t._v(" "),e("p",[t._v("We want to describe this process to allow data consumers to potentially undo it - and to the least resurrect the data that was lost in the process.")]),t._v(" "),e("p",[t._v("In order to do so we need to:")]),t._v(" "),e("ul",[e("li",[t._v("Add to the "),e("code",[t._v("extraFields")]),t._v(" property a field definition for each column that was reduced (budget phase or fiscal year in our scenario), for example:")])]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[t._v("We add a "),e("code",[t._v("normalize")]),t._v(" property to "),e("em",[t._v("each")]),t._v(" measure in the schema. The value of this property is a mapping between "),e("em",[t._v("every")]),t._v(" ‘reduced column’ name to a value, for example:")])]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Approved 2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"approved"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2015")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Executed 2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"executed"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2015")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Approved 2016"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"approved"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2016")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Executed 2016"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"executed"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2016")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n")])])]),e("ul",[e("li",[t._v("Finally we add to the "),e("code",[t._v("extraFields")]),t._v(" property a field definition for the target column for the measures’ values, like so:")])]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Fiscal Amount"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalizationTarget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("true")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("h3",{attrs:{id:"constant-fields"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#constant-fields"}},[t._v("#")]),t._v(" Constant Fields")]),t._v(" "),e("p",[t._v("In order to complement missing information in the dataset it’s possible to add columns with ‘constant’ values to the schema.")]),t._v(" "),e("p",[t._v("We can do so by adding field definitions to the "),e("code",[t._v("extraFields")]),t._v(" property. Each of these field objects must also contain a "),e("code",[t._v("constant")]),t._v(" property, holding the constant value.")]),t._v(" "),e("p",[t._v("Provided value might be provided either in its logical representation or its physical representation.")]),t._v(" "),e("p",[t._v("Examples:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A String"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a value"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A Number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Another Number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5,4"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"decimalChar"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('","')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A Date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10/1/2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"%m/%d/%Y"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"An Array"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"array"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[3.14, 2.78]"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Last Example"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"array"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.14")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.78")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("h3",{attrs:{id:"columntypes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#columntypes"}},[t._v("#")]),t._v(" ColumnTypes")]),t._v(" "),e("p",[t._v("The "),e("em",[t._v("ColumnType")]),t._v(" taxonomy provides many common properties of fiscal concepts which appear as columns in many different fiscal data files.")]),t._v(" "),e("p",[t._v("When describing a fiscal data file, each column in a fiscal data file must be mapped to a single "),e("em",[t._v("ColumnType")]),t._v(" (Unmapped columns should simply be ignored).")]),t._v(" "),e("p",[t._v("By inspecting the different "),e("em",[t._v("ColumnTypes")]),t._v(" of the different columns in a file, one might get a good understanding of the meaning of each column and how different columns relate to one another.")]),t._v(" "),e("h4",{attrs:{id:"columntype-hierarchy-tree"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#columntype-hierarchy-tree"}},[t._v("#")]),t._v(" ColumnType Hierarchy Tree")]),t._v(" "),e("p",[e("em",[t._v("ColumnTypes")]),t._v(" are hierarchic: starting from very generic concepts at the root of the taxonomy (time, source, recipient, amount etc.), down to more and more specific concepts (via inheritance) - each one specialising its parent concept with a more fine-grained meaning.")]),t._v(" "),e("p",[t._v("The names of the "),e("em",[t._v("ColumnTypes")]),t._v(" represent that hierarchy. Each new level of the hierarchy is appended to the "),e("em",[t._v("ColumnType")]),t._v(" name, separated by colons.")]),t._v(" "),e("p",[t._v("For example, the "),e("code",[t._v("activity:generic:project:code")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" is a non-specific project code. It’s part of the “activity” fiscal concept (i.e. which activity is funded), describes a “project” (which is one kind of activity - others might be “program” or “contract”) and specifically targets the unique project code (and not its name, description or other property).")]),t._v(" "),e("h4",{attrs:{id:"columntype-basic-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#columntype-basic-properties"}},[t._v("#")]),t._v(" ColumnType Basic Properties")]),t._v(" "),e("p",[t._v("Each "),e("em",[t._v("ColumnType")]),t._v(" in the taxonomy can also have the following properties:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("dataType")]),t._v(": a "),e("code",[t._v("tableschema")]),t._v(" type."),e("br"),t._v("\nThis property states that columns with this "),e("em",[t._v("ColumnType")]),t._v(" must also have this data type. For example, the "),e("code",[t._v("date:fiscal-year")]),t._v(" column type (denoting a Fiscal Year) must always be mapped to a column with the "),e("code",[t._v("integer")]),t._v(" data type.")]),t._v(" "),e("li",[e("code",[t._v("unique")]),t._v(": boolean (default: false)"),e("br"),t._v("\nMapping a column to a "),e("em",[t._v("ColumnType")]),t._v(" which has "),e("code",[t._v("unique")]),t._v(" set to true, means that this column should be considered as part of the “primary key” of the table."),e("br"),t._v("\nFor example, the "),e("code",[t._v("transaction-id")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" has the "),e("code",[t._v("unique")]),t._v(" property set.")]),t._v(" "),e("li",[e("code",[t._v("labelOf")]),t._v(": a "),e("code",[t._v("unique")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" name"),e("br"),t._v("\nWhen a column contains labels for another column (usually containing codes), we will indicate this relationship using the "),e("code",[t._v("labelOf")]),t._v(" property. This tells readers of the file that the “label” column contains display-names for the values of the “code” column.")])]),t._v(" "),e("p",[t._v("Now for a few examples. We start with the "),e("em",[t._v("type definition")]),t._v(" of the fiscal year concept from above - a column of the "),e("code",[t._v("date:fiscal-year")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" must have an "),e("code",[t._v("integer")]),t._v(" type and be part of the primary key of the schema:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:fiscal-year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unique"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Similarly, this is the definition for a generic country code, the "),e("code",[t._v("geo:address:country:code")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unique"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("The main difference here is the data type - country codes are "),e("code",[t._v("string")]),t._v("s.")]),t._v(" "),e("p",[t._v("If we have in our dataset not only the country code but also the name of the country, we might consider using the "),e("code",[t._v("geo:address:country:label")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:label"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"labelOf"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Notice how this "),e("em",[t._v("ColumnType")]),t._v(" declares that it’s the label of another type ("),e("code",[t._v("geo:address:country:code")]),t._v("). It’s also not marked as unique, so it should not be a part of the schema’s primary field.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("labelOf")]),t._v(" relationship might be used by implementors to choose which columns should be used for filtering a data set (usually the “codes”) and which columns should be used for the filtering options that will be shown to users (usually the “labels”).")]),t._v(" "),e("p",[t._v("Note: while not strictly enforced, mapping columns to “label” "),e("em",[t._v("ColumnTypes")]),t._v(" without their “code” counterparts should be avoided.")]),t._v(" "),e("h4",{attrs:{id:"composite-column-types"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#composite-column-types"}},[t._v("#")]),t._v(" Composite Column Types")]),t._v(" "),e("p",[e("em",[t._v("ColumnTypes")]),t._v(" can be composite - for example, an "),e("code",[t._v("address")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" can be inherited by the "),e("code",[t._v("address:city")]),t._v(", "),e("code",[t._v("address:street")]),t._v(" and "),e("code",[t._v("address:street-number")]),t._v(" "),e("em",[t._v("ColumnTypes")]),t._v(". All of these, together, compose an "),e("em",[t._v("address")]),t._v(".")]),t._v(" "),e("p",[t._v("Composite "),e("em",[t._v("ColumnTypes")]),t._v(" might also have an inherent order - for example, a multi-level classification of a budget line. In this case, the "),e("em",[t._v("ColumnTypes")]),t._v(" for the 1st and 2nd levels of that classification will both inherit from the classification’s "),e("em",[t._v("ColumnType")]),t._v(", and the 2nd level "),e("em",[t._v("ColumnType")]),t._v(" will contain a "),e("code",[t._v("prior")]),t._v(" property, pointing to the 1st level "),e("em",[t._v("ColumnType")]),t._v(".")]),t._v(" "),e("p",[t._v("As an example, consider the non-specific administrative classification "),e("em",[t._v("ColumnType")]),t._v(", "),e("code",[t._v("administrative-classification:generic")]),t._v(". In most cases, this classification is multi-leveled, e.g. the first level might indicate a ministry, the second a department in that ministry and so on.")]),t._v(" "),e("p",[t._v("Therefore, columns describing the first level of that classification should be mapped to "),e("em",[t._v("ColumnTypes")]),t._v(" inheriting from "),e("code",[t._v("administrative-classification:generic:level1")]),t._v(". The column containing the code of the ministry (in our example) would be mapped to "),e("code",[t._v("administrative-classification:generic:level1:code")]),t._v(", while the name of the ministry would be mapped to "),e("code",[t._v("administrative-classification:generic:level1:label")]),t._v(".")]),t._v(" "),e("p",[t._v("Same goes for the department code and name columns, which would be mapped to the "),e("code",[t._v("administrative-classification:generic:level2:code")]),t._v(" and "),e("code",[t._v("administrative-classification:generic:level2:label")]),t._v(" "),e("em",[t._v("ColumnTypes")]),t._v(" respectively.")]),t._v(" "),e("p",[t._v("To indicate the connection between these two levels, we would add a "),e("code",[t._v("prior")]),t._v(" property to the "),e("code",[t._v("administrative-classification:generic:level2:code")]),t._v(" type, with a value of "),e("code",[t._v("administrative-classification:generic:level1:code")]),t._v(".")]),t._v(" "),e("p",[t._v("Then, when fetching the unique identifier for the administrative classification for a specific row, we would simply collect all values from columns with "),e("em",[t._v("ColumnTypes")]),t._v(" inheriting from "),e("code",[t._v("administrative-classification")]),t._v(" having "),e("code",[t._v("unique=true")]),t._v(", ordered using the values of the "),e("code",[t._v("prior")]),t._v(" property.")]),t._v(" "),e("p",[t._v("It is not required to map columns to all levels of a composite "),e("em",[t._v("ColumnType")]),t._v(". For example, consider a Geographic Classification system: Country > State > Region > County > City. It’s possible to map column just to the Country and City levels of the classification. Order is still maintained and missing levels are simply ignored.")]),t._v(" "),e("p",[t._v("As an example for using the "),e("code",[t._v("prior")]),t._v(" property, let’s consider this "),e("em",[t._v("phone number")]),t._v(" example:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:country-code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:national-prefix"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prior"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:country-code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prior"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:national-prefix"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:extension"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prior"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:number"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("recipient:phone-number")]),t._v(" concept is composed out of 4 parts: "),e("code",[t._v("country-code")]),t._v(", "),e("code",[t._v("national-prefix")]),t._v(", "),e("code",[t._v("number")]),t._v(" and "),e("code",[t._v("extension")]),t._v(".")]),t._v(" "),e("p",[t._v("When displaying the phone number, we use the "),e("code",[t._v("prior")]),t._v(" relationship to define exactly in which order to show them - so that "),e("code",[t._v("number")]),t._v(" never appears before "),e("code",[t._v("country-code")]),t._v(".")]),t._v(" "),e("p",[t._v("We also don’t need to have all these concepts present in a data-set to be able to set the order between them - for example, we might have a file without a "),e("code",[t._v("country-code")]),t._v(" (as all numbers are local), without a "),e("code",[t._v("national-prefix")]),t._v(" (because "),e("code",[t._v("number")]),t._v(" already contains that) or without an "),e("code",[t._v("extension")]),t._v(". In any of these cases we are still able to make out the correct order of the remaining concepts.")]),t._v(" "),e("h4",{attrs:{id:"custom-columntypes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#custom-columntypes"}},[t._v("#")]),t._v(" Custom ColumnTypes")]),t._v(" "),e("h5",{attrs:{id:"implicit-typing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implicit-typing"}},[t._v("#")]),t._v(" Implicit typing")]),t._v(" "),e("p",[t._v("Custom "),e("em",[t._v("ColumnTypes")]),t._v(" can be used without declaring them in advance.")]),t._v(" "),e("p",[t._v("The properties of each "),e("em",[t._v("ColumnType")]),t._v(" are implicitly derived from other "),e("em",[t._v("ColumnTypes")]),t._v(" based on their name.")]),t._v(" "),e("p",[t._v("For example, recall the "),e("code",[t._v("geo:address:country:label")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:label"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"labelOf"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Let’s assume that we have a dataset with country names in English, and another in our local language. To indicate the difference between these columns, we could map the first to the standard "),e("code",[t._v("geo:address:country:label")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(", and the second to a custom "),e("code",[t._v("geo:address:country:label:localized")]),t._v(".")]),t._v(" "),e("p",[t._v("While the former is a predefined "),e("em",[t._v("ColumnType")]),t._v(" and part of this spec, the latter is not. However, its properties can be deduced - simply by finding an existing "),e("em",[t._v("ColumnType")]),t._v(" whose name is a prefix to its own, and copying its properties.")]),t._v(" "),e("p",[t._v("Therefore, implementations encountering unknown "),e("em",[t._v("ColumnTypes")]),t._v(" should try and deduce their properties by finding another "),e("em",[t._v("ColumnType")]),t._v(" whose name is a prefix to the unknown type’s name - and copying its properties. If more than one such "),e("em",[t._v("ColumnType")]),t._v(" exists, properties should be copied from all of them - with precedence on duplicate property names to be given to the longer prefix.")]),t._v(" "),e("p",[t._v("If such an existing type is not found, then the "),e("em",[t._v("ColumnType")]),t._v(" is still valid - except it won’t have any restrictions on data types, won’t have relationships with the other columns and won’t be part of the schema’s primary key.")]),t._v(" "),e("h5",{attrs:{id:"explicit-typing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explicit-typing"}},[t._v("#")]),t._v(" Explicit typing")]),t._v(" "),e("p",[t._v("In many cases there might be a need to explicitly define one or more types."),e("br"),t._v("\nIt might be because we’re missing a specific type (which has some specific properties or a relationships to another existing type). It might also be because we want to provide a full taxonomy, better fitting the specific domain which our dataset belongs to.")]),t._v(" "),e("p",[t._v("In these cases, we would attach to the fiscal data package descriptor a “"),e("em",[t._v("ColumnType")]),t._v(" definition package”. This package contains definitions for any "),e("em",[t._v("ColumnType")]),t._v(" that is required to model the data.")]),t._v(" "),e("p",[t._v("The format of the "),e("em",[t._v("ColumnType")]),t._v(" definition package is quite simple - a JSON array, containing "),e("em",[t._v("ColumnType")]),t._v(" definitions as its items, for example:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# From https://www.car-makers-association.org/taxonomy/v1.3/columnTypes.json")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"car:model"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:manufacture-year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("When attached to the fiscal data package descriptor, it can be either attached inline, or as a URL, pointing to a JSON file containing the package.")]),t._v(" "),e("p",[t._v("The top-level "),e("code",[t._v("columnTypes")]),t._v(" property of the fiscal data package descriptor holds one or more "),e("em",[t._v("ColumnType")]),t._v(" definitions or definition packages. It is an array of items, which are interpreted like so:")]),t._v(" "),e("ul",[e("li",[t._v("If the array item is an object, it is interpreted as a single "),e("em",[t._v("ColumnType")]),t._v(" definition.")]),t._v(" "),e("li",[t._v("If the array item is an array, it is interpreted as a "),e("em",[t._v("ColumnType")]),t._v(" definition package.")]),t._v(" "),e("li",[t._v("If the array item is a string, it is interpreted as a URL for a "),e("em",[t._v("ColumnType")]),t._v(" definition package.")])]),t._v(" "),e("p",[t._v("As an example, let’s consider the following dataset containing sales figures for a used car agency:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"biffs-used-car-agency-2017-q1"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("So far it’s quite straightforward (we omit the resources section for brevity).")]),t._v(" "),e("p",[t._v("Now we define the "),e("em",[t._v("ColumnTypes")]),t._v(" that are being used in this specification.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnTypes"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://specs.frictionlessdata.io/taxonomies/fiscal/budgets.json"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("We start by specifying that we’ll be using the budget taxonomy "),e("em",[t._v("ColumnTypes")]),t._v(", as described "),e("RouterLink",{attrs:{to:"/fiscal-data-package/fiscal-data-package--budgets.html"}},[t._v("here")]),t._v(".")],1),t._v(" "),e("p",[t._v("This is also the default value for this property (in case its omitted in the spec).")]),t._v(" "),e("p",[t._v("We continue by including another taxonomy, from the made-up car makers association (which we saw above). This taxonomy is also added as URL, pointing to version 1.3 of that taxonomy.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(' "https'),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("//www.car"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("makers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v('association.org/taxonomy/v1.3/columnTypes.json"'),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Now we shall add a package inline - with a few car-sale related types:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"salesperson:employee-id"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"unique"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("true")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"salesperson:employee-fullname"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"labelOf"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"salesperson:employee-id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"owner:previous:name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"owner:new:name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally, we can also add a single type as well:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"owner:previous:is-scientist"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"boolean"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n")])])])],1)}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{390:function(t,a,e){"use strict";e.r(a);var s=e(26),n=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("div",{staticClass:"custom-block warning"},[e("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),e("p",[t._v("This is a draft specification and still under development. If you have comments or suggestions please file them in the "),e("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("issue tracker"),e("OutboundLink")],1),t._v(". If you have explicit changes please fork the "),e("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("git repo"),e("OutboundLink")],1),t._v(" and submit a pull request.")])]),t._v(" "),e("h1",{attrs:{id:"page-frontmatter-title"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),e("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),e("MetadataTable"),t._v(" "),e("h2",{attrs:{id:"language"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),e("Language"),t._v(" "),e("h2",{attrs:{id:"changelog"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#changelog"}},[t._v("#")]),t._v(" Changelog")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("1.0.0rc1")]),t._v(": Updated distinction between spec and standard")]),t._v(" "),e("li",[e("code",[t._v("1.0.0rc")]),t._v(": A complete rewrite of the spec")]),t._v(" "),e("li",[e("code",[t._v("0.3.0")]),t._v(": incorporates all changes up to "),e("code",[t._v("0.3.0-alpha9")])]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha9")]),t._v(": (!) rename mapping to model. Remove ‘ocdid’ as recommended attribute for location dimension.")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha8")]),t._v(": remove transaction identifier")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha7")]),t._v(": remove quality level guidance")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha6")]),t._v(": dimension fields -> attributes, revert measures/dimensions/attributes to objects, add "),e("code",[t._v("parent")]),t._v(" and "),e("code",[t._v("labelfor")]),t._v(" keys on dimension attributes")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha5")]),t._v(": variety of improvements and corrections including #35, #37 etc")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha4")]),t._v(": reintroduce a lot of the content of data recommendations from v0.2")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha3")]),t._v(": rework mapping structure in various ways")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha2")]),t._v(": rename Budget Data Package to Fiscal Data Package")]),t._v(" "),e("li",[e("code",[t._v("0.3.0-alpha")]),t._v(": very substantial rework of spec to use “mapping” approach between physical and logical model. Core framework, based on Tabular Data Package, is unchanged.")]),t._v(" "),e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package/0.2/"}},[e("code",[t._v("0.2.0")])]),t._v(": large numbers of changes and clarifications for particular fields but no substantive change to the overall spec")],1),t._v(" "),e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package/0.1/"}},[e("code",[t._v("0.1.0")])]),t._v(": first complete version of the specification")],1)]),t._v(" "),e("p",[t._v("[toc]")]),t._v(" "),e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("This document contains the “Fiscal Data Package” specification - a lightweight and user-oriented format for publishing and consuming fiscal data.")]),t._v(" "),e("p",[t._v("The motivation behind the fiscal data package was to create a specification which is "),e("em",[t._v("open by nature")]),t._v(" - based on other open standards, supported by open tools and software, modular, extensible and promoted transparently by a large community.")]),t._v(" "),e("p",[t._v("It is designed to be lightweight and simple to use - providing a small but flexible set of features, based on real-world requirements and not theoretical ones. All the while, the built-in extensibility allows this spec to adapt to many different use cases and domains. It is also possible to gradually use more and more part of this specification - thus making it easier to implement this spec with existing data while slowly improving the data quality.")]),t._v(" "),e("p",[t._v("A main concern of this specification is the ability to work with data "),e("em",[t._v("as it is currently exists")]),t._v(", without forcing publishers to modify the contents or structure of their current data files in order to “adapt” them to the specification.")]),t._v(" "),e("p",[t._v("It concerns with how fiscal data should be packaged and providing means for publishers to best convey the meaning of the data - so it can be optimally used by consumers. This specification also provides details regarding file-formats, data-types, meta-data and structuring the data in files.")]),t._v(" "),e("p",[t._v("On the other hand, this specification is, "),e("em",[t._v("by design")]),t._v(", non-opinionated about which data "),e("em",[t._v("should")]),t._v(" be published by publishers - which data-sets, which fields and and the internal processes these reflect.")]),t._v(" "),e("p",[t._v("Alongside this specification are two fiscal taxonomies which serve as standards for publishing "),e("em",[t._v("budget")]),t._v(" files and "),e("em",[t._v("spending")]),t._v(" files. These can be found here:")]),t._v(" "),e("ul",[e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package--budgets/"}},[t._v("The Budget Fiscal Data Package Standard")])],1),t._v(" "),e("li",[e("RouterLink",{attrs:{to:"/fiscal-data-package--spending/"}},[t._v("The Spending Fiscal Data Package Standard")])],1)]),t._v(" "),e("h3",{attrs:{id:"lessons-learned-from-v0-3-of-this-spec"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#lessons-learned-from-v0-3-of-this-spec"}},[t._v("#")]),t._v(" Lessons learned from v0.3 of this spec")]),t._v(" "),e("p",[t._v("Via a wide range of technical implementation, partner piloting, and fiscal data projects with other civic tech and data journalist partners, we’ve learned a lot about what works in Fiscal Data package v0.3, and what does not. We want to take these learnings and make a more robust and future proof v1.0 of the specification.")]),t._v(" "),e("h4",{attrs:{id:"modelling"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modelling"}},[t._v("#")]),t._v(" Modelling")]),t._v(" "),e("p",[t._v("Version 0.3 of the spec contained an elaborate system for modelling of the fiscal data. In practice, this system turned out to be too complicated for normal users and error prone (as inconsistent modelling could be created).")]),t._v(" "),e("p",[t._v("To add to that, modelling was not versatile enough to account for the very different source files existing with real users, nor was it expressive enough to convey the specific semantics required by these users.")]),t._v(" "),e("p",[t._v("A few examples of this strictness includes:")]),t._v(" "),e("ul",[e("li",[t._v("The predefined set of classifications for dimensions. This hard-coded list did not capture the richness of fiscal data ‘in the wild’, as it contained too few and too broad options.")]),t._v(" "),e("li",[t._v("Measure columns were assumed to be of a specific currency, disregarding datasets in which the currency is provided in a separate column (or non monetary measures).")]),t._v(" "),e("li",[t._v("Measure columns were assumed to be of a specific budgeting phase (out of 4 options) and of a single direction (income/expenditure), ignoring data sets which have different phases, or that the phase or direction are provided in a separate column - or data sets which are not related to budgets altogether…")])]),t._v(" "),e("h4",{attrs:{id:"file-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#file-structure"}},[t._v("#")]),t._v(" File structure")]),t._v(" "),e("p",[t._v("While machines will always prefer to read data files in their denormalised (or unpivoted) form - as it’s the most verbose and straightforward one - publishers will often choose a more compact, pivoted form. Other publishers would take out from the file some of the data, and append it as a separate code list file.")]),t._v(" "),e("p",[t._v("Version 0.3 of the spec assumed data files would only be provided in a very specific pivoted form - which might apply to some cases, but practically failed on many other pivoting variations that were encountered.")]),t._v(" "),e("h3",{attrs:{id:"what-s-different"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-s-different"}},[t._v("#")]),t._v(" What’s different?")]),t._v(" "),e("p",[t._v("In a nutshell, the notable changes from v0.3 to v1 are as follows:")]),t._v(" "),e("ul",[e("li",[t._v("Consistent usage of “fiscal concepts” to model fiscal data (i.e. "),e("em",[t._v("ColumnTypes")]),t._v("), instead of the mix of metadata properties, measures and dimensions in v0.3 (all concepts are either a measure or a dimension)")]),t._v(" "),e("li",[t._v("The representation of concepts on data resources, instead of on a distinct "),e("code",[t._v("model")]),t._v(" property")]),t._v(" "),e("li",[t._v("Improve implementation and semantics around direction and phase")]),t._v(" "),e("li",[t._v("Have explicit recommendations on the desirable concepts for given types of fiscal data (budget, spend, etc.)")]),t._v(" "),e("li",[t._v("Update to be based on Tabular Data Package v1")])]),t._v(" "),e("h2",{attrs:{id:"terminology"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#terminology"}},[t._v("#")]),t._v(" Terminology")]),t._v(" "),e("h3",{attrs:{id:"what-is-fiscal-data"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-fiscal-data"}},[t._v("#")]),t._v(" What is Fiscal Data?")]),t._v(" "),e("p",[t._v("In the context of this specification, we will define a fiscal dataset, at its core, to be one providing information on a series of fiscal transactions.")]),t._v(" "),e("p",[t._v("Each of these transactions consists of the following concepts:")]),t._v(" "),e("ul",[e("li",[t._v("The "),e("em",[t._v("source")]),t._v(" of the transaction")]),t._v(" "),e("li",[t._v("The "),e("em",[t._v("recipient")]),t._v(" of the transaction")]),t._v(" "),e("li",[e("em",[t._v("When")]),t._v(" the transaction occurred")]),t._v(" "),e("li",[t._v("A single "),e("em",[t._v("amount")]),t._v(" of money (or equivalent) that was transferred in the transaction")]),t._v(" "),e("li",[t._v("Other properties describing the transaction")])]),t._v(" "),e("p",[t._v("These concepts must appear in all fiscal data - there is no transaction without knowing who gave how much money, to whom and when. However, in some cases, the transactions are aggregated - either because the exact recipient is not known yet (which is usually the case when planning a budget) or because it’s preferable to present data aggregated over a period of time (usually a single fiscal year).")]),t._v(" "),e("p",[t._v("In aggregated data sets, you would find only a subset of these concepts. For example, a planned budget file would aggregate transactions over a period of a fiscal year, indicating the source of the transaction and its amount but without specifying the exact recipients (which are still unknown at the time of planning).")]),t._v(" "),e("p",[t._v("Properties describing the transaction could be:")]),t._v(" "),e("ul",[e("li",[t._v("Unique identifiers of the transaction")]),t._v(" "),e("li",[t._v("Classifications of sorts, providing context for the source of the money or what is its purpose")]),t._v(" "),e("li",[t._v("Details regarding the procurement or budgeting process related to the amount (e.g. allocated vs. executed budgeting phase)")]),t._v(" "),e("li",[t._v("Information regarding the mechanism used to transfer the money")]),t._v(" "),e("li",[t._v("Description of the amount itself - currency, multiplication factor")])]),t._v(" "),e("p",[t._v("Other properties are naturally possible - all depending on the actual financial systems that are involved in the transaction.")]),t._v(" "),e("h4",{attrs:{id:"example"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),e("p",[t._v("We’ll demonstrate the theoretical concepts with a concrete example - the Smith Family Fiscal Data.")]),t._v(" "),e("p",[t._v("On September 30th, the family gathered and decided on a budget for the upcoming week:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Week")]),t._v(" "),e("th",[t._v("ID")]),t._v(" "),e("th",[t._v("Buyer")]),t._v(" "),e("th",[t._v("Purpose")]),t._v(" "),e("th",[t._v("Payment Method")]),t._v(" "),e("th",[t._v("Planned Amount")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$100")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Books")]),t._v(" "),e("td",[t._v("Paypal Account")]),t._v(" "),e("td",[t._v("$15")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Shop Gift Card")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Fuel")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$40")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("Marty")]),t._v(" "),e("td",[t._v("Candy")]),t._v(" "),e("td",[t._v("Allowance - Cash")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Taxes")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("p",[t._v("In this example we can see most of the concepts we’d often see in budget files:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("Week")]),t._v(" is the "),e("em",[t._v("Fiscal Period")])]),t._v(" "),e("li",[e("em",[t._v("Buyer")]),t._v(" serves as the "),e("em",[t._v("Administrative Classification")])]),t._v(" "),e("li",[e("em",[t._v("Purpose")]),t._v(" would be the "),e("em",[t._v("Functional Classification")])]),t._v(" "),e("li",[e("em",[t._v("Payment Method")]),t._v(" is the "),e("em",[t._v("Economic Classification")])]),t._v(" "),e("li",[t._v("and the "),e("em",[t._v("Amount")]),t._v(" is, naturally, the budgeted amount.")])]),t._v(" "),e("p",[t._v("This above data table is an example of an "),e("em",[t._v("aggregated data set")]),t._v(". We don’t see individual purchases, but rather a plan of the purchases over the week, summed according to purpose, buyer and purchase method.")]),t._v(" "),e("p",[t._v("When the week ended, the family gathered once again and reviewed the actual spending that took place during that week:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Date")]),t._v(" "),e("th",[t._v("Budget ID")]),t._v(" "),e("th",[t._v("Item")]),t._v(" "),e("th",[t._v("Where")]),t._v(" "),e("th",[t._v("Amount")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1/2")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("30L Fuel")]),t._v(" "),e("td",[t._v("Gas Station")]),t._v(" "),e("td",[t._v("$15.5")])]),t._v(" "),e("tr",[e("td",[t._v("1/2")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("Housing Tax")]),t._v(" "),e("td",[t._v("City Hall")]),t._v(" "),e("td",[t._v("$20")])]),t._v(" "),e("tr",[e("td",[t._v("2/2")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("Shirts")]),t._v(" "),e("td",[t._v("Mall")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("2/2")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("Trousers")]),t._v(" "),e("td",[t._v("Mall")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("3/2")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("Groceries")]),t._v(" "),e("td",[t._v("Market")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("4/2")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("31L Fuel")]),t._v(" "),e("td",[t._v("Gas Station")]),t._v(" "),e("td",[t._v("$16.2")])]),t._v(" "),e("tr",[e("td",[t._v("6/2")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("Bubble Gum")]),t._v(" "),e("td",[t._v("Candy Shop")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("7/2")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("28L Fuel")]),t._v(" "),e("td",[t._v("Gas Station")]),t._v(" "),e("td",[t._v("$13.3")])])])]),t._v(" "),e("p",[t._v("We can see that this data provides detailed information about the individual transactions that were made. In our example:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("Where")]),t._v(" would be the "),e("em",[t._v("Recipient")]),t._v(" of the transaction, and")]),t._v(" "),e("li",[e("em",[t._v("Item")]),t._v(" would be the "),e("em",[t._v("Purpose")]),t._v(" of the transaction")])]),t._v(" "),e("p",[t._v("Combined with the original budget (using the "),e("em",[t._v("ID")]),t._v(" columns), we can know "),e("em",[t._v("Who")]),t._v(" did each purchase, for what purpose and with which payment method.")]),t._v(" "),e("p",[t._v("We can then aggregate the transactions and get an "),e("em",[t._v("Executed Budget")]),t._v(" data set, which contains both the planned and executed figures for each aggregated row:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Week")]),t._v(" "),e("th",[t._v("ID")]),t._v(" "),e("th",[t._v("Buyer")]),t._v(" "),e("th",[t._v("Purpose")]),t._v(" "),e("th",[t._v("Payment Method")]),t._v(" "),e("th",[t._v("Planned")]),t._v(" "),e("th",[t._v("Executed")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$100")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Books")]),t._v(" "),e("td",[t._v("PayPal Account")]),t._v(" "),e("td",[t._v("$15")]),t._v(" "),e("td",[t._v("$0")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Shop Gift Card")]),t._v(" "),e("td",[t._v("$25")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Fuel")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$40")]),t._v(" "),e("td",[t._v("$45")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("Marty")]),t._v(" "),e("td",[t._v("Candy")]),t._v(" "),e("td",[t._v("Allowance - Cash")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("1-7/Oct")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Taxes")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$20")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("h3",{attrs:{id:"what-is-a-fiscal-data-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-a-fiscal-data-file"}},[t._v("#")]),t._v(" What is a Fiscal Data File?")]),t._v(" "),e("p",[t._v("In the context of this specification, a fiscal data file is a physical representation of fiscal data (as defined above), in a series of computer files.")]),t._v(" "),e("p",[t._v("This representation might consist of a single, denormalised, data-table (with one row per transaction) - or take a more normalised form, spanning multiple, separate tables.")]),t._v(" "),e("p",[t._v("Note: We use the terms ‘normalised’ and ‘denormalised’ in this document quite a bit, so it’s best to take a moment and understand what they mean. In short, a normalised form is a way of structuring data so that redundancy is minimised. A denormalised form has the simplest form but also the most redundant one. More on this can be found in this "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Database_normalization",target:"_blank",rel:"noopener noreferrer"}},[t._v("Wikipedia Page"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("Table columns will hold some property (or properties) of the above concepts - some will hold amounts, some will hold information regarding the recipient etc. As the exact nature of each of these concepts varies greatly by context, the possibilities for properties appearing in a fiscal data file column are also great.")]),t._v(" "),e("p",[t._v("A fiscal data file might contain all information necessary to reconstruct the fiscal data, or it might have some implicit information which is not part of the data. As an example, imagine the following scenarios:")]),t._v(" "),e("ul",[e("li",[t._v("A budget file named ‘2015_budget.csv’, not including the ‘year’ column as it’s already in the file name")]),t._v(" "),e("li",[t._v("A budget file with no ‘year’ column, instead having ‘2017’, ‘2018’, and ‘2019’ columns.")])]),t._v(" "),e("p",[t._v("In these two scenarios, we need to the file’s metadata and augment the actual data records contained in the file - in order to be able to correctly reconstruct the original data.")]),t._v(" "),e("p",[t._v("As with any tabular data, a physical representation of data also includes selection of file formats, data formatting and locale specifics (which are out of scope for this specification and are handled in the Tabular Data Package specification).")]),t._v(" "),e("h4",{attrs:{id:"example-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[t._v("#")]),t._v(" Example")]),t._v(" "),e("p",[t._v("Let’s imagine we asked Lorraine and George to email us their weekly family budget. Although working on the same data set, each took a very different approach as to how to represent the data in an actual data file.")]),t._v(" "),e("p",[t._v("George, which is an accountant, sent us an CSV file named "),e("code",[t._v("week_of_1_7_oct.csv")]),t._v(". The CSV file contained these cells:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Who?")]),t._v(" "),e("th",[t._v("What for?")]),t._v(" "),e("th",[t._v("How?")]),t._v(" "),e("th",[t._v("Plan")]),t._v(" "),e("th",[t._v("Actual")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$100")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Books")]),t._v(" "),e("td",[t._v("Paypal Account")]),t._v(" "),e("td",[t._v("$15")]),t._v(" "),e("td",[t._v("$0")])]),t._v(" "),e("tr",[e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Shop Gift Card")]),t._v(" "),e("td",[t._v("$25")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Clothing")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("Lorraine")]),t._v(" "),e("td",[t._v("Fuel")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$40")]),t._v(" "),e("td",[t._v("$45")])]),t._v(" "),e("tr",[e("td",[t._v("Marty")]),t._v(" "),e("td",[t._v("Candy")]),t._v(" "),e("td",[t._v("Allowance - Cash")]),t._v(" "),e("td",[t._v("$10")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Taxes")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$20")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("p",[t._v("Lorraine, a Data Scientist, took a different approach. In the email that she sent, there were attached 5 different CSV files:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Budget.csv")]),t._v(":")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Week Start")]),t._v(" "),e("th",[t._v("ID")]),t._v(" "),e("th",[t._v("BuyerID")]),t._v(" "),e("th",[t._v("PurposeID")]),t._v(" "),e("th",[t._v("PaymentMethodID")]),t._v(" "),e("th",[t._v("PhaseID")]),t._v(" "),e("th",[t._v("Amount")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P1")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$100")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("1")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P1")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$107.60")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P2")]),t._v(" "),e("td",[t._v("PM2")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$15")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("2")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P2")]),t._v(" "),e("td",[t._v("PM2")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$0")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM3")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.1")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM3")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$25")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("3.2")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$3.8")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P4")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$40")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("4")]),t._v(" "),e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("P4")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$45")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("B3")]),t._v(" "),e("td",[t._v("P5")]),t._v(" "),e("td",[t._v("PM4")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$10")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("5")]),t._v(" "),e("td",[t._v("B3")]),t._v(" "),e("td",[t._v("P5")]),t._v(" "),e("td",[t._v("PM4")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$8")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P6")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("P")]),t._v(" "),e("td",[t._v("$20")])]),t._v(" "),e("tr",[e("td",[t._v("2015-10-01")]),t._v(" "),e("td",[t._v("6")]),t._v(" "),e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("P6")]),t._v(" "),e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("A")]),t._v(" "),e("td",[t._v("$20")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Buyer.csv")]),t._v(":")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("BuyerID")]),t._v(" "),e("th",[t._v("Buyer")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("B1")]),t._v(" "),e("td",[t._v("George")])]),t._v(" "),e("tr",[e("td",[t._v("B2")]),t._v(" "),e("td",[t._v("Lorraine")])]),t._v(" "),e("tr",[e("td",[t._v("B3")]),t._v(" "),e("td",[t._v("Marty")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Purpose.csv")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("PurposeID")]),t._v(" "),e("th",[t._v("Purpose")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("P1")]),t._v(" "),e("td",[t._v("Food")])]),t._v(" "),e("tr",[e("td",[t._v("P2")]),t._v(" "),e("td",[t._v("Books")])]),t._v(" "),e("tr",[e("td",[t._v("P3")]),t._v(" "),e("td",[t._v("Clothing")])]),t._v(" "),e("tr",[e("td",[t._v("P4")]),t._v(" "),e("td",[t._v("Fuel")])]),t._v(" "),e("tr",[e("td",[t._v("P5")]),t._v(" "),e("td",[t._v("Candy")])]),t._v(" "),e("tr",[e("td",[t._v("P6")]),t._v(" "),e("td",[t._v("Taxes")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("PaymentMethod.csv")]),t._v(":")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("PaymentMethodID")]),t._v(" "),e("th",[t._v("Payment Method")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("PM1")]),t._v(" "),e("td",[t._v("Credit Card")])]),t._v(" "),e("tr",[e("td",[t._v("PM2")]),t._v(" "),e("td",[t._v("PayPal Account")])]),t._v(" "),e("tr",[e("td",[t._v("PM3")]),t._v(" "),e("td",[t._v("Shop Gift Card")])]),t._v(" "),e("tr",[e("td",[t._v("PM4")]),t._v(" "),e("td",[t._v("Allowance - Cash")])])])]),t._v(" "),e("ul",[e("li",[e("code",[t._v("Phase.csv")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("PhaseID")]),t._v(" "),e("th",[t._v("Phase")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("P")]),t._v(" "),e("td",[t._v("Planned")])]),t._v(" "),e("tr",[e("td",[t._v("A")]),t._v(" "),e("td",[t._v("Actual")])])])]),t._v(" "),e("p",[e("em",[e("strong",[t._v("How is Lorraine’s method different from Georges’?")])])]),t._v(" "),e("ol",[e("li",[t._v("We can see that Lorraine’s method has far less data duplication - all field values are mapped to unique identifiers and the full names are detailed in separate, smaller tables.")]),t._v(" "),e("li",[t._v("Another observation is that there is only one single amount column. The distinction between the two amount columns ("),e("em",[t._v("Planned")]),t._v(" and "),e("em",[t._v("Actual")]),t._v(") was transformed into a new "),e("em",[t._v("Phase")]),t._v(" column.")]),t._v(" "),e("li",[t._v("Unlike George’s file, Lorraine has all the required information as part of the data - specifically, the time period has its own column and is not only mentioned in the name of the sheet")]),t._v(" "),e("li",[t._v("Finally, Lorraine chose a more common way of presenting the date - using the ISO standard YYYY-MM-DD format.")])]),t._v(" "),e("h3",{attrs:{id:"what-is-the-fiscal-data-package"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-the-fiscal-data-package"}},[t._v("#")]),t._v(" What is the Fiscal Data Package?")]),t._v(" "),e("p",[t._v("A Fiscal Data Package is a means to "),e("em",[t._v("describe")]),t._v(" an existing fiscal data file so that data can be consistently and accurately extracted into its logical representation, without the need for any external assumptions or preconditions.")]),t._v(" "),e("p",[t._v("A rich taxonomy of fiscal concepts ("),e("em",[t._v("ColumnTypes")]),t._v(") allows these descriptors to provide some "),e("em",[t._v("meaning")]),t._v(" to the resulting data. The different columns in the data are mapped into common, generic fiscal concepts which allow users of the data to understand it without having to understand the very specifics of the financial system that produced it. Furthermore, users are allowed to extend that taxonomy in a way that allows them to provide these context specific details while still keeping the mapping to a common concept.")]),t._v(" "),e("h4",{attrs:{id:"example-1-george-s-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-1-george-s-file"}},[t._v("#")]),t._v(" Example 1 - George’s file")]),t._v(" "),e("p",[t._v("We’ll go over the concepts of the Fiscal Data Package via a few examples.")]),t._v(" "),e("p",[t._v("First, we shall model George’s file from the previous section.")]),t._v(" "),e("p",[t._v("The Fiscal Data Package is an extension of a Tabular Data Package, so our output should be a valid "),e("code",[t._v("datapackage.json")]),t._v(" file - the data package descriptor:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"smith-budget-by-george"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Smith Family Budget (George\'s version)"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("We start by providing a little metadata for the entire dataset…")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"budget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"week_of_1_7_oct.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("And then some metadata on the resource itself."),e("br"),t._v("\nNow we describe the different columns in the file:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Who?"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"administrative-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("The first column is the “Who?” column - the administrative classification in our example dataset. We state that the column is of a "),e("em",[t._v("string")]),t._v(" type and we provide a proper "),e("em",[t._v("ColumnType")]),t._v(" to state that this is an "),e("em",[t._v("Administrative Classification Code")]),t._v(" (more on ColumnTypes later on).")]),t._v(" "),e("p",[t._v("We now continue to model the rest of the fields:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"What for?"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"functional-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"How?"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"economic-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally we want to handle the amounts - also known as ‘measures’: ‘Plan’ and ‘Actual’. How do we represent correctly the difference between the two?")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Plan"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"bareNumber"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Plan"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Actual"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"bareNumber"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Actual"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Although both planned and actual values appear in the same row, each one of them is, in fact, a separate data point. Conceptually, we could imagine a new table where each row is converted into two rows, for example")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("George")]),t._v(" "),e("th",[t._v("Food")]),t._v(" "),e("th",[t._v("Credit Card")]),t._v(" "),e("th",[t._v("$100")]),t._v(" "),e("th",[t._v("$107.60")])])]),t._v(" "),e("tbody")]),t._v(" "),e("p",[t._v("Would be converted to")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("George")]),t._v(" "),e("th",[t._v("Food")]),t._v(" "),e("th",[t._v("Credit Card")]),t._v(" "),e("th",[t._v("$100")]),t._v(" "),e("th",[t._v("Plan")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("George")]),t._v(" "),e("td",[t._v("Food")]),t._v(" "),e("td",[t._v("Credit Card")]),t._v(" "),e("td",[t._v("$107.60")]),t._v(" "),e("td",[t._v("Actual")])])])]),t._v(" "),e("p",[t._v("So that we’re left with just one “measure” and an extra “phase” column.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("normalize")]),t._v(" attribute does exactly that - and it works together with the "),e("code",[t._v("extraField")]),t._v(" property which declares all the columns which are not part of the physical source file:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Amount"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalizationTarget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("true")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("The first extra field is the normalisation target."),e("br"),t._v("\nBoth amounts (from ‘Plan’ and ‘Actual’) will be placed here. Notice we gave this column the "),e("code",[t._v("value")]),t._v(" ColumnType, denoting it as a value (or a "),e("em",[t._v("“Measure”")]),t._v(").")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase:id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("The second extra field will hold the “phase” - based on the values in the "),e("code",[t._v("normalize")]),t._v(" property in the table schema fields."),e("br"),t._v("\nWhen denormalising, these two extra fields should replace the existing ‘Plan’ and ‘Actual’ columns.")]),t._v(" "),e("p",[t._v("Finally, we want to move the “fiscal period” from the filename to a proper column in the data itself. We do that by declaring a “constant” field. While we’re at it we also add a proper currency column - just in case the Smith’s decide one day to open an offshore bank account.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Week Start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:fiscal:activity-start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1/10/2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"%d/%m/%Y"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Currency"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value-currency:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h4",{attrs:{id:"example-2-lorraine-s-file"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-2-lorraine-s-file"}},[t._v("#")]),t._v(" Example 2 - Lorraine’s file")]),t._v(" "),e("p",[t._v("Let’s model Lorraine’s file now.")]),t._v(" "),e("p",[t._v("We’ll start with the same metadata:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"smith-budget-by-lorraine"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Smith Family Budget (Lorraine\'s version)"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("And then we start describing the different resources - in Lorraine’s case, we’ve got 5 of them."),e("br"),t._v("\nThe first one is the “buyer” table:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"buyer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Buyer.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Buyer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"administrative-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("This resource is pretty simple - we have only two columns, one of which is an identifier and the other is the actual buyer - which we mapped to a proper fiscal concept ("),e("em",[t._v("Administrative Classification")]),t._v(").")]),t._v(" "),e("p",[t._v("Let’s map a few more resources - these are pretty much the same:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purpose"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Purpose.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Purpose"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"functional-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"payment_method"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethod.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Payment Method"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"economic-classification:generic:code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Phase.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase:id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally we tie all of these resources together into the main table (also known as the “facts table” - the “fact” in our case being a single transaction or budget item):")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"budget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"path"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Budget.csv"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Week Start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:fiscal:activity-start"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"%Y-%m-%d"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"budget-line-id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerId"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Amount"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"bareNumber"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("false")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Now, let’s use the magic of "),e("RouterLink",{attrs:{to:"/table-schema/#foreign-keys"}},[t._v("foreign keys")]),t._v(" to connect the main table to all the secondary tables:")],1),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"foreignKeys"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"buyer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BuyerID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purpose"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PurposeID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"payment_method"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PaymentMethodID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"reference"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resource"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PhaseID"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally, all is left is to add the currency column (as in George’s file) and to wrap up.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Currency"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value-currency:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h2",{attrs:{id:"the-fiscal-data-package-descriptor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-fiscal-data-package-descriptor"}},[t._v("#")]),t._v(" The Fiscal Data Package Descriptor")]),t._v(" "),e("h3",{attrs:{id:"overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),e("p",[t._v("The Fiscal Data Descriptor is a fully-compatible extension of the Tabular Data Package specification (i.e., any fiscal data package should be fully readable by any tabular data package compatible software).")]),t._v(" "),e("p",[t._v("The purpose of this extension is to provide a domain specific modelling of a fiscal dataset.")]),t._v(" "),e("p",[t._v("There are quite a few motivations for such modelling:")]),t._v(" "),e("ul",[e("li",[t._v("Allowing fiscal data consumers to better understand the actual fiscal concept each column in the data set refers to")]),t._v(" "),e("li",[t._v("Provide means to re-structure the data in a predictable form: normalised, denormalised or other")]),t._v(" "),e("li",[t._v("Enabling smart and contextual comparisons of different datasets from different sources")])]),t._v(" "),e("p",[t._v("However, "),e("strong",[t._v("by design")]),t._v(", all parts of this extension are optional. In other words, the extent of modelling provided by the publisher of a fiscal data package is fully flexible and could range from the simple case of a tabular data package (with no modelling) - all through to a fully modelled dataset.")]),t._v(" "),e("p",[t._v("It is left to the implementors to place any restrictions, if any, on the minimal level of modelling that they require or on how to treat missing parts of the model (e.g. ignore, infer etc.)")]),t._v(" "),e("h3",{attrs:{id:"fiscal-modelling"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#fiscal-modelling"}},[t._v("#")]),t._v(" Fiscal Modelling")]),t._v(" "),e("p",[t._v("This specification allows modelling of fiscal data in two distinct levels: the structural level and the semantic level.")]),t._v(" "),e("p",[e("strong",[t._v("Structural Level")])]),t._v(" "),e("p",[t._v("We want to properly describe the structure of a dataset - so that data consumers are able to restructure the dataset based on their own needs and requirements.")]),t._v(" "),e("p",[t._v("The method for describing a dataset’s structure is to detail the difference between the provided form a dataset to its fully denormalised form. Essentially we’re listing a set of transformations, that when applied, would convert the dataset from the former to the latter.")]),t._v(" "),e("p",[t._v("Using the knowledge of how the denormalised data looks like, consumers can then better understand how to read, store or otherwise manipulate the data so it fits their existing systems and processes.")]),t._v(" "),e("p",[t._v("A denormalised presentation of a data set needs to fulfill these conditions:")]),t._v(" "),e("ul",[e("li",[t._v("all data is contained in a single data table")]),t._v(" "),e("li",[t._v("each row contains just one single data point with a single value")]),t._v(" "),e("li",[t._v("all data and metadata is provided within the data table")])]),t._v(" "),e("p",[t._v("The specification provides 3 possible transformations that might be used to describe how the dataset could be denormalised:")]),t._v(" "),e("ol",[e("li",[e("em",[t._v("Foreign Keys")]),t._v(" - connect separate data tables via an ID column present in both tables. This method is already part of the Tabular Data Package specification and will not be covered here.")]),t._v(" "),e("li",[e("em",[t._v("Denormalising Measures")]),t._v(" - convert a row with multiple measures in the source data into multiple rows, each with a single value.")]),t._v(" "),e("li",[e("em",[t._v("Constant Fields")]),t._v(" - represent metadata as constant columns in the data table")])]),t._v(" "),e("p",[e("strong",[t._v("Semantic Mapping")])]),t._v(" "),e("p",[t._v("Semantic mapping is the process of assigning meaning to the data. Basically we want to map each column in the dataset to a “real-world” fiscal concept, so that data consumers have better understanding of the data itself - and the data might be compared to other datasets (which share a semantic similarity).")]),t._v(" "),e("p",[t._v("This specification provides means for mapping each column in the original data (or its denormalised form) onto a fiscal concept, using a taxonomy of "),e("em",[t._v("ColumnTypes")]),t._v(" which cover a wide range of real-world fiscal concepts (and can be easily extended to cover custom cases).")]),t._v(" "),e("h3",{attrs:{id:"the-extrafields-property"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-extrafields-property"}},[t._v("#")]),t._v(" The "),e("code",[t._v("extraFields")]),t._v(" property")]),t._v(" "),e("p",[t._v("The main vehicle for the structural modelling is the "),e("code",[t._v("extraFields")]),t._v(" property - a property added to a tabular resource schema (as a sibling to the "),e("code",[t._v("fields")]),t._v(" property), similarly containing field definitions.")]),t._v(" "),e("p",[t._v("All the fields that are listed in the "),e("code",[t._v("extraFields")]),t._v(" property are ones that appear in the denormalised form but not on the original data. The contents of these columns is derived from the dataset itself (or from the descriptor). Each of these fields there also specifies how their content relates to the original dataset.")]),t._v(" "),e("h3",{attrs:{id:"denormalising-measures"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#denormalising-measures"}},[t._v("#")]),t._v(" Denormalising Measures")]),t._v(" "),e("p",[t._v("In many cases, publishers will prefer to have Approved, Modified and Executed values of a budget as separate columns, instead of duplicating the same line just to provide 3 figures. It is more readable to humans and more concise (i.e. creates a smaller file size).")]),t._v(" "),e("p",[t._v("In other cases, the budget figures for the current, next and after next years will appear as separate columns instead of in separate rows. This allows readers to more easily compare the budget figures across consecutive years.")]),t._v(" "),e("p",[t._v("In fact, we might even encounter data-set where both phase and year columns were reduced in the same way.")]),t._v(" "),e("p",[t._v("This practice is very common as a simple form of normalisation being done on a published dataset. However, some data is lost along the way - in our examples, we’ve lost the ‘Budget Phase’ column in the former, and ‘Fiscal Year’ column in the latter.")]),t._v(" "),e("p",[t._v("We want to describe this process to allow data consumers to potentially undo it - and to the least resurrect the data that was lost in the process.")]),t._v(" "),e("p",[t._v("In order to do so we need to:")]),t._v(" "),e("ul",[e("li",[t._v("Add to the "),e("code",[t._v("extraFields")]),t._v(" property a field definition for each column that was reduced (budget phase or fiscal year in our scenario), for example:")])]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[t._v("We add a "),e("code",[t._v("normalize")]),t._v(" property to "),e("em",[t._v("each")]),t._v(" measure in the schema. The value of this property is a mapping between "),e("em",[t._v("every")]),t._v(" ‘reduced column’ name to a value, for example:")])]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"schema"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"fields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Approved 2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"approved"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2015")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Executed 2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"executed"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2015")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Approved 2016"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"approved"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2016")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Executed 2016"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalize"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Budget Phase"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"executed"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"Fiscal Year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2016")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n")])])]),e("ul",[e("li",[t._v("Finally we add to the "),e("code",[t._v("extraFields")]),t._v(" property a field definition for the target column for the measures’ values, like so:")])]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Fiscal Amount"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"normalizationTarget"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("true")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("h3",{attrs:{id:"constant-fields"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#constant-fields"}},[t._v("#")]),t._v(" Constant Fields")]),t._v(" "),e("p",[t._v("In order to complement missing information in the dataset it’s possible to add columns with ‘constant’ values to the schema.")]),t._v(" "),e("p",[t._v("We can do so by adding field definitions to the "),e("code",[t._v("extraFields")]),t._v(" property. Each of these field objects must also contain a "),e("code",[t._v("constant")]),t._v(" property, holding the constant value.")]),t._v(" "),e("p",[t._v("Provided value might be provided either in its logical representation or its physical representation.")]),t._v(" "),e("p",[t._v("Examples:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"extraFields"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A String"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a value"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A Number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Another Number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5,4"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"decimalChar"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('","')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A Date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10/1/2015"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"%m/%d/%Y"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"An Array"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"array"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[3.14, 2.78]"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Last Example"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"array"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"constant"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.14")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.78")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("h3",{attrs:{id:"columntypes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#columntypes"}},[t._v("#")]),t._v(" ColumnTypes")]),t._v(" "),e("p",[t._v("The "),e("em",[t._v("ColumnType")]),t._v(" taxonomy provides many common properties of fiscal concepts which appear as columns in many different fiscal data files.")]),t._v(" "),e("p",[t._v("When describing a fiscal data file, each column in a fiscal data file must be mapped to a single "),e("em",[t._v("ColumnType")]),t._v(" (Unmapped columns should simply be ignored).")]),t._v(" "),e("p",[t._v("By inspecting the different "),e("em",[t._v("ColumnTypes")]),t._v(" of the different columns in a file, one might get a good understanding of the meaning of each column and how different columns relate to one another.")]),t._v(" "),e("h4",{attrs:{id:"columntype-hierarchy-tree"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#columntype-hierarchy-tree"}},[t._v("#")]),t._v(" ColumnType Hierarchy Tree")]),t._v(" "),e("p",[e("em",[t._v("ColumnTypes")]),t._v(" are hierarchic: starting from very generic concepts at the root of the taxonomy (time, source, recipient, amount etc.), down to more and more specific concepts (via inheritance) - each one specialising its parent concept with a more fine-grained meaning.")]),t._v(" "),e("p",[t._v("The names of the "),e("em",[t._v("ColumnTypes")]),t._v(" represent that hierarchy. Each new level of the hierarchy is appended to the "),e("em",[t._v("ColumnType")]),t._v(" name, separated by colons.")]),t._v(" "),e("p",[t._v("For example, the "),e("code",[t._v("activity:generic:project:code")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" is a non-specific project code. It’s part of the “activity” fiscal concept (i.e. which activity is funded), describes a “project” (which is one kind of activity - others might be “program” or “contract”) and specifically targets the unique project code (and not its name, description or other property).")]),t._v(" "),e("h4",{attrs:{id:"columntype-basic-properties"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#columntype-basic-properties"}},[t._v("#")]),t._v(" ColumnType Basic Properties")]),t._v(" "),e("p",[t._v("Each "),e("em",[t._v("ColumnType")]),t._v(" in the taxonomy can also have the following properties:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("dataType")]),t._v(": a "),e("code",[t._v("tableschema")]),t._v(" type."),e("br"),t._v("\nThis property states that columns with this "),e("em",[t._v("ColumnType")]),t._v(" must also have this data type. For example, the "),e("code",[t._v("date:fiscal-year")]),t._v(" column type (denoting a Fiscal Year) must always be mapped to a column with the "),e("code",[t._v("integer")]),t._v(" data type.")]),t._v(" "),e("li",[e("code",[t._v("unique")]),t._v(": boolean (default: false)"),e("br"),t._v("\nMapping a column to a "),e("em",[t._v("ColumnType")]),t._v(" which has "),e("code",[t._v("unique")]),t._v(" set to true, means that this column should be considered as part of the “primary key” of the table."),e("br"),t._v("\nFor example, the "),e("code",[t._v("transaction-id")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" has the "),e("code",[t._v("unique")]),t._v(" property set.")]),t._v(" "),e("li",[e("code",[t._v("labelOf")]),t._v(": a "),e("code",[t._v("unique")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" name"),e("br"),t._v("\nWhen a column contains labels for another column (usually containing codes), we will indicate this relationship using the "),e("code",[t._v("labelOf")]),t._v(" property. This tells readers of the file that the “label” column contains display-names for the values of the “code” column.")])]),t._v(" "),e("p",[t._v("Now for a few examples. We start with the "),e("em",[t._v("type definition")]),t._v(" of the fiscal year concept from above - a column of the "),e("code",[t._v("date:fiscal-year")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" must have an "),e("code",[t._v("integer")]),t._v(" type and be part of the primary key of the schema:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:fiscal-year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unique"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Similarly, this is the definition for a generic country code, the "),e("code",[t._v("geo:address:country:code")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unique"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("The main difference here is the data type - country codes are "),e("code",[t._v("string")]),t._v("s.")]),t._v(" "),e("p",[t._v("If we have in our dataset not only the country code but also the name of the country, we might consider using the "),e("code",[t._v("geo:address:country:label")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:label"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"labelOf"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Notice how this "),e("em",[t._v("ColumnType")]),t._v(" declares that it’s the label of another type ("),e("code",[t._v("geo:address:country:code")]),t._v("). It’s also not marked as unique, so it should not be a part of the schema’s primary field.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("labelOf")]),t._v(" relationship might be used by implementors to choose which columns should be used for filtering a data set (usually the “codes”) and which columns should be used for the filtering options that will be shown to users (usually the “labels”).")]),t._v(" "),e("p",[t._v("Note: while not strictly enforced, mapping columns to “label” "),e("em",[t._v("ColumnTypes")]),t._v(" without their “code” counterparts should be avoided.")]),t._v(" "),e("h4",{attrs:{id:"composite-column-types"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#composite-column-types"}},[t._v("#")]),t._v(" Composite Column Types")]),t._v(" "),e("p",[e("em",[t._v("ColumnTypes")]),t._v(" can be composite - for example, an "),e("code",[t._v("address")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(" can be inherited by the "),e("code",[t._v("address:city")]),t._v(", "),e("code",[t._v("address:street")]),t._v(" and "),e("code",[t._v("address:street-number")]),t._v(" "),e("em",[t._v("ColumnTypes")]),t._v(". All of these, together, compose an "),e("em",[t._v("address")]),t._v(".")]),t._v(" "),e("p",[t._v("Composite "),e("em",[t._v("ColumnTypes")]),t._v(" might also have an inherent order - for example, a multi-level classification of a budget line. In this case, the "),e("em",[t._v("ColumnTypes")]),t._v(" for the 1st and 2nd levels of that classification will both inherit from the classification’s "),e("em",[t._v("ColumnType")]),t._v(", and the 2nd level "),e("em",[t._v("ColumnType")]),t._v(" will contain a "),e("code",[t._v("prior")]),t._v(" property, pointing to the 1st level "),e("em",[t._v("ColumnType")]),t._v(".")]),t._v(" "),e("p",[t._v("As an example, consider the non-specific administrative classification "),e("em",[t._v("ColumnType")]),t._v(", "),e("code",[t._v("administrative-classification:generic")]),t._v(". In most cases, this classification is multi-leveled, e.g. the first level might indicate a ministry, the second a department in that ministry and so on.")]),t._v(" "),e("p",[t._v("Therefore, columns describing the first level of that classification should be mapped to "),e("em",[t._v("ColumnTypes")]),t._v(" inheriting from "),e("code",[t._v("administrative-classification:generic:level1")]),t._v(". The column containing the code of the ministry (in our example) would be mapped to "),e("code",[t._v("administrative-classification:generic:level1:code")]),t._v(", while the name of the ministry would be mapped to "),e("code",[t._v("administrative-classification:generic:level1:label")]),t._v(".")]),t._v(" "),e("p",[t._v("Same goes for the department code and name columns, which would be mapped to the "),e("code",[t._v("administrative-classification:generic:level2:code")]),t._v(" and "),e("code",[t._v("administrative-classification:generic:level2:label")]),t._v(" "),e("em",[t._v("ColumnTypes")]),t._v(" respectively.")]),t._v(" "),e("p",[t._v("To indicate the connection between these two levels, we would add a "),e("code",[t._v("prior")]),t._v(" property to the "),e("code",[t._v("administrative-classification:generic:level2:code")]),t._v(" type, with a value of "),e("code",[t._v("administrative-classification:generic:level1:code")]),t._v(".")]),t._v(" "),e("p",[t._v("Then, when fetching the unique identifier for the administrative classification for a specific row, we would simply collect all values from columns with "),e("em",[t._v("ColumnTypes")]),t._v(" inheriting from "),e("code",[t._v("administrative-classification")]),t._v(" having "),e("code",[t._v("unique=true")]),t._v(", ordered using the values of the "),e("code",[t._v("prior")]),t._v(" property.")]),t._v(" "),e("p",[t._v("It is not required to map columns to all levels of a composite "),e("em",[t._v("ColumnType")]),t._v(". For example, consider a Geographic Classification system: Country > State > Region > County > City. It’s possible to map column just to the Country and City levels of the classification. Order is still maintained and missing levels are simply ignored.")]),t._v(" "),e("p",[t._v("As an example for using the "),e("code",[t._v("prior")]),t._v(" property, let’s consider this "),e("em",[t._v("phone number")]),t._v(" example:")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:country-code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:national-prefix"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prior"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:country-code"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:number"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prior"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:national-prefix"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:extension"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"prior"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recipient:phone-number:number"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("The "),e("code",[t._v("recipient:phone-number")]),t._v(" concept is composed out of 4 parts: "),e("code",[t._v("country-code")]),t._v(", "),e("code",[t._v("national-prefix")]),t._v(", "),e("code",[t._v("number")]),t._v(" and "),e("code",[t._v("extension")]),t._v(".")]),t._v(" "),e("p",[t._v("When displaying the phone number, we use the "),e("code",[t._v("prior")]),t._v(" relationship to define exactly in which order to show them - so that "),e("code",[t._v("number")]),t._v(" never appears before "),e("code",[t._v("country-code")]),t._v(".")]),t._v(" "),e("p",[t._v("We also don’t need to have all these concepts present in a data-set to be able to set the order between them - for example, we might have a file without a "),e("code",[t._v("country-code")]),t._v(" (as all numbers are local), without a "),e("code",[t._v("national-prefix")]),t._v(" (because "),e("code",[t._v("number")]),t._v(" already contains that) or without an "),e("code",[t._v("extension")]),t._v(". In any of these cases we are still able to make out the correct order of the remaining concepts.")]),t._v(" "),e("h4",{attrs:{id:"custom-columntypes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#custom-columntypes"}},[t._v("#")]),t._v(" Custom ColumnTypes")]),t._v(" "),e("h5",{attrs:{id:"implicit-typing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implicit-typing"}},[t._v("#")]),t._v(" Implicit typing")]),t._v(" "),e("p",[t._v("Custom "),e("em",[t._v("ColumnTypes")]),t._v(" can be used without declaring them in advance.")]),t._v(" "),e("p",[t._v("The properties of each "),e("em",[t._v("ColumnType")]),t._v(" are implicitly derived from other "),e("em",[t._v("ColumnTypes")]),t._v(" based on their name.")]),t._v(" "),e("p",[t._v("For example, recall the "),e("code",[t._v("geo:address:country:label")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:label"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"labelOf"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"geo:address:country:code"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Let’s assume that we have a dataset with country names in English, and another in our local language. To indicate the difference between these columns, we could map the first to the standard "),e("code",[t._v("geo:address:country:label")]),t._v(" "),e("em",[t._v("ColumnType")]),t._v(", and the second to a custom "),e("code",[t._v("geo:address:country:label:localized")]),t._v(".")]),t._v(" "),e("p",[t._v("While the former is a predefined "),e("em",[t._v("ColumnType")]),t._v(" and part of this spec, the latter is not. However, its properties can be deduced - simply by finding an existing "),e("em",[t._v("ColumnType")]),t._v(" whose name is a prefix to its own, and copying its properties.")]),t._v(" "),e("p",[t._v("Therefore, implementations encountering unknown "),e("em",[t._v("ColumnTypes")]),t._v(" should try and deduce their properties by finding another "),e("em",[t._v("ColumnType")]),t._v(" whose name is a prefix to the unknown type’s name - and copying its properties. If more than one such "),e("em",[t._v("ColumnType")]),t._v(" exists, properties should be copied from all of them - with precedence on duplicate property names to be given to the longer prefix.")]),t._v(" "),e("p",[t._v("If such an existing type is not found, then the "),e("em",[t._v("ColumnType")]),t._v(" is still valid - except it won’t have any restrictions on data types, won’t have relationships with the other columns and won’t be part of the schema’s primary key.")]),t._v(" "),e("h5",{attrs:{id:"explicit-typing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#explicit-typing"}},[t._v("#")]),t._v(" Explicit typing")]),t._v(" "),e("p",[t._v("In many cases there might be a need to explicitly define one or more types."),e("br"),t._v("\nIt might be because we’re missing a specific type (which has some specific properties or a relationships to another existing type). It might also be because we want to provide a full taxonomy, better fitting the specific domain which our dataset belongs to.")]),t._v(" "),e("p",[t._v("In these cases, we would attach to the fiscal data package descriptor a “"),e("em",[t._v("ColumnType")]),t._v(" definition package”. This package contains definitions for any "),e("em",[t._v("ColumnType")]),t._v(" that is required to model the data.")]),t._v(" "),e("p",[t._v("The format of the "),e("em",[t._v("ColumnType")]),t._v(" definition package is quite simple - a JSON array, containing "),e("em",[t._v("ColumnType")]),t._v(" definitions as its items, for example:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# From https://www.car-makers-association.org/taxonomy/v1.3/columnTypes.json")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"car:model"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"date:manufacture-year"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("When attached to the fiscal data package descriptor, it can be either attached inline, or as a URL, pointing to a JSON file containing the package.")]),t._v(" "),e("p",[t._v("The top-level "),e("code",[t._v("columnTypes")]),t._v(" property of the fiscal data package descriptor holds one or more "),e("em",[t._v("ColumnType")]),t._v(" definitions or definition packages. It is an array of items, which are interpreted like so:")]),t._v(" "),e("ul",[e("li",[t._v("If the array item is an object, it is interpreted as a single "),e("em",[t._v("ColumnType")]),t._v(" definition.")]),t._v(" "),e("li",[t._v("If the array item is an array, it is interpreted as a "),e("em",[t._v("ColumnType")]),t._v(" definition package.")]),t._v(" "),e("li",[t._v("If the array item is a string, it is interpreted as a URL for a "),e("em",[t._v("ColumnType")]),t._v(" definition package.")])]),t._v(" "),e("p",[t._v("As an example, let’s consider the following dataset containing sales figures for a used car agency:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"biffs-used-car-agency-2017-q1"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"resources"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("So far it’s quite straightforward (we omit the resources section for brevity).")]),t._v(" "),e("p",[t._v("Now we define the "),e("em",[t._v("ColumnTypes")]),t._v(" that are being used in this specification.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"columnTypes"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://specs.frictionlessdata.io/taxonomies/fiscal/budgets.json"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("We start by specifying that we’ll be using the budget taxonomy "),e("em",[t._v("ColumnTypes")]),t._v(", as described "),e("RouterLink",{attrs:{to:"/fiscal-data-package/fiscal-data-package--budgets.html"}},[t._v("here")]),t._v(".")],1),t._v(" "),e("p",[t._v("This is also the default value for this property (in case its omitted in the spec).")]),t._v(" "),e("p",[t._v("We continue by including another taxonomy, from the made-up car makers association (which we saw above). This taxonomy is also added as URL, pointing to version 1.3 of that taxonomy.")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(' "https'),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("//www.car"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v("makers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("-")]),t._v('association.org/taxonomy/v1.3/columnTypes.json"'),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Now we shall add a package inline - with a few car-sale related types:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"salesperson:employee-id"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"unique"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean important"}},[t._v("true")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"salesperson:employee-fullname"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"labelOf"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"salesperson:employee-id"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"owner:previous:name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"owner:new:name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])]),e("p",[t._v("Finally, we can also add a single type as well:")]),t._v(" "),e("div",{staticClass:"language-yaml extra-class"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"owner:previous:is-scientist"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token key atrule"}},[t._v('"dataType"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"boolean"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n")])])])],1)}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/25.ef9b4db4.js b/assets/js/25.93436a0a.js similarity index 98% rename from assets/js/25.ef9b4db4.js rename to assets/js/25.93436a0a.js index f073ac94..22eab9b8 100644 --- a/assets/js/25.ef9b4db4.js +++ b/assets/js/25.93436a0a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{395:function(a,e,t){"use strict";t.r(e);var r=t(26),o=Object(r.a)({},(function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"page-frontmatter-title"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[a._v("#")]),a._v(" "+a._s(a.$page.frontmatter.title))]),a._v(" "),t("p",[a._v(a._s(a.$page.frontmatter.abstract))]),a._v(" "),t("MetadataTable"),a._v(" "),t("h2",{attrs:{id:"language"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[a._v("#")]),a._v(" Language")]),a._v(" "),t("Language"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Different kinds of data need different data and metadata formats. To support these different data and metadata formats we need to extend and specialise the generic Data Package. These specialized types of Data Package (or Data Resource) are termed "),t("strong",[a._v("profiles")]),a._v(". For example, there is a "),t("RouterLink",{attrs:{to:"/tabular-data-package/"}},[a._v("Tabular Data Package")]),a._v(" profile that specializes Data Packages specifically for tabular data.")],1),a._v(" "),t("p",[a._v("Thus, every Package and Resource descriptor has a profile. The namespace for the profile is the type of descriptor, so the default profile, if none is declared, is "),t("code",[a._v("data-package")]),a._v(" for a Package descriptor and "),t("code",[a._v("data-resource")]),a._v(" for a Resource descriptor.")]),a._v(" "),t("p",[a._v("In summary, an extension of Data Package may be formalised as a profile. A profile is a Data Package which extends the default specification towards more specific needs.")]),a._v(" "),t("h3",{attrs:{id:"profile-property"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#profile-property"}},[a._v("#")]),a._v(" "),t("code",[a._v("profile")]),a._v(" Property")]),a._v(" "),t("p",[a._v("In addition to the concept, we need an explicit way for publishers to state the profile they are using and consumers to discover this.")]),a._v(" "),t("p",[a._v("Thus, we have a "),t("code",[a._v("profile")]),a._v(" property that declares the profile for the descriptor for this Package or Resource. For the default Data Package and Data Resource descriptor, this SHOULD be present with a value of "),t("code",[a._v("data-package")]),a._v("/"),t("code",[a._v("data-resource")]),a._v(", but if not, the absence of a profile is equivalent to setting "),t("code",[a._v('"profile": "data-package"')]),a._v("/ "),t("code",[a._v('"profile": "data-resource"')]),a._v(".")]),a._v(" "),t("p",[a._v("Custom profiles MUST have a profile property, where the value is a unique identifier for that profile. This unique identifier "),t("code",[a._v("MUST")]),a._v(" be a string and can be in one of two forms. It can be an id from the official "),t("a",{attrs:{href:"/schemas/registry.json"}},[a._v("Data Package Schema Registry")]),a._v(", or, a fully-qualified URL that points directly to a JSON Schema that can be used to validate the profile.")]),a._v(" "),t("p",[a._v("As part of the Frictionless Data Specifications project, we publish a number of Data Package profiles such as:")]),a._v(" "),t("ul",[t("li",[t("RouterLink",{attrs:{to:"/tabular-data-package/"}},[a._v("Tabular Data Package")])],1),a._v(" "),t("li",[t("RouterLink",{attrs:{to:"/fiscal-data-package/"}},[a._v("Fiscal Data Package")])],1)]),a._v(" "),t("p",[a._v("We also publish the following Data Resource profiles:")]),a._v(" "),t("ul",[t("li",[t("RouterLink",{attrs:{to:"/tabular-data-resource/"}},[a._v("Tabular Data Resource")])],1)])],1)}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{398:function(a,e,t){"use strict";t.r(e);var r=t(26),o=Object(r.a)({},(function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"page-frontmatter-title"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[a._v("#")]),a._v(" "+a._s(a.$page.frontmatter.title))]),a._v(" "),t("p",[a._v(a._s(a.$page.frontmatter.abstract))]),a._v(" "),t("MetadataTable"),a._v(" "),t("h2",{attrs:{id:"language"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[a._v("#")]),a._v(" Language")]),a._v(" "),t("Language"),a._v(" "),t("h2",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),t("p",[a._v("Different kinds of data need different data and metadata formats. To support these different data and metadata formats we need to extend and specialise the generic Data Package. These specialized types of Data Package (or Data Resource) are termed "),t("strong",[a._v("profiles")]),a._v(". For example, there is a "),t("RouterLink",{attrs:{to:"/tabular-data-package/"}},[a._v("Tabular Data Package")]),a._v(" profile that specializes Data Packages specifically for tabular data.")],1),a._v(" "),t("p",[a._v("Thus, every Package and Resource descriptor has a profile. The namespace for the profile is the type of descriptor, so the default profile, if none is declared, is "),t("code",[a._v("data-package")]),a._v(" for a Package descriptor and "),t("code",[a._v("data-resource")]),a._v(" for a Resource descriptor.")]),a._v(" "),t("p",[a._v("In summary, an extension of Data Package may be formalised as a profile. A profile is a Data Package which extends the default specification towards more specific needs.")]),a._v(" "),t("h3",{attrs:{id:"profile-property"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#profile-property"}},[a._v("#")]),a._v(" "),t("code",[a._v("profile")]),a._v(" Property")]),a._v(" "),t("p",[a._v("In addition to the concept, we need an explicit way for publishers to state the profile they are using and consumers to discover this.")]),a._v(" "),t("p",[a._v("Thus, we have a "),t("code",[a._v("profile")]),a._v(" property that declares the profile for the descriptor for this Package or Resource. For the default Data Package and Data Resource descriptor, this SHOULD be present with a value of "),t("code",[a._v("data-package")]),a._v("/"),t("code",[a._v("data-resource")]),a._v(", but if not, the absence of a profile is equivalent to setting "),t("code",[a._v('"profile": "data-package"')]),a._v("/ "),t("code",[a._v('"profile": "data-resource"')]),a._v(".")]),a._v(" "),t("p",[a._v("Custom profiles MUST have a profile property, where the value is a unique identifier for that profile. This unique identifier "),t("code",[a._v("MUST")]),a._v(" be a string and can be in one of two forms. It can be an id from the official "),t("a",{attrs:{href:"/schemas/registry.json"}},[a._v("Data Package Schema Registry")]),a._v(", or, a fully-qualified URL that points directly to a JSON Schema that can be used to validate the profile.")]),a._v(" "),t("p",[a._v("As part of the Frictionless Data Specifications project, we publish a number of Data Package profiles such as:")]),a._v(" "),t("ul",[t("li",[t("RouterLink",{attrs:{to:"/tabular-data-package/"}},[a._v("Tabular Data Package")])],1),a._v(" "),t("li",[t("RouterLink",{attrs:{to:"/fiscal-data-package/"}},[a._v("Fiscal Data Package")])],1)]),a._v(" "),t("p",[a._v("We also publish the following Data Resource profiles:")]),a._v(" "),t("ul",[t("li",[t("RouterLink",{attrs:{to:"/tabular-data-resource/"}},[a._v("Tabular Data Resource")])],1)])],1)}),[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/26.41a41339.js b/assets/js/26.aa209af9.js similarity index 99% rename from assets/js/26.41a41339.js rename to assets/js/26.aa209af9.js index 5395f8da..73b5fd06 100644 --- a/assets/js/26.41a41339.js +++ b/assets/js/26.aa209af9.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{396:function(e,t,a){"use strict";a.r(t);var s=a(26),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),a("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),a("MetadataTable"),e._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),a("Language"),e._v(" "),a("h2",{attrs:{id:"library-users"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#library-users"}},[e._v("#")]),e._v(" Library users")]),e._v(" "),a("p",[e._v("Data packages is a container format that allows the creator to specify payload data (Resources) either as JSON"),a("br"),e._v("\nobjects/arrays or via pointers. There are two pointer formats:")]),e._v(" "),a("ul",[a("li",[e._v("local file system references. Those follow POSIX naming conventions and have to be relative to the Package Descriptor"),a("br"),e._v("\nfile (“datapackage.json”). Absolute paths are disallowed as they would open data exfiltration attacks. They would also"),a("br"),e._v("\nbe rarely useful, considering you typically cannot know the file system layout of the user’s computer")]),e._v(" "),a("li",[e._v("URLs as pointers to remote Resources. They are intended to load datasets from sites like statistic’s offices as the"),a("br"),e._v("\nbasis of Data Packages. Only HTTP/HTTPS URLs are allowed, library maintainers have to filter out others like file-URLs")])]),e._v(" "),a("p",[e._v("Both formats can open security holes that can be used to attack the user’s computer and/or network. It is therefore"),a("br"),e._v("\nSTRONGLY recommended to limit the kind of Resource pointers you allow on your machines if you accept Data Packages"),a("br"),e._v("\nfrom third party sources.")]),e._v(" "),a("p",[e._v("ONLY in a trusted environment (eg. your own computer during development of Data Packages) is it recommended to allow"),a("br"),e._v("\nall kinds of Resource pointers. In every other environment, you MUST keep the various attack scenarios in mind and"),a("br"),e._v("\nfilter out potentially dangerous Resource pointer types")]),e._v(" "),a("h2",{attrs:{id:"dangerous-descriptor-resource-pointer-combinations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#dangerous-descriptor-resource-pointer-combinations"}},[e._v("#")]),e._v(" Dangerous Descriptor/Resource pointer combinations")]),e._v(" "),a("p",[e._v("How to read the table: if your “datapackage.json”-file comes from one of the sources on the left, you should treat"),a("br"),e._v("\nResources in the format on the top as:")]),e._v(" "),a("ul",[a("li",[e._v("red: disallowed")]),e._v(" "),a("li",[e._v("yellow: potentially dangerous")]),e._v(" "),a("li",[e._v("green: safe to use")])]),e._v(" "),a("p",[a("img",{attrs:{src:"security_matrix.png",alt:"alt text"}})]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-url"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-url"}},[e._v("#")]),e._v(" Descriptor source is a URL")]),e._v(" "),a("p",[e._v("If your descriptor is loaded via URL, and the server to which the URL points is not fully trusted, you"),a("br"),e._v("\nSHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). Relative paths will be converted to URLs relative to the descriptor URL, so they will"),a("br"),e._v("\nnot load data from the local file system and are therefore safe.")])]),e._v(" "),a("p",[e._v("URL-based Resource pointers can furthermore be used for denial of service attacks on either the user’s system or a"),a("br"),e._v("\nservice hosting Resource data. A relatively small Data Package could still hold thousands of Resource URLs that"),a("br"),e._v("\neach could point to very large CSV files hosted somewhere. The Data Package processing library would load all"),a("br"),e._v("\nthose CSV files which might overwhelm the user’s computer. If an attacker were able to spread such a malicious"),a("br"),e._v("\nData Package, this could exhaust the resources of a hosting service.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-local-relative-path"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-local-relative-path"}},[e._v("#")]),e._v(" Descriptor source is a local relative path")]),e._v(" "),a("p",[e._v("If your descriptor is loaded via a local relative path, and the source of the Data Package is not fully trusted, you"),a("br"),e._v("\nSHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). Relative paths will be converted to paths relative to the Descriptor file system reference,"),a("br"),e._v("\nso they are considered harmless.")])]),e._v(" "),a("p",[e._v("As long as the producer of the Data Package is on the same local network as the computer/server parsing it, it is"),a("br"),e._v("\nconsidered safe to reference Resources via URLs, as the creator could map the network from their own workstation just"),a("br"),e._v("\nas well as crafting malicious Data Packages. In the above table, this case is therefore coded in yellow.")]),e._v(" "),a("p",[e._v("If Data Package parsing is part of a service offered to computers across subnets on the same LAN or even open to the"),a("br"),e._v("\ninternet, it NEVER safe to accept Data Packages containing URL-based Resource pointers.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-local-relative-path-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-local-relative-path-2"}},[e._v("#")]),e._v(" Descriptor source is a local relative path")]),e._v(" "),a("p",[e._v("While it is never safe to accept absolute file paths for Resources, it is perfectly safe to accept them for Descriptor"),a("br"),e._v("\nfiles. If your descriptor is loaded via a local absolute path, and the source of the Data Package is not fully"),a("br"),e._v("\ntrusted, you SHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). Relative paths will be converted to paths relative to the Descriptor file system reference,"),a("br"),e._v("\nso they are considered harmless.")])]),e._v(" "),a("p",[e._v("As long as the producer of the Data Package is on the same local network as the computer/server parsing it, it is"),a("br"),e._v("\nconsidered safe to reference Resources via URLs, as the creator could map the network from their own workstation just"),a("br"),e._v("\nas well as crafting malicious Data Packages. In the above table, this case is therefore coded in yellow.")]),e._v(" "),a("p",[e._v("If Data Package parsing is part of a service offered to computers across subnets on the same LAN or even open to the"),a("br"),e._v("\ninternet, it NEVER safe to accept Data Packages containing URL-based Resource pointers.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-json-object"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-json-object"}},[e._v("#")]),e._v(" Descriptor source is a JSON object")]),e._v(" "),a("p",[e._v("If the Descriptor is not loaded from file but created in-memory and the source of the Data Package is not fully"),a("br"),e._v("\ntrusted, you SHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("file system references, relative or absolute. Absolute paths can be used to exfiltrate system files"),a("br"),e._v("\n(eg. /etc/passwd on Unix-like systems). Relative paths would be constructed relative to the parsing software’s working"),a("br"),e._v("\ndirectory and could be used to guess at configuration files to exfiltrate. OTOH, in creation of a Data Package,"),a("br"),e._v("\nand if the relative paths are confined to a subdirectory, it is safe to use relative paths.")])]),e._v(" "),a("p",[e._v("As long as the producer of the Data Package is on the same local network as the computer/server parsing it, it is"),a("br"),e._v("\nconsidered safe to reference Resources via URLs, as the creator could map the network from their own workstation just"),a("br"),e._v("\nas well as crafting malicious Data Packages. In the above table, this case is therefore coded in yellow.")]),e._v(" "),a("p",[e._v("If Data Package parsing is part of a service offered to computers across subnets on the same LAN or even open to the"),a("br"),e._v("\ninternet, it NEVER safe to accept Data Packages containing URL-based Resource pointers.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-self-created-json-object"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-self-created-json-object"}},[e._v("#")]),e._v(" Descriptor source is a self-created JSON object")]),e._v(" "),a("p",[e._v("If the Descriptor is not loaded from file or created via a third-party application but by your software, it is"),a("br"),e._v("\ngenerally assumed you know what you do and therefore, loading Resources from URLs or file is considered safe. You"),a("br"),e._v("\nstill SHOULD NOT use absolute paths as a matter of precaution - and implementing libraries should filter them out.")]),e._v(" "),a("h2",{attrs:{id:"library-creators"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#library-creators"}},[e._v("#")]),e._v(" Library creators")]),e._v(" "),a("p",[e._v("Two kinds of Resource pointers can never be guaranteed to be totally safe:")]),e._v(" "),a("ul",[a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). In your implementation, you SHOULD either raise an error if an absolute local path is encountered"),a("br"),e._v("\nor relativize it to the Descriptor path.")]),e._v(" "),a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your user’s network layout. It is up to the library creator"),a("br"),e._v("\nto create means that allow their users to mitigate this attack.")])]),e._v(" "),a("p",[e._v("As URLs are part of the DNA of Data Packages, it is not advisable to disallow their use completely. However, you should"),a("br"),e._v("\nallow for a security setting that stops your implementation from loading URL-based Resources. This could be done")]),e._v(" "),a("ul",[a("li",[e._v("via a setting switch ("),a("code",[e._v("insecure")]),e._v("/"),a("code",[e._v("default")]),e._v(") that allows the user of your library implementation to allow or"),a("br"),e._v("\ndisallow absolute file paths and URL-based Resource pointers")]),e._v(" "),a("li",[e._v("via a pluggable security filter that is applied as an interceptor "),a("em",[e._v("before")]),e._v(" loading any pointer-based Resources. If"),a("br"),e._v("\nyou decide to use such a scheme, you SHOULD provide default implementations for a filter disallowing URL-based"),a("br"),e._v("\nResource and an insecure filter that allows loading of all Resources.")])]),e._v(" "),a("h3",{attrs:{id:"security-filters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#security-filters"}},[e._v("#")]),e._v(" Security Filters")]),e._v(" "),a("p",[e._v("If disallowing all URL-based Resources is too heavy-handed and allowing all is too insecure, finer-grained filters"),a("br"),e._v("\nshould be implemented. Those finer security filters can be implemented as either blacklist or whitelist filters."),a("br"),e._v("\nBlacklist filters in principle allow all URLs and restrict some, whereas whitelist filters deny all as a default"),a("br"),e._v("\nand have a limited list of allowed URLs.")]),e._v(" "),a("p",[e._v("Blacklist filters in their most basic implementation would have to disallow all non-routed IP-addresses like the"),a("br"),e._v("\n192.168.x.x range or the 10.100.x.x range. This would blunt mapping attacks against the internal network of your users"),a("br"),e._v("\nbut needs to be well thought out as even one omission could endanger network security")]),e._v(" "),a("p",[e._v("Whitelist filters are much more secure as they allow the loading of Resources from a named list of domains only, but"),a("br"),e._v("\nmight be too restrictive for some uses.")])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{395:function(e,t,a){"use strict";a.r(t);var s=a(26),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),a("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),a("MetadataTable"),e._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),a("Language"),e._v(" "),a("h2",{attrs:{id:"library-users"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#library-users"}},[e._v("#")]),e._v(" Library users")]),e._v(" "),a("p",[e._v("Data packages is a container format that allows the creator to specify payload data (Resources) either as JSON"),a("br"),e._v("\nobjects/arrays or via pointers. There are two pointer formats:")]),e._v(" "),a("ul",[a("li",[e._v("local file system references. Those follow POSIX naming conventions and have to be relative to the Package Descriptor"),a("br"),e._v("\nfile (“datapackage.json”). Absolute paths are disallowed as they would open data exfiltration attacks. They would also"),a("br"),e._v("\nbe rarely useful, considering you typically cannot know the file system layout of the user’s computer")]),e._v(" "),a("li",[e._v("URLs as pointers to remote Resources. They are intended to load datasets from sites like statistic’s offices as the"),a("br"),e._v("\nbasis of Data Packages. Only HTTP/HTTPS URLs are allowed, library maintainers have to filter out others like file-URLs")])]),e._v(" "),a("p",[e._v("Both formats can open security holes that can be used to attack the user’s computer and/or network. It is therefore"),a("br"),e._v("\nSTRONGLY recommended to limit the kind of Resource pointers you allow on your machines if you accept Data Packages"),a("br"),e._v("\nfrom third party sources.")]),e._v(" "),a("p",[e._v("ONLY in a trusted environment (eg. your own computer during development of Data Packages) is it recommended to allow"),a("br"),e._v("\nall kinds of Resource pointers. In every other environment, you MUST keep the various attack scenarios in mind and"),a("br"),e._v("\nfilter out potentially dangerous Resource pointer types")]),e._v(" "),a("h2",{attrs:{id:"dangerous-descriptor-resource-pointer-combinations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#dangerous-descriptor-resource-pointer-combinations"}},[e._v("#")]),e._v(" Dangerous Descriptor/Resource pointer combinations")]),e._v(" "),a("p",[e._v("How to read the table: if your “datapackage.json”-file comes from one of the sources on the left, you should treat"),a("br"),e._v("\nResources in the format on the top as:")]),e._v(" "),a("ul",[a("li",[e._v("red: disallowed")]),e._v(" "),a("li",[e._v("yellow: potentially dangerous")]),e._v(" "),a("li",[e._v("green: safe to use")])]),e._v(" "),a("p",[a("img",{attrs:{src:"security_matrix.png",alt:"alt text"}})]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-url"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-url"}},[e._v("#")]),e._v(" Descriptor source is a URL")]),e._v(" "),a("p",[e._v("If your descriptor is loaded via URL, and the server to which the URL points is not fully trusted, you"),a("br"),e._v("\nSHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). Relative paths will be converted to URLs relative to the descriptor URL, so they will"),a("br"),e._v("\nnot load data from the local file system and are therefore safe.")])]),e._v(" "),a("p",[e._v("URL-based Resource pointers can furthermore be used for denial of service attacks on either the user’s system or a"),a("br"),e._v("\nservice hosting Resource data. A relatively small Data Package could still hold thousands of Resource URLs that"),a("br"),e._v("\neach could point to very large CSV files hosted somewhere. The Data Package processing library would load all"),a("br"),e._v("\nthose CSV files which might overwhelm the user’s computer. If an attacker were able to spread such a malicious"),a("br"),e._v("\nData Package, this could exhaust the resources of a hosting service.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-local-relative-path"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-local-relative-path"}},[e._v("#")]),e._v(" Descriptor source is a local relative path")]),e._v(" "),a("p",[e._v("If your descriptor is loaded via a local relative path, and the source of the Data Package is not fully trusted, you"),a("br"),e._v("\nSHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). Relative paths will be converted to paths relative to the Descriptor file system reference,"),a("br"),e._v("\nso they are considered harmless.")])]),e._v(" "),a("p",[e._v("As long as the producer of the Data Package is on the same local network as the computer/server parsing it, it is"),a("br"),e._v("\nconsidered safe to reference Resources via URLs, as the creator could map the network from their own workstation just"),a("br"),e._v("\nas well as crafting malicious Data Packages. In the above table, this case is therefore coded in yellow.")]),e._v(" "),a("p",[e._v("If Data Package parsing is part of a service offered to computers across subnets on the same LAN or even open to the"),a("br"),e._v("\ninternet, it NEVER safe to accept Data Packages containing URL-based Resource pointers.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-local-relative-path-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-local-relative-path-2"}},[e._v("#")]),e._v(" Descriptor source is a local relative path")]),e._v(" "),a("p",[e._v("While it is never safe to accept absolute file paths for Resources, it is perfectly safe to accept them for Descriptor"),a("br"),e._v("\nfiles. If your descriptor is loaded via a local absolute path, and the source of the Data Package is not fully"),a("br"),e._v("\ntrusted, you SHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). Relative paths will be converted to paths relative to the Descriptor file system reference,"),a("br"),e._v("\nso they are considered harmless.")])]),e._v(" "),a("p",[e._v("As long as the producer of the Data Package is on the same local network as the computer/server parsing it, it is"),a("br"),e._v("\nconsidered safe to reference Resources via URLs, as the creator could map the network from their own workstation just"),a("br"),e._v("\nas well as crafting malicious Data Packages. In the above table, this case is therefore coded in yellow.")]),e._v(" "),a("p",[e._v("If Data Package parsing is part of a service offered to computers across subnets on the same LAN or even open to the"),a("br"),e._v("\ninternet, it NEVER safe to accept Data Packages containing URL-based Resource pointers.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-json-object"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-json-object"}},[e._v("#")]),e._v(" Descriptor source is a JSON object")]),e._v(" "),a("p",[e._v("If the Descriptor is not loaded from file but created in-memory and the source of the Data Package is not fully"),a("br"),e._v("\ntrusted, you SHOULD NOT allow Data Packages with Resource pointers in")]),e._v(" "),a("ul",[a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your network layout.")]),e._v(" "),a("li",[e._v("file system references, relative or absolute. Absolute paths can be used to exfiltrate system files"),a("br"),e._v("\n(eg. /etc/passwd on Unix-like systems). Relative paths would be constructed relative to the parsing software’s working"),a("br"),e._v("\ndirectory and could be used to guess at configuration files to exfiltrate. OTOH, in creation of a Data Package,"),a("br"),e._v("\nand if the relative paths are confined to a subdirectory, it is safe to use relative paths.")])]),e._v(" "),a("p",[e._v("As long as the producer of the Data Package is on the same local network as the computer/server parsing it, it is"),a("br"),e._v("\nconsidered safe to reference Resources via URLs, as the creator could map the network from their own workstation just"),a("br"),e._v("\nas well as crafting malicious Data Packages. In the above table, this case is therefore coded in yellow.")]),e._v(" "),a("p",[e._v("If Data Package parsing is part of a service offered to computers across subnets on the same LAN or even open to the"),a("br"),e._v("\ninternet, it NEVER safe to accept Data Packages containing URL-based Resource pointers.")]),e._v(" "),a("h3",{attrs:{id:"descriptor-source-is-a-self-created-json-object"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-source-is-a-self-created-json-object"}},[e._v("#")]),e._v(" Descriptor source is a self-created JSON object")]),e._v(" "),a("p",[e._v("If the Descriptor is not loaded from file or created via a third-party application but by your software, it is"),a("br"),e._v("\ngenerally assumed you know what you do and therefore, loading Resources from URLs or file is considered safe. You"),a("br"),e._v("\nstill SHOULD NOT use absolute paths as a matter of precaution - and implementing libraries should filter them out.")]),e._v(" "),a("h2",{attrs:{id:"library-creators"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#library-creators"}},[e._v("#")]),e._v(" Library creators")]),e._v(" "),a("p",[e._v("Two kinds of Resource pointers can never be guaranteed to be totally safe:")]),e._v(" "),a("ul",[a("li",[e._v("Absolute file system references. Absolute paths can be used to exfiltrate system files (eg. /etc/passwd on"),a("br"),e._v("\nUnix-like systems). In your implementation, you SHOULD either raise an error if an absolute local path is encountered"),a("br"),e._v("\nor relativize it to the Descriptor path.")]),e._v(" "),a("li",[e._v("URLs. As described in "),a("a",{attrs:{href:"https://github.com/frictionlessdata/specs/issues/650",target:"_blank",rel:"noopener noreferrer"}},[e._v("issue #650"),a("OutboundLink")],1),e._v(", URLs crafted by the author"),a("br"),e._v("\nof a Data Package can be used in a “keyhole” attack to probe your user’s network layout. It is up to the library creator"),a("br"),e._v("\nto create means that allow their users to mitigate this attack.")])]),e._v(" "),a("p",[e._v("As URLs are part of the DNA of Data Packages, it is not advisable to disallow their use completely. However, you should"),a("br"),e._v("\nallow for a security setting that stops your implementation from loading URL-based Resources. This could be done")]),e._v(" "),a("ul",[a("li",[e._v("via a setting switch ("),a("code",[e._v("insecure")]),e._v("/"),a("code",[e._v("default")]),e._v(") that allows the user of your library implementation to allow or"),a("br"),e._v("\ndisallow absolute file paths and URL-based Resource pointers")]),e._v(" "),a("li",[e._v("via a pluggable security filter that is applied as an interceptor "),a("em",[e._v("before")]),e._v(" loading any pointer-based Resources. If"),a("br"),e._v("\nyou decide to use such a scheme, you SHOULD provide default implementations for a filter disallowing URL-based"),a("br"),e._v("\nResource and an insecure filter that allows loading of all Resources.")])]),e._v(" "),a("h3",{attrs:{id:"security-filters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#security-filters"}},[e._v("#")]),e._v(" Security Filters")]),e._v(" "),a("p",[e._v("If disallowing all URL-based Resources is too heavy-handed and allowing all is too insecure, finer-grained filters"),a("br"),e._v("\nshould be implemented. Those finer security filters can be implemented as either blacklist or whitelist filters."),a("br"),e._v("\nBlacklist filters in principle allow all URLs and restrict some, whereas whitelist filters deny all as a default"),a("br"),e._v("\nand have a limited list of allowed URLs.")]),e._v(" "),a("p",[e._v("Blacklist filters in their most basic implementation would have to disallow all non-routed IP-addresses like the"),a("br"),e._v("\n192.168.x.x range or the 10.100.x.x range. This would blunt mapping attacks against the internal network of your users"),a("br"),e._v("\nbut needs to be well thought out as even one omission could endanger network security")]),e._v(" "),a("p",[e._v("Whitelist filters are much more secure as they allow the loading of Resources from a named list of domains only, but"),a("br"),e._v("\nmight be too restrictive for some uses.")])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/27.f0d2b4b1.js b/assets/js/27.0b1aa329.js similarity index 99% rename from assets/js/27.f0d2b4b1.js rename to assets/js/27.0b1aa329.js index 0ca6ed7d..87d34dbe 100644 --- a/assets/js/27.f0d2b4b1.js +++ b/assets/js/27.0b1aa329.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{397:function(e,t,a){"use strict";a.r(t);var s=a(26),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),a("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),a("MetadataTable"),e._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),a("Language"),e._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),a("p",[e._v("Table Schema is a simple language- and implementation-agnostic way to declare a schema for tabular data. Table Schema is well suited for use cases around handling and validating tabular data in text formats such as CSV, but its utility extends well beyond this core usage, towards a range of applications where data benefits from a portable schema format.")]),e._v(" "),a("h3",{attrs:{id:"concepts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#concepts"}},[e._v("#")]),e._v(" Concepts")]),e._v(" "),a("h4",{attrs:{id:"tabular-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#tabular-data"}},[e._v("#")]),e._v(" Tabular data")]),e._v(" "),a("p",[e._v("Tabular data consists of a set of rows. Each row has a set of fields (columns). We usually expect that each row has the same set of fields and thus we can talk about "),a("em",[e._v("the")]),e._v(" fields for the table as a whole.")]),e._v(" "),a("p",[e._v("In case of tables in spreadsheets or CSV files we often interpret the first row as a header row, giving the names of the fields. By contrast, in other situations, e.g. tables in SQL databases, the field names are explicitly designated.")]),e._v(" "),a("p",[e._v("To illustrate, here’s a classic spreadsheet table:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v("field field\n | |\n | |\n V V\n\n A | B | C | D <--- Row (Header)\n ------------------------------------\n valA | valB | valC | valD <--- Row\n ...\n")])])]),a("p",[e._v("In JSON, a table would be:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v('[\n { "A": value, "B": value, ... },\n { "A": value, "B": value, ... },\n ...\n]\n')])])]),a("h4",{attrs:{id:"physical-and-logical-representation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#physical-and-logical-representation"}},[e._v("#")]),e._v(" Physical and logical representation")]),e._v(" "),a("p",[e._v("In order to talk about the representation and processing of tabular data from text-based sources, it is useful to introduce the concepts of the "),a("em",[e._v("physical")]),e._v(" and the "),a("em",[e._v("logical")]),e._v(" representation of data.")]),e._v(" "),a("p",[e._v("The "),a("em",[e._v("physical representation")]),e._v(" of data refers to the representation of data as text on disk, for example, in a CSV or JSON file. This representation may have some "),a("em",[e._v("type")]),e._v(" information (JSON, where the primitive types that JSON supports can be used) or not (CSV, where all data is represented in string form).")]),e._v(" "),a("p",[e._v("The "),a("em",[e._v("logical representation")]),e._v(" of data refers to the “ideal” representation of the data in terms of primitive types, data structures, and relations, all as defined by the specification. We could say that the specification is about the logical representation of data, as well as about ways in which to handle conversion of a physical representation to a logical one.")]),e._v(" "),a("p",[e._v("In this document, we’ll explicitly refer to either the "),a("em",[e._v("physical")]),e._v(" or "),a("em",[e._v("logical")]),e._v(" representation in places where it prevents ambiguity for those engaging with the specification, especially implementors.")]),e._v(" "),a("p",[e._v("For example, "),a("code",[e._v("constraints")]),e._v(" should be tested on the logical representation of data, whereas a property like "),a("code",[e._v("missingValues")]),e._v(" applies to the physical representation of the data.")]),e._v(" "),a("h2",{attrs:{id:"descriptor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor"}},[e._v("#")]),e._v(" Descriptor")]),e._v(" "),a("p",[e._v("A Table Schema is represented by a descriptor. The descriptor "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" (JSON is defined in "),a("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4627.txt",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC 4627"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("p",[e._v("It "),a("code",[e._v("MUST")]),e._v(" contain a property "),a("code",[e._v("fields")]),e._v(". "),a("code",[e._v("fields")]),e._v(" "),a("code",[e._v("MUST")]),e._v(" be an array where each entry in the array is a field descriptor (as defined below). The order of elements in "),a("code",[e._v("fields")]),e._v(" array "),a("code",[e._v("SHOULD")]),e._v(" be the order of fields in the CSV file. The number of elements in "),a("code",[e._v("fields")]),e._v(" array "),a("code",[e._v("SHOULD")]),e._v(" be the same as the number of fields in the CSV file.")]),e._v(" "),a("p",[e._v("The descriptor "),a("code",[e._v("MAY")]),e._v(" have the additional properties set out below and "),a("code",[e._v("MAY")]),e._v(" contain any number of other properties (not defined in this specification).")]),e._v(" "),a("p",[e._v("The following is an illustration of this structure:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// fields is an ordered list of field descriptors")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// one for each field (column) in the table")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// a field-descriptor")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name of field (e.g. column name)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A nicer human readable label or title for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying the type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying a format"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"example"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"An example value for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A description for the field"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v(" more field descriptors\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// (optional) specification of missing values")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// (optional) specification of the primary key")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"primaryKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// (optional) specification of the foreign keys")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h2",{attrs:{id:"field-descriptors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#field-descriptors"}},[e._v("#")]),e._v(" Field Descriptors")]),e._v(" "),a("p",[e._v("A field descriptor "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" that describes a single field. The"),a("br"),e._v("\ndescriptor provides additional human-readable documentation for a field, as"),a("br"),e._v("\nwell as additional information that may be used to validate the field or create"),a("br"),e._v("\na user interface for data entry.")]),e._v(" "),a("p",[e._v("Here is an illustration:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name of field (e.g. column name)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A nicer human readable label or title for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying the type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying a format"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"example"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"An example value for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A description for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"constraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// a constraints-descriptor")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[e._v("The field descriptor "),a("code",[e._v("object")]),e._v(" "),a("code",[e._v("MAY")]),e._v(" contain any number of other properties. Some specific properties are defined below. Of these, only the "),a("code",[e._v("name")]),e._v(" property is "),a("code",[e._v("REQUIRED")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#name"}},[e._v("#")]),e._v(" "),a("code",[e._v("name")])]),e._v(" "),a("p",[e._v("The field descriptor MUST contain a "),a("code",[e._v("name")]),e._v(" property. This property "),a("code",[e._v("SHOULD")]),e._v(" correspond to the name of field/column in the data file (if it has a name). As such it "),a("code",[e._v("SHOULD")]),e._v(" be unique (though it is possible, but very bad practice, for the data file to have multiple columns with the same name). "),a("code",[e._v("name")]),e._v(" "),a("code",[e._v("SHOULD NOT")]),e._v(" be considered case sensitive in determining uniqueness. However, since it should correspond to the name of the field in the data file it may be important to preserve case.")]),e._v(" "),a("h3",{attrs:{id:"title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#title"}},[e._v("#")]),e._v(" "),a("code",[e._v("title")])]),e._v(" "),a("p",[e._v("A human readable label or title for the field")]),e._v(" "),a("h3",{attrs:{id:"description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#description"}},[e._v("#")]),e._v(" "),a("code",[e._v("description")])]),e._v(" "),a("p",[e._v("A description for this field e.g. “The recipient of the funds”")]),e._v(" "),a("h3",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" "),a("code",[e._v("example")])]),e._v(" "),a("p",[e._v("An example value for the field")]),e._v(" "),a("h3",{attrs:{id:"types-and-formats"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#types-and-formats"}},[e._v("#")]),e._v(" Types and Formats")]),e._v(" "),a("p",[a("code",[e._v("type")]),e._v(" and "),a("code",[e._v("format")]),e._v(" properties are used to give The type of the field (string, number etc) - see below for"),a("br"),e._v("\nmore detail. If type is not provided a consumer should assume a type of"),a("br"),e._v("\n“string”.")]),e._v(" "),a("p",[e._v("A field’s "),a("code",[e._v("type")]),e._v(" property is a string indicating the type of this field.")]),e._v(" "),a("p",[e._v("A field’s "),a("code",[e._v("format")]),e._v(" property is a string, indicating a format for the field type.")]),e._v(" "),a("p",[e._v("Both "),a("code",[e._v("type")]),e._v(" and "),a("code",[e._v("format")]),e._v(" are optional: in a field descriptor, the absence of a"),a("br"),e._v(" "),a("code",[e._v("type")]),e._v(" property indicates that the field is of the type “string”, and the"),a("br"),e._v("\nabsence of a "),a("code",[e._v("format")]),e._v(" property indicates that the field’s type "),a("code",[e._v("format")]),e._v(" is"),a("br"),e._v("\n“default”.")]),e._v(" "),a("p",[e._v("Types are based on the "),a("a",{attrs:{href:"http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1",target:"_blank",rel:"noopener noreferrer"}},[e._v("type set of"),a("br"),e._v("\njson-schema"),a("OutboundLink")],1),a("br"),e._v("\nwith some additions and minor modifications (cf other type lists include"),a("br"),e._v("\nthose in "),a("a",{attrs:{href:"https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Elasticsearch"),a("br"),e._v("\ntypes"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("p",[e._v("The type list with associated formats and other related properties is as"),a("br"),e._v("\nfollows.")]),e._v(" "),a("h4",{attrs:{id:"string"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#string"}},[e._v("#")]),e._v(" string")]),e._v(" "),a("p",[e._v("The field contains strings, that is, sequences of characters.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": any valid string.")]),e._v(" "),a("li",[a("strong",[e._v("email")]),e._v(": A valid email address.")]),e._v(" "),a("li",[a("strong",[e._v("uri")]),e._v(": A valid URI.")]),e._v(" "),a("li",[a("strong",[e._v("binary")]),e._v(": A base64 encoded string representing binary data.")]),e._v(" "),a("li",[a("strong",[e._v("uuid")]),e._v(": A string that is a uuid.")])]),e._v(" "),a("h4",{attrs:{id:"number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#number"}},[e._v("#")]),e._v(" number")]),e._v(" "),a("p",[e._v("The field contains numbers of any kind including decimals.")]),e._v(" "),a("p",[e._v("The lexical formatting follows that of decimal in "),a("a",{attrs:{href:"https://www.w3.org/TR/xmlschema-2/#decimal",target:"_blank",rel:"noopener noreferrer"}},[e._v("XMLSchema"),a("OutboundLink")],1),e._v(": a"),a("br"),e._v("\nnon-empty finite-length sequence of decimal digits separated by a period as a"),a("br"),e._v("\ndecimal indicator. An optional leading sign is allowed. If the sign is omitted,"),a("br"),e._v("\n“+” is assumed. Leading and trailing zeroes are optional. If the fractional"),a("br"),e._v("\npart is zero, the period and following zero(es) can be omitted. For example:"),a("br"),e._v("\n‘-1.23’, ‘12678967.543233’, ‘+100000.00’, ‘210’.")]),e._v(" "),a("p",[e._v("The following special string values are permitted (case need not be respected):")]),e._v(" "),a("ul",[a("li",[e._v("NaN: not a number")]),e._v(" "),a("li",[e._v("INF: positive infinity")]),e._v(" "),a("li",[e._v("-INF: negative infinity")])]),e._v(" "),a("p",[e._v("A number MAY also have a trailing:")]),e._v(" "),a("ul",[a("li",[e._v("exponent: this MUST consist of an E followed by an optional + or - sign"),a("br"),e._v("\nfollowed by one or more decimal digits (0-9)")])]),e._v(" "),a("p",[e._v("This lexical formatting may be modified using these additional properties:")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("decimalChar")]),e._v(": A string whose value is used to represent a decimal point"),a("br"),e._v("\nwithin the number. The default value is “.”.")]),e._v(" "),a("li",[a("strong",[e._v("groupChar")]),e._v(": A string whose value is used to group digits within the"),a("br"),e._v("\nnumber. The default value is null. A common value is “,” e.g. “100,000”.")]),e._v(" "),a("li",[a("strong",[e._v("bareNumber")]),e._v(": a boolean field with a default of "),a("code",[e._v("true")]),e._v(". If "),a("code",[e._v("true")]),e._v(" the physical contents of this field must follow the formatting constraints already set out. If "),a("code",[e._v("false")]),e._v(" the contents of this field may contain leading and/or trailing non-numeric characters (which implementors MUST therefore strip). The purpose of "),a("code",[e._v("bareNumber")]),e._v(" is to allow publishers to publish numeric data that contains trailing characters such as percentages e.g. "),a("code",[e._v("95%")]),e._v(" or leading characters such as currencies e.g. "),a("code",[e._v("€95")]),e._v(" or "),a("code",[e._v("EUR 95")]),e._v(". Note that it is entirely up to implementors what, if anything, they do with stripped text.")])]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"integer"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#integer"}},[e._v("#")]),e._v(" integer")]),e._v(" "),a("p",[e._v("The field contains integers - that is whole numbers.")]),e._v(" "),a("p",[e._v("Integer values are indicated in the standard way for any valid integer.")]),e._v(" "),a("p",[e._v("Additional properties:")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("bareNumber")]),e._v(": a boolean field with a default of "),a("code",[e._v("true")]),e._v(". If "),a("code",[e._v("true")]),e._v(" the physical contents of this field must follow the formatting constraints already set out. If "),a("code",[e._v("false")]),e._v(" the contents of this field may contain leading and/or trailing non-numeric characters (which implementors MUST therefore strip). The purpose of "),a("code",[e._v("bareNumber")]),e._v(" is to allow publishers to publish numeric data that contains trailing characters such as percentages e.g. "),a("code",[e._v("95%")]),e._v(" or leading characters such as currencies e.g. "),a("code",[e._v("€95")]),e._v(" or "),a("code",[e._v("EUR 95")]),e._v(". Note that it is entirely up to implementors what, if anything, they do with stripped text.")])]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#boolean"}},[e._v("#")]),e._v(" boolean")]),e._v(" "),a("p",[e._v("The field contains boolean (true/false) data.")]),e._v(" "),a("p",[e._v("In the physical representations of data where boolean values are represented with strings, the values set in "),a("code",[e._v("trueValues")]),e._v(" and "),a("code",[e._v("falseValues")]),e._v(" are to be cast to their logical representation as booleans. "),a("code",[e._v("trueValues")]),e._v(" and "),a("code",[e._v("falseValues")]),e._v(" are arrays which can be customised to user need. The default values for these are in the additional properties section below.")]),e._v(" "),a("p",[e._v("The boolean field can be customised with these additional properties:")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("trueValues")]),e._v(": "),a("code",[e._v('[ "true", "True", "TRUE", "1" ]')])]),e._v(" "),a("li",[a("strong",[e._v("falseValues")]),e._v(": "),a("code",[e._v('[ "false", "False", "FALSE", "0" ]')])])]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"object"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#object"}},[e._v("#")]),e._v(" object")]),e._v(" "),a("p",[e._v("The field contains data which is valid JSON.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"array"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#array"}},[e._v("#")]),e._v(" array")]),e._v(" "),a("p",[e._v("The field contains data that is a valid JSON format arrays.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"date"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#date"}},[e._v("#")]),e._v(" date")]),e._v(" "),a("p",[e._v("A date without a time.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": An ISO8601 format string.\n"),a("ul",[a("li",[e._v("date: This MUST be in ISO8601 format YYYY-MM-DD")]),e._v(" "),a("li",[e._v("datetime: a date-time. This MUST be in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time")]),e._v(" "),a("li",[e._v("time: a time without a date")])])]),e._v(" "),a("li",[a("strong",[e._v("any")]),e._v(": Any parsable representation of the type. The implementing"),a("br"),e._v("\nlibrary can attempt to parse the datetime via a range of strategies."),a("br"),e._v("\nAn example is "),a("code",[e._v("dateutil.parser.parse")]),e._v(" from the "),a("code",[e._v("python-dateutils")]),a("br"),e._v("\nlibrary.")]),e._v(" "),a("li",[a("strong",[e._v("")]),e._v(": date/time values in this field can be parsed according to"),a("br"),e._v(" "),a("code",[e._v("")]),e._v(". "),a("code",[e._v("")]),e._v(" MUST follow the syntax of "),a("a",{attrs:{href:"https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior",target:"_blank",rel:"noopener noreferrer"}},[e._v("standard Python / C"),a("br"),e._v("\nstrptime"),a("OutboundLink")],1),e._v(". (That is, values in the this field should be parsable"),a("br"),e._v("\nby Python / C standard "),a("code",[e._v("strptime")]),e._v(" using "),a("code",[e._v("")]),e._v("). Example for "),a("code",[e._v('"format": "%d/%m/%y"')]),e._v(" which would correspond to dates like: "),a("code",[e._v("30/11/14")])])]),e._v(" "),a("h4",{attrs:{id:"time"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#time"}},[e._v("#")]),e._v(" time")]),e._v(" "),a("p",[e._v("A time without a date.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": An ISO8601 time string e.g. "),a("code",[e._v("hh:mm:ss")])]),e._v(" "),a("li",[a("strong",[e._v("any")]),e._v(": as for "),a("code",[e._v("date")])]),e._v(" "),a("li",[a("strong",[e._v("")]),e._v(": as for "),a("code",[e._v("date")])])]),e._v(" "),a("h4",{attrs:{id:"datetime"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#datetime"}},[e._v("#")]),e._v(" datetime")]),e._v(" "),a("p",[e._v("A date with a time.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": An ISO8601 format string e.g. "),a("code",[e._v("YYYY-MM-DDThh:mm:ssZ")]),e._v(" in UTC time")]),e._v(" "),a("li",[a("strong",[e._v("any")]),e._v(": as for "),a("code",[e._v("date")])]),e._v(" "),a("li",[a("strong",[e._v("")]),e._v(": as for "),a("code",[e._v("date")])])]),e._v(" "),a("h4",{attrs:{id:"year"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#year"}},[e._v("#")]),e._v(" year")]),e._v(" "),a("p",[e._v("A calendar year as per "),a("a",{attrs:{href:"https://www.w3.org/TR/xmlschema-2/#gYear",target:"_blank",rel:"noopener noreferrer"}},[e._v("XMLSchema "),a("code",[e._v("gYear")]),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("p",[e._v("Usual lexical representation is "),a("code",[e._v("YYYY")]),e._v(". There are no format options.")]),e._v(" "),a("h4",{attrs:{id:"yearmonth"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#yearmonth"}},[e._v("#")]),e._v(" yearmonth")]),e._v(" "),a("p",[e._v("A specific month in a specific year as per "),a("a",{attrs:{href:"https://www.w3.org/TR/xmlschema-2/#gYearMonth",target:"_blank",rel:"noopener noreferrer"}},[e._v("XMLSchema"),a("br"),e._v(" "),a("code",[e._v("gYearMonth")]),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("p",[e._v("Usual lexical representation is: "),a("code",[e._v("YYYY-MM")]),e._v(". There are no format options.")]),e._v(" "),a("h4",{attrs:{id:"duration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#duration"}},[e._v("#")]),e._v(" duration")]),e._v(" "),a("p",[e._v("A duration of time.")]),e._v(" "),a("p",[e._v("We follow the definition of "),a("a",{attrs:{href:"http://www.w3.org/TR/xmlschema-2/#duration",target:"_blank",rel:"noopener noreferrer"}},[e._v("XML Schema duration datatype"),a("OutboundLink")],1),e._v(" directly"),a("br"),e._v("\nand that definition is implicitly inlined here.")]),e._v(" "),a("p",[e._v("To summarize: the lexical representation for duration is the "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/ISO_8601#Durations",target:"_blank",rel:"noopener noreferrer"}},[e._v("ISO 8601"),a("OutboundLink")],1),a("br"),e._v("\nextended format PnYnMnDTnHnMnS, where nY represents the number of years, nM the"),a("br"),e._v("\nnumber of months, nD the number of days, ‘T’ is the date/time separator, nH the"),a("br"),e._v("\nnumber of hours, nM the number of minutes and nS the number of seconds. The"),a("br"),e._v("\nnumber of seconds can include decimal digits to arbitrary precision. Date and"),a("br"),e._v("\ntime elements including their designator may be omitted if their value is zero,"),a("br"),e._v("\nand lower order elements may also be omitted for reduced precision.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"geopoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#geopoint"}},[e._v("#")]),e._v(" geopoint")]),e._v(" "),a("p",[e._v("The field contains data describing a geographic point.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": A string of the pattern “lon, lat”, where "),a("code",[e._v("lon")]),e._v(" is the longitude"),a("br"),e._v("\nand "),a("code",[e._v("lat")]),e._v(" is the latitude (note the space is optional after the "),a("code",[e._v(",")]),e._v("). E.g. "),a("code",[e._v('"90, 45"')]),e._v(".")]),e._v(" "),a("li",[a("strong",[e._v("array")]),e._v(": A JSON array, or a string parsable as a JSON array, of exactly two items, where each item is a number, and the first item is "),a("code",[e._v("lon")]),e._v(" and the second"),a("br"),e._v("\nitem is "),a("code",[e._v("lat")]),e._v(" e.g. "),a("code",[e._v("[90, 45]")])]),e._v(" "),a("li",[a("strong",[e._v("object")]),e._v(": A JSON object with exactly two keys, "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lon")]),e._v(" and each value is a number e.g. "),a("code",[e._v('{"lon": 90, "lat": 45}')])])]),e._v(" "),a("h4",{attrs:{id:"geojson"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#geojson"}},[e._v("#")]),e._v(" geojson")]),e._v(" "),a("p",[e._v("The field contains a JSON object according to GeoJSON or TopoJSON spec.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": A geojson object as per the "),a("a",{attrs:{href:"http://geojson.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("GeoJSON spec"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("li",[a("strong",[e._v("topojson")]),e._v(": A topojson object as per the "),a("a",{attrs:{href:"https://github.com/topojson/topojson-specification/blob/master/README.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("TopoJSON spec"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"any"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#any"}},[e._v("#")]),e._v(" any")]),e._v(" "),a("p",[e._v("Any "),a("code",[e._v("type")]),e._v(" or "),a("code",[e._v("format")]),e._v(" is accepted. When converting from physical to logical representation, the behaviour should be similar to String field type.")]),e._v(" "),a("h3",{attrs:{id:"rich-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rich-types"}},[e._v("#")]),e._v(" Rich Types")]),e._v(" "),a("p",[e._v("A richer, “semantic”, description of the “type” of data in a given column MAY"),a("br"),e._v("\nbe provided using a "),a("code",[e._v("rdfType")]),e._v(" property on a field descriptor.")]),e._v(" "),a("p",[e._v("The value of the "),a("code",[e._v("rdfType")]),e._v(" property MUST be the URI of a RDF Class, that is an instance or subclass of "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf-schema/#ch_class",target:"_blank",rel:"noopener noreferrer"}},[e._v("RDF Schema Class object"),a("OutboundLink")],1)]),e._v(" "),a("p",[e._v("Here is an example using the "),a("a",{attrs:{href:"http://Schema.org",target:"_blank",rel:"noopener noreferrer"}},[e._v("Schema.org"),a("OutboundLink")],1),e._v(" RDF Class "),a("code",[e._v("http://schema.org/Country")]),e._v(":")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("| Country | Year Date | Value |\n| ------- | --------- | ----- |\n| US | 2010 | ... |\n")])])]),a("p",[e._v("The corresponding Table Schema is:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n fields"),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Country"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"string"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"rdfType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"http://schema.org/Country"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h3",{attrs:{id:"constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#constraints"}},[e._v("#")]),e._v(" Constraints")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("constraints")]),e._v(" property on Table Schema Fields can be used by consumers to list constraints for validating field values. For example, validating the data in a "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/tabular-data-resource/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Tabular Data Resource"),a("OutboundLink")],1),e._v(" against its Table Schema; or as a means to validate data being collected or updated via a data entry interface.")]),e._v(" "),a("p",[e._v("All constraints "),a("code",[e._v("MUST")]),e._v(" be tested against the logical representation of data, and the physical representation of constraint values "),a("code",[e._v("MAY")]),e._v(" be primitive types as possible in JSON, or represented as strings that are castable with the "),a("code",[e._v("type")]),e._v(" and "),a("code",[e._v("format")]),e._v(" rules of the field.")]),e._v(" "),a("p",[e._v("A constraints descriptor "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" and "),a("code",[e._v("MAY")]),e._v(" contain one or more of the following"),a("br"),e._v("\nproperties.")]),e._v(" "),a("table",[a("tr",[a("th",[e._v("\n Property\n ")]),e._v(" "),a("th",[e._v("\n Type\n ")]),e._v(" "),a("th",[e._v("\n Applies to\n ")]),e._v(" "),a("th",[e._v("\n Description\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("required")])]),e._v(" "),a("td",[e._v("\n boolean\n ")]),e._v(" "),a("td",[e._v("\n All\n ")]),e._v(" "),a("td",[e._v("\n Indicates whether this field cannot be "),a("code",[e._v("null")]),e._v(". If required is "),a("code",[e._v("false")]),e._v(" (the default), then "),a("code",[e._v("null")]),e._v(" is allowed. See the section on "),a("code",[e._v("missingValues")]),e._v(" for how, in the physical representation of the data, strings can represent "),a("code",[e._v("null")]),e._v(" values.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("unique")])]),e._v(" "),a("td",[e._v("\n boolean\n ")]),e._v(" "),a("td",[e._v("\n All\n ")]),e._v(" "),a("td",[e._v("\n If "),a("code",[e._v("true")]),e._v(", then all values for that field MUST be unique within the data file in which it is found.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("minLength")])]),e._v(" "),a("td",[e._v("\n integer\n ")]),e._v(" "),a("td",[e._v("\n collections (string, array, object)\n ")]),e._v(" "),a("td",[e._v("\n An integer that specifies the minimum length of a value.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("maxLength")])]),e._v(" "),a("td",[e._v("\n integer\n ")]),e._v(" "),a("td",[e._v("\n collections (string, array, object)\n ")]),e._v(" "),a("td",[e._v("\n An integer that specifies the maximum length of a value.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("minimum")])]),e._v(" "),a("td",[e._v("\n integer, number, date, time and datetime, year, yearmonth\n ")]),e._v(" "),a("td",[a("code",[e._v("integer, number, date, time, datetime, year, yearmonth")])]),e._v(" "),a("td",[e._v("\n Specifies a minimum value for a field. This is different to "),a("code",[e._v("minLength")]),e._v(" which checks the number of items in the value. A "),a("code",[e._v("minimum")]),e._v(" value constraint checks whether a field value is greater than or equal to the specified value. The range checking depends on the "),a("code",[e._v("type")]),e._v(" of the field. E.g. an integer field may have a minimum value of 100; a date field might have a minimum date. If a "),a("code",[e._v("minimum")]),e._v(" value constraint is specified then the field descriptor "),a("code",[e._v("MUST")]),e._v(" contain a "),a("code",[e._v("type")]),e._v(" key.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("maximum")])]),e._v(" "),a("td",[e._v("\n integer, number, date, time and datetime, year, yearmonth\n ")]),e._v(" "),a("td",[a("code",[e._v("integer, number, date, time and datetime, year, yearmonth")])]),e._v(" "),a("td",[e._v("\n As for "),a("code",[e._v("minimum")]),e._v(", but specifies a maximum value for a field.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("pattern")])]),e._v(" "),a("td",[e._v("\n string\n ")]),e._v(" "),a("td",[a("code",[e._v("string")])]),e._v(" "),a("td",[e._v("\n A regular expression that can be used to test field values. If the regular expression matches then the value is valid. The values of this field "),a("code",[e._v("MUST")]),e._v(" conform to the standard "),a("a",{attrs:{href:"http://www.w3.org/TR/xmlschema-2/#regexs"}},[e._v("XML Schema regular expression syntax")]),e._v(".\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("enum")])]),e._v(" "),a("td",[e._v("\n array\n ")]),e._v(" "),a("td",[e._v("\n All\n ")]),e._v(" "),a("td",[e._v("\n The value of the field must exactly match a value in the "),a("code",[e._v("enum")]),e._v(" array.\n ")])])]),e._v(" "),a("p",[a("strong",[e._v("Implementors")]),e._v(":")]),e._v(" "),a("ul",[a("li",[e._v("Implementations "),a("code",[e._v("SHOULD")]),e._v(" report an error if an attempt is made to evaluate a value against an unsupported constraint.")]),e._v(" "),a("li",[e._v("A constraints descriptor may contain multiple constraints, in which case implementations "),a("code",[e._v("MUST")]),e._v(" apply all the constraints when determining if a field value is valid.")]),e._v(" "),a("li",[e._v("Constraints "),a("code",[e._v("MUST")]),e._v(" be applied on the logical representation of field values and constraint values.")])]),e._v(" "),a("h2",{attrs:{id:"other-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#other-properties"}},[e._v("#")]),e._v(" Other Properties")]),e._v(" "),a("p",[e._v("In additional to field descriptors, there are the following “table level” properties.")]),e._v(" "),a("h3",{attrs:{id:"missing-values"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-values"}},[e._v("#")]),e._v(" Missing Values")]),e._v(" "),a("p",[e._v("Many datasets arrive with missing data values, either because a value was not collected or it never existed. Missing values may be indicated simply by the value being empty in other cases a special value may have been used e.g. "),a("code",[e._v("-")]),e._v(", "),a("code",[e._v("NaN")]),e._v(", "),a("code",[e._v("0")]),e._v(", "),a("code",[e._v("-9999")]),e._v(" etc.")]),e._v(" "),a("p",[a("code",[e._v("missingValues")]),e._v(" dictates which string values should be treated as "),a("code",[e._v("null")]),e._v(" values. This conversion to "),a("code",[e._v("null")]),e._v(" is done before any other attempted type-specific string conversion."),a("br"),e._v("\nThe default value "),a("code",[e._v('[ "" ]')]),e._v(" means that empty strings will be converted to null before any other processing takes place."),a("br"),e._v("\nProviding the empty list "),a("code",[e._v("[]")]),e._v(" means that no conversion to null will be done, on any value.")]),e._v(" "),a("p",[a("code",[e._v("missingValues")]),e._v(" MUST be an "),a("code",[e._v("array")]),e._v(" where each entry is a "),a("code",[e._v("string")]),e._v(".")]),e._v(" "),a("p",[a("strong",[e._v("Why strings")]),e._v(": "),a("code",[e._v("missingValues")]),e._v(" are strings rather than being the data type of the particular field. This allows for comparison prior to casting and for fields to have missing value which are not of their type, for example a "),a("code",[e._v("number")]),e._v(" field to have missing values indicated by "),a("code",[e._v("-")]),e._v(".")]),e._v(" "),a("p",[e._v("Examples:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"-"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"NaN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"-"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("h3",{attrs:{id:"primary-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#primary-key"}},[e._v("#")]),e._v(" Primary Key")]),e._v(" "),a("p",[e._v("A primary key is a field or set of fields that uniquely identifies each row in"),a("br"),e._v("\nthe table. Per SQL standards, the fields cannot be "),a("code",[e._v("null")]),e._v(", so their use in the"),a("br"),e._v("\nprimary key is equivalent to adding "),a("code",[e._v("required: true")]),e._v(" to their"),a("br"),e._v(" "),a("a",{attrs:{href:"#constraints"}},[a("code",[e._v("constraints")])]),e._v(".")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("primaryKey")]),e._v(" entry in the schema "),a("code",[e._v("object")]),e._v(" is optional. If present it specifies"),a("br"),e._v("\nthe primary key for this table.")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("primaryKey")]),e._v(", if present, MUST be:")]),e._v(" "),a("ul",[a("li",[e._v("Either: an array of strings with each string corresponding to one of the"),a("br"),e._v("\nfield "),a("code",[e._v("name")]),e._v(" values in the "),a("code",[e._v("fields")]),e._v(" array (denoting that the primary key is"),a("br"),e._v("\nmade up of those fields). It is acceptable to have an array with a single"),a("br"),e._v("\nvalue (indicating just one field in the primary key). Strictly, order of"),a("br"),e._v("\nvalues in the array does not matter. However, it is RECOMMENDED that one"),a("br"),e._v("\nfollow the order the fields in the "),a("code",[e._v("fields")]),e._v(" has as client applications may"),a("br"),e._v("\nutilize the order of the primary key list (e.g. in concatenating values"),a("br"),e._v("\ntogether).")]),e._v(" "),a("li",[e._v("Or: a single string corresponding to one of the field "),a("code",[e._v("name")]),e._v(" values in"),a("br"),e._v("\nthe "),a("code",[e._v("fields")]),e._v(" array (indicating that this field is the primary key). Note that"),a("br"),e._v("\nthis version corresponds to the array form with a single value (and can be"),a("br"),e._v("\nseen as simply a more convenient way of specifying a single field primary"),a("br"),e._v("\nkey).")])]),e._v(" "),a("p",[e._v("Here’s an example:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(' "fields": [\n {\n "name": "a"\n },\n ...\n ],\n "primaryKey": "a"\n')])])]),a("p",[e._v("Here’s an example with an array primary key:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v('"schema": {\n "fields": [\n {\n "name": "a"\n },\n {\n "name": "b"\n },\n {\n "name": "c"\n },\n ...\n ],\n "primaryKey": ["a", "c"]\n }\n')])])]),a("h3",{attrs:{id:"foreign-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#foreign-keys"}},[e._v("#")]),e._v(" Foreign Keys")]),e._v(" "),a("p",[e._v("A foreign key is a reference where values in a field (or fields) on the"),a("br"),e._v("\ntable (‘resource’ in data package terminology) described by this Table Schema"),a("br"),e._v("\nconnect to values a field (or fields) on this or a separate table (resource)."),a("br"),e._v("\nThey are directly modelled on the concept of foreign keys in SQL.")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("foreignKeys")]),e._v(" property, if present, "),a("code",[e._v("MUST")]),e._v(" be an Array. Each entry in the"),a("br"),e._v("\narray must be a "),a("code",[e._v("foreignKey")]),e._v(". A "),a("code",[e._v("foreignKey")]),e._v(" "),a("code",[e._v("MUST")]),e._v(" be a "),a("code",[e._v("object")]),e._v(" and MUST have the following properties:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("fields")]),e._v(" - "),a("code",[e._v("fields")]),e._v(" is a string or array specifying the"),a("br"),e._v("\nfield or fields on this resource that form the source part of the foreign"),a("br"),e._v("\nkey. The structure of the string or array is as per "),a("code",[e._v("primaryKey")]),e._v(" above.")]),e._v(" "),a("li",[a("code",[e._v("reference")]),e._v(" - "),a("code",[e._v("reference")]),e._v(" MUST be a "),a("code",[e._v("object")]),e._v(". The "),a("code",[e._v("object")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("MUST")]),e._v(" have a property "),a("code",[e._v("resource")]),e._v(" which is the name of the resource within"),a("br"),e._v("\nthe current data package (i.e. the data package within which this Table"),a("br"),e._v("\nSchema is located). For self-referencing foreign keys, i.e. references"),a("br"),e._v("\nbetween fields in this Table Schema, the value of "),a("code",[e._v("resource")]),e._v(" "),a("code",[e._v("MUST")]),e._v(" be "),a("code",[e._v('""')]),a("br"),e._v("\n(i.e. the empty string).")]),e._v(" "),a("li",[a("code",[e._v("MUST")]),e._v(" have a property "),a("code",[e._v("fields")]),e._v(" which is a string if the outer "),a("code",[e._v("fields")]),e._v(" is a"),a("br"),e._v("\nstring, else an array of the same length as the outer "),a("code",[e._v("fields")]),e._v(", describing the"),a("br"),e._v("\nfield (or fields) references on the destination resource. The structure of"),a("br"),e._v("\nthe string or array is as per "),a("code",[e._v("primaryKey")]),e._v(" above.")])])])]),e._v(" "),a("p",[e._v("Here’s an example:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// these are resources inside a Data Package")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-codes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"code"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"population-by-state"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-code"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-code"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"reference"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resource"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-codes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"code"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n")])])]),a("p",[e._v("An example of a self-referencing foreign key:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"parent"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"id"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"parent"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"reference"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resource"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"id"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("p",[a("strong",[e._v("Comment")]),e._v(": Foreign Keys create links between one Table Schema and another Table Schema, and implicitly between the data tables described by those Table Schemas. If the foreign key is referring to another Table Schema how is that other Table Schema discovered? The answer is that a Table Schema will usually be embedded inside some larger descriptor for a dataset, in particular as the schema for a resource in the resources array of a "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-package/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Data Package"),a("OutboundLink")],1),e._v(". It is the use of Table Schema in this way that permits a meaningful use of a non-empty "),a("code",[e._v("resource")]),e._v(" property on the foreign key.")]),e._v(" "),a("h2",{attrs:{id:"appendix-related-work"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#appendix-related-work"}},[e._v("#")]),e._v(" Appendix: Related Work")]),e._v(" "),a("p",[e._v("Table Schema draws content and/or inspiration from, among others, the following specifications and implementations:")]),e._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes",target:"_blank",rel:"noopener noreferrer"}},[e._v("XML Schema"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"https://developers.google.com/bigquery/docs/import#loading_json_files",target:"_blank",rel:"noopener noreferrer"}},[e._v("Google BigQuery"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"http://json-schema.org",target:"_blank",rel:"noopener noreferrer"}},[e._v("JSON Schema"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"https://developers.google.com/public-data/docs/schema/dspl18",target:"_blank",rel:"noopener noreferrer"}},[e._v("DSPL"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"http://www.whatwg.org/specs/web-apps/current-work/#attr-input-typ",target:"_blank",rel:"noopener noreferrer"}},[e._v("HTML5 Forms"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"http://www.elasticsearch.org/guide/reference/mapping/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Elasticsearch"),a("OutboundLink")],1)])])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{396:function(e,t,a){"use strict";a.r(t);var s=a(26),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[e._v("#")]),e._v(" "+e._s(e.$page.frontmatter.title))]),e._v(" "),a("p",[e._v(e._s(e.$page.frontmatter.abstract))]),e._v(" "),a("MetadataTable"),e._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[e._v("#")]),e._v(" Language")]),e._v(" "),a("Language"),e._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),a("p",[e._v("Table Schema is a simple language- and implementation-agnostic way to declare a schema for tabular data. Table Schema is well suited for use cases around handling and validating tabular data in text formats such as CSV, but its utility extends well beyond this core usage, towards a range of applications where data benefits from a portable schema format.")]),e._v(" "),a("h3",{attrs:{id:"concepts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#concepts"}},[e._v("#")]),e._v(" Concepts")]),e._v(" "),a("h4",{attrs:{id:"tabular-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#tabular-data"}},[e._v("#")]),e._v(" Tabular data")]),e._v(" "),a("p",[e._v("Tabular data consists of a set of rows. Each row has a set of fields (columns). We usually expect that each row has the same set of fields and thus we can talk about "),a("em",[e._v("the")]),e._v(" fields for the table as a whole.")]),e._v(" "),a("p",[e._v("In case of tables in spreadsheets or CSV files we often interpret the first row as a header row, giving the names of the fields. By contrast, in other situations, e.g. tables in SQL databases, the field names are explicitly designated.")]),e._v(" "),a("p",[e._v("To illustrate, here’s a classic spreadsheet table:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v("field field\n | |\n | |\n V V\n\n A | B | C | D <--- Row (Header)\n ------------------------------------\n valA | valB | valC | valD <--- Row\n ...\n")])])]),a("p",[e._v("In JSON, a table would be:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v('[\n { "A": value, "B": value, ... },\n { "A": value, "B": value, ... },\n ...\n]\n')])])]),a("h4",{attrs:{id:"physical-and-logical-representation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#physical-and-logical-representation"}},[e._v("#")]),e._v(" Physical and logical representation")]),e._v(" "),a("p",[e._v("In order to talk about the representation and processing of tabular data from text-based sources, it is useful to introduce the concepts of the "),a("em",[e._v("physical")]),e._v(" and the "),a("em",[e._v("logical")]),e._v(" representation of data.")]),e._v(" "),a("p",[e._v("The "),a("em",[e._v("physical representation")]),e._v(" of data refers to the representation of data as text on disk, for example, in a CSV or JSON file. This representation may have some "),a("em",[e._v("type")]),e._v(" information (JSON, where the primitive types that JSON supports can be used) or not (CSV, where all data is represented in string form).")]),e._v(" "),a("p",[e._v("The "),a("em",[e._v("logical representation")]),e._v(" of data refers to the “ideal” representation of the data in terms of primitive types, data structures, and relations, all as defined by the specification. We could say that the specification is about the logical representation of data, as well as about ways in which to handle conversion of a physical representation to a logical one.")]),e._v(" "),a("p",[e._v("In this document, we’ll explicitly refer to either the "),a("em",[e._v("physical")]),e._v(" or "),a("em",[e._v("logical")]),e._v(" representation in places where it prevents ambiguity for those engaging with the specification, especially implementors.")]),e._v(" "),a("p",[e._v("For example, "),a("code",[e._v("constraints")]),e._v(" should be tested on the logical representation of data, whereas a property like "),a("code",[e._v("missingValues")]),e._v(" applies to the physical representation of the data.")]),e._v(" "),a("h2",{attrs:{id:"descriptor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor"}},[e._v("#")]),e._v(" Descriptor")]),e._v(" "),a("p",[e._v("A Table Schema is represented by a descriptor. The descriptor "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" (JSON is defined in "),a("a",{attrs:{href:"http://www.ietf.org/rfc/rfc4627.txt",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC 4627"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("p",[e._v("It "),a("code",[e._v("MUST")]),e._v(" contain a property "),a("code",[e._v("fields")]),e._v(". "),a("code",[e._v("fields")]),e._v(" "),a("code",[e._v("MUST")]),e._v(" be an array where each entry in the array is a field descriptor (as defined below). The order of elements in "),a("code",[e._v("fields")]),e._v(" array "),a("code",[e._v("SHOULD")]),e._v(" be the order of fields in the CSV file. The number of elements in "),a("code",[e._v("fields")]),e._v(" array "),a("code",[e._v("SHOULD")]),e._v(" be the same as the number of fields in the CSV file.")]),e._v(" "),a("p",[e._v("The descriptor "),a("code",[e._v("MAY")]),e._v(" have the additional properties set out below and "),a("code",[e._v("MAY")]),e._v(" contain any number of other properties (not defined in this specification).")]),e._v(" "),a("p",[e._v("The following is an illustration of this structure:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// fields is an ordered list of field descriptors")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// one for each field (column) in the table")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// a field-descriptor")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name of field (e.g. column name)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A nicer human readable label or title for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying the type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying a format"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"example"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"An example value for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A description for the field"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v(" more field descriptors\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// (optional) specification of missing values")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// (optional) specification of the primary key")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"primaryKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// (optional) specification of the foreign keys")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h2",{attrs:{id:"field-descriptors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#field-descriptors"}},[e._v("#")]),e._v(" Field Descriptors")]),e._v(" "),a("p",[e._v("A field descriptor "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" that describes a single field. The"),a("br"),e._v("\ndescriptor provides additional human-readable documentation for a field, as"),a("br"),e._v("\nwell as additional information that may be used to validate the field or create"),a("br"),e._v("\na user interface for data entry.")]),e._v(" "),a("p",[e._v("Here is an illustration:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name of field (e.g. column name)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A nicer human readable label or title for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying the type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A string specifying a format"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"example"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"An example value for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A description for the field"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"constraints"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// a constraints-descriptor")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[e._v("The field descriptor "),a("code",[e._v("object")]),e._v(" "),a("code",[e._v("MAY")]),e._v(" contain any number of other properties. Some specific properties are defined below. Of these, only the "),a("code",[e._v("name")]),e._v(" property is "),a("code",[e._v("REQUIRED")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#name"}},[e._v("#")]),e._v(" "),a("code",[e._v("name")])]),e._v(" "),a("p",[e._v("The field descriptor MUST contain a "),a("code",[e._v("name")]),e._v(" property. This property "),a("code",[e._v("SHOULD")]),e._v(" correspond to the name of field/column in the data file (if it has a name). As such it "),a("code",[e._v("SHOULD")]),e._v(" be unique (though it is possible, but very bad practice, for the data file to have multiple columns with the same name). "),a("code",[e._v("name")]),e._v(" "),a("code",[e._v("SHOULD NOT")]),e._v(" be considered case sensitive in determining uniqueness. However, since it should correspond to the name of the field in the data file it may be important to preserve case.")]),e._v(" "),a("h3",{attrs:{id:"title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#title"}},[e._v("#")]),e._v(" "),a("code",[e._v("title")])]),e._v(" "),a("p",[e._v("A human readable label or title for the field")]),e._v(" "),a("h3",{attrs:{id:"description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#description"}},[e._v("#")]),e._v(" "),a("code",[e._v("description")])]),e._v(" "),a("p",[e._v("A description for this field e.g. “The recipient of the funds”")]),e._v(" "),a("h3",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" "),a("code",[e._v("example")])]),e._v(" "),a("p",[e._v("An example value for the field")]),e._v(" "),a("h3",{attrs:{id:"types-and-formats"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#types-and-formats"}},[e._v("#")]),e._v(" Types and Formats")]),e._v(" "),a("p",[a("code",[e._v("type")]),e._v(" and "),a("code",[e._v("format")]),e._v(" properties are used to give The type of the field (string, number etc) - see below for"),a("br"),e._v("\nmore detail. If type is not provided a consumer should assume a type of"),a("br"),e._v("\n“string”.")]),e._v(" "),a("p",[e._v("A field’s "),a("code",[e._v("type")]),e._v(" property is a string indicating the type of this field.")]),e._v(" "),a("p",[e._v("A field’s "),a("code",[e._v("format")]),e._v(" property is a string, indicating a format for the field type.")]),e._v(" "),a("p",[e._v("Both "),a("code",[e._v("type")]),e._v(" and "),a("code",[e._v("format")]),e._v(" are optional: in a field descriptor, the absence of a"),a("br"),e._v(" "),a("code",[e._v("type")]),e._v(" property indicates that the field is of the type “string”, and the"),a("br"),e._v("\nabsence of a "),a("code",[e._v("format")]),e._v(" property indicates that the field’s type "),a("code",[e._v("format")]),e._v(" is"),a("br"),e._v("\n“default”.")]),e._v(" "),a("p",[e._v("Types are based on the "),a("a",{attrs:{href:"http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1",target:"_blank",rel:"noopener noreferrer"}},[e._v("type set of"),a("br"),e._v("\njson-schema"),a("OutboundLink")],1),a("br"),e._v("\nwith some additions and minor modifications (cf other type lists include"),a("br"),e._v("\nthose in "),a("a",{attrs:{href:"https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Elasticsearch"),a("br"),e._v("\ntypes"),a("OutboundLink")],1),e._v(").")]),e._v(" "),a("p",[e._v("The type list with associated formats and other related properties is as"),a("br"),e._v("\nfollows.")]),e._v(" "),a("h4",{attrs:{id:"string"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#string"}},[e._v("#")]),e._v(" string")]),e._v(" "),a("p",[e._v("The field contains strings, that is, sequences of characters.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": any valid string.")]),e._v(" "),a("li",[a("strong",[e._v("email")]),e._v(": A valid email address.")]),e._v(" "),a("li",[a("strong",[e._v("uri")]),e._v(": A valid URI.")]),e._v(" "),a("li",[a("strong",[e._v("binary")]),e._v(": A base64 encoded string representing binary data.")]),e._v(" "),a("li",[a("strong",[e._v("uuid")]),e._v(": A string that is a uuid.")])]),e._v(" "),a("h4",{attrs:{id:"number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#number"}},[e._v("#")]),e._v(" number")]),e._v(" "),a("p",[e._v("The field contains numbers of any kind including decimals.")]),e._v(" "),a("p",[e._v("The lexical formatting follows that of decimal in "),a("a",{attrs:{href:"https://www.w3.org/TR/xmlschema-2/#decimal",target:"_blank",rel:"noopener noreferrer"}},[e._v("XMLSchema"),a("OutboundLink")],1),e._v(": a"),a("br"),e._v("\nnon-empty finite-length sequence of decimal digits separated by a period as a"),a("br"),e._v("\ndecimal indicator. An optional leading sign is allowed. If the sign is omitted,"),a("br"),e._v("\n“+” is assumed. Leading and trailing zeroes are optional. If the fractional"),a("br"),e._v("\npart is zero, the period and following zero(es) can be omitted. For example:"),a("br"),e._v("\n‘-1.23’, ‘12678967.543233’, ‘+100000.00’, ‘210’.")]),e._v(" "),a("p",[e._v("The following special string values are permitted (case need not be respected):")]),e._v(" "),a("ul",[a("li",[e._v("NaN: not a number")]),e._v(" "),a("li",[e._v("INF: positive infinity")]),e._v(" "),a("li",[e._v("-INF: negative infinity")])]),e._v(" "),a("p",[e._v("A number MAY also have a trailing:")]),e._v(" "),a("ul",[a("li",[e._v("exponent: this MUST consist of an E followed by an optional + or - sign"),a("br"),e._v("\nfollowed by one or more decimal digits (0-9)")])]),e._v(" "),a("p",[e._v("This lexical formatting may be modified using these additional properties:")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("decimalChar")]),e._v(": A string whose value is used to represent a decimal point"),a("br"),e._v("\nwithin the number. The default value is “.”.")]),e._v(" "),a("li",[a("strong",[e._v("groupChar")]),e._v(": A string whose value is used to group digits within the"),a("br"),e._v("\nnumber. The default value is null. A common value is “,” e.g. “100,000”.")]),e._v(" "),a("li",[a("strong",[e._v("bareNumber")]),e._v(": a boolean field with a default of "),a("code",[e._v("true")]),e._v(". If "),a("code",[e._v("true")]),e._v(" the physical contents of this field must follow the formatting constraints already set out. If "),a("code",[e._v("false")]),e._v(" the contents of this field may contain leading and/or trailing non-numeric characters (which implementors MUST therefore strip). The purpose of "),a("code",[e._v("bareNumber")]),e._v(" is to allow publishers to publish numeric data that contains trailing characters such as percentages e.g. "),a("code",[e._v("95%")]),e._v(" or leading characters such as currencies e.g. "),a("code",[e._v("€95")]),e._v(" or "),a("code",[e._v("EUR 95")]),e._v(". Note that it is entirely up to implementors what, if anything, they do with stripped text.")])]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"integer"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#integer"}},[e._v("#")]),e._v(" integer")]),e._v(" "),a("p",[e._v("The field contains integers - that is whole numbers.")]),e._v(" "),a("p",[e._v("Integer values are indicated in the standard way for any valid integer.")]),e._v(" "),a("p",[e._v("Additional properties:")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("bareNumber")]),e._v(": a boolean field with a default of "),a("code",[e._v("true")]),e._v(". If "),a("code",[e._v("true")]),e._v(" the physical contents of this field must follow the formatting constraints already set out. If "),a("code",[e._v("false")]),e._v(" the contents of this field may contain leading and/or trailing non-numeric characters (which implementors MUST therefore strip). The purpose of "),a("code",[e._v("bareNumber")]),e._v(" is to allow publishers to publish numeric data that contains trailing characters such as percentages e.g. "),a("code",[e._v("95%")]),e._v(" or leading characters such as currencies e.g. "),a("code",[e._v("€95")]),e._v(" or "),a("code",[e._v("EUR 95")]),e._v(". Note that it is entirely up to implementors what, if anything, they do with stripped text.")])]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#boolean"}},[e._v("#")]),e._v(" boolean")]),e._v(" "),a("p",[e._v("The field contains boolean (true/false) data.")]),e._v(" "),a("p",[e._v("In the physical representations of data where boolean values are represented with strings, the values set in "),a("code",[e._v("trueValues")]),e._v(" and "),a("code",[e._v("falseValues")]),e._v(" are to be cast to their logical representation as booleans. "),a("code",[e._v("trueValues")]),e._v(" and "),a("code",[e._v("falseValues")]),e._v(" are arrays which can be customised to user need. The default values for these are in the additional properties section below.")]),e._v(" "),a("p",[e._v("The boolean field can be customised with these additional properties:")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("trueValues")]),e._v(": "),a("code",[e._v('[ "true", "True", "TRUE", "1" ]')])]),e._v(" "),a("li",[a("strong",[e._v("falseValues")]),e._v(": "),a("code",[e._v('[ "false", "False", "FALSE", "0" ]')])])]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"object"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#object"}},[e._v("#")]),e._v(" object")]),e._v(" "),a("p",[e._v("The field contains data which is valid JSON.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"array"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#array"}},[e._v("#")]),e._v(" array")]),e._v(" "),a("p",[e._v("The field contains data that is a valid JSON format arrays.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"date"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#date"}},[e._v("#")]),e._v(" date")]),e._v(" "),a("p",[e._v("A date without a time.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": An ISO8601 format string.\n"),a("ul",[a("li",[e._v("date: This MUST be in ISO8601 format YYYY-MM-DD")]),e._v(" "),a("li",[e._v("datetime: a date-time. This MUST be in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time")]),e._v(" "),a("li",[e._v("time: a time without a date")])])]),e._v(" "),a("li",[a("strong",[e._v("any")]),e._v(": Any parsable representation of the type. The implementing"),a("br"),e._v("\nlibrary can attempt to parse the datetime via a range of strategies."),a("br"),e._v("\nAn example is "),a("code",[e._v("dateutil.parser.parse")]),e._v(" from the "),a("code",[e._v("python-dateutils")]),a("br"),e._v("\nlibrary.")]),e._v(" "),a("li",[a("strong",[e._v("")]),e._v(": date/time values in this field can be parsed according to"),a("br"),e._v(" "),a("code",[e._v("")]),e._v(". "),a("code",[e._v("")]),e._v(" MUST follow the syntax of "),a("a",{attrs:{href:"https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior",target:"_blank",rel:"noopener noreferrer"}},[e._v("standard Python / C"),a("br"),e._v("\nstrptime"),a("OutboundLink")],1),e._v(". (That is, values in the this field should be parsable"),a("br"),e._v("\nby Python / C standard "),a("code",[e._v("strptime")]),e._v(" using "),a("code",[e._v("")]),e._v("). Example for "),a("code",[e._v('"format": "%d/%m/%y"')]),e._v(" which would correspond to dates like: "),a("code",[e._v("30/11/14")])])]),e._v(" "),a("h4",{attrs:{id:"time"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#time"}},[e._v("#")]),e._v(" time")]),e._v(" "),a("p",[e._v("A time without a date.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": An ISO8601 time string e.g. "),a("code",[e._v("hh:mm:ss")])]),e._v(" "),a("li",[a("strong",[e._v("any")]),e._v(": as for "),a("code",[e._v("date")])]),e._v(" "),a("li",[a("strong",[e._v("")]),e._v(": as for "),a("code",[e._v("date")])])]),e._v(" "),a("h4",{attrs:{id:"datetime"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#datetime"}},[e._v("#")]),e._v(" datetime")]),e._v(" "),a("p",[e._v("A date with a time.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": An ISO8601 format string e.g. "),a("code",[e._v("YYYY-MM-DDThh:mm:ssZ")]),e._v(" in UTC time")]),e._v(" "),a("li",[a("strong",[e._v("any")]),e._v(": as for "),a("code",[e._v("date")])]),e._v(" "),a("li",[a("strong",[e._v("")]),e._v(": as for "),a("code",[e._v("date")])])]),e._v(" "),a("h4",{attrs:{id:"year"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#year"}},[e._v("#")]),e._v(" year")]),e._v(" "),a("p",[e._v("A calendar year as per "),a("a",{attrs:{href:"https://www.w3.org/TR/xmlschema-2/#gYear",target:"_blank",rel:"noopener noreferrer"}},[e._v("XMLSchema "),a("code",[e._v("gYear")]),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("p",[e._v("Usual lexical representation is "),a("code",[e._v("YYYY")]),e._v(". There are no format options.")]),e._v(" "),a("h4",{attrs:{id:"yearmonth"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#yearmonth"}},[e._v("#")]),e._v(" yearmonth")]),e._v(" "),a("p",[e._v("A specific month in a specific year as per "),a("a",{attrs:{href:"https://www.w3.org/TR/xmlschema-2/#gYearMonth",target:"_blank",rel:"noopener noreferrer"}},[e._v("XMLSchema"),a("br"),e._v(" "),a("code",[e._v("gYearMonth")]),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("p",[e._v("Usual lexical representation is: "),a("code",[e._v("YYYY-MM")]),e._v(". There are no format options.")]),e._v(" "),a("h4",{attrs:{id:"duration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#duration"}},[e._v("#")]),e._v(" duration")]),e._v(" "),a("p",[e._v("A duration of time.")]),e._v(" "),a("p",[e._v("We follow the definition of "),a("a",{attrs:{href:"http://www.w3.org/TR/xmlschema-2/#duration",target:"_blank",rel:"noopener noreferrer"}},[e._v("XML Schema duration datatype"),a("OutboundLink")],1),e._v(" directly"),a("br"),e._v("\nand that definition is implicitly inlined here.")]),e._v(" "),a("p",[e._v("To summarize: the lexical representation for duration is the "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/ISO_8601#Durations",target:"_blank",rel:"noopener noreferrer"}},[e._v("ISO 8601"),a("OutboundLink")],1),a("br"),e._v("\nextended format PnYnMnDTnHnMnS, where nY represents the number of years, nM the"),a("br"),e._v("\nnumber of months, nD the number of days, ‘T’ is the date/time separator, nH the"),a("br"),e._v("\nnumber of hours, nM the number of minutes and nS the number of seconds. The"),a("br"),e._v("\nnumber of seconds can include decimal digits to arbitrary precision. Date and"),a("br"),e._v("\ntime elements including their designator may be omitted if their value is zero,"),a("br"),e._v("\nand lower order elements may also be omitted for reduced precision.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(": no options (other than the default).")]),e._v(" "),a("h4",{attrs:{id:"geopoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#geopoint"}},[e._v("#")]),e._v(" geopoint")]),e._v(" "),a("p",[e._v("The field contains data describing a geographic point.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": A string of the pattern “lon, lat”, where "),a("code",[e._v("lon")]),e._v(" is the longitude"),a("br"),e._v("\nand "),a("code",[e._v("lat")]),e._v(" is the latitude (note the space is optional after the "),a("code",[e._v(",")]),e._v("). E.g. "),a("code",[e._v('"90, 45"')]),e._v(".")]),e._v(" "),a("li",[a("strong",[e._v("array")]),e._v(": A JSON array, or a string parsable as a JSON array, of exactly two items, where each item is a number, and the first item is "),a("code",[e._v("lon")]),e._v(" and the second"),a("br"),e._v("\nitem is "),a("code",[e._v("lat")]),e._v(" e.g. "),a("code",[e._v("[90, 45]")])]),e._v(" "),a("li",[a("strong",[e._v("object")]),e._v(": A JSON object with exactly two keys, "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lon")]),e._v(" and each value is a number e.g. "),a("code",[e._v('{"lon": 90, "lat": 45}')])])]),e._v(" "),a("h4",{attrs:{id:"geojson"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#geojson"}},[e._v("#")]),e._v(" geojson")]),e._v(" "),a("p",[e._v("The field contains a JSON object according to GeoJSON or TopoJSON spec.")]),e._v(" "),a("p",[a("code",[e._v("format")]),e._v(":")]),e._v(" "),a("ul",[a("li",[a("strong",[e._v("default")]),e._v(": A geojson object as per the "),a("a",{attrs:{href:"http://geojson.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("GeoJSON spec"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("li",[a("strong",[e._v("topojson")]),e._v(": A topojson object as per the "),a("a",{attrs:{href:"https://github.com/topojson/topojson-specification/blob/master/README.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("TopoJSON spec"),a("OutboundLink")],1)])]),e._v(" "),a("h4",{attrs:{id:"any"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#any"}},[e._v("#")]),e._v(" any")]),e._v(" "),a("p",[e._v("Any "),a("code",[e._v("type")]),e._v(" or "),a("code",[e._v("format")]),e._v(" is accepted. When converting from physical to logical representation, the behaviour should be similar to String field type.")]),e._v(" "),a("h3",{attrs:{id:"rich-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rich-types"}},[e._v("#")]),e._v(" Rich Types")]),e._v(" "),a("p",[e._v("A richer, “semantic”, description of the “type” of data in a given column MAY"),a("br"),e._v("\nbe provided using a "),a("code",[e._v("rdfType")]),e._v(" property on a field descriptor.")]),e._v(" "),a("p",[e._v("The value of the "),a("code",[e._v("rdfType")]),e._v(" property MUST be the URI of a RDF Class, that is an instance or subclass of "),a("a",{attrs:{href:"https://www.w3.org/TR/rdf-schema/#ch_class",target:"_blank",rel:"noopener noreferrer"}},[e._v("RDF Schema Class object"),a("OutboundLink")],1)]),e._v(" "),a("p",[e._v("Here is an example using the "),a("a",{attrs:{href:"http://Schema.org",target:"_blank",rel:"noopener noreferrer"}},[e._v("Schema.org"),a("OutboundLink")],1),e._v(" RDF Class "),a("code",[e._v("http://schema.org/Country")]),e._v(":")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("| Country | Year Date | Value |\n| ------- | --------- | ----- |\n| US | 2010 | ... |\n")])])]),a("p",[e._v("The corresponding Table Schema is:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n fields"),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Country"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"string"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"rdfType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"http://schema.org/Country"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h3",{attrs:{id:"constraints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#constraints"}},[e._v("#")]),e._v(" Constraints")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("constraints")]),e._v(" property on Table Schema Fields can be used by consumers to list constraints for validating field values. For example, validating the data in a "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/tabular-data-resource/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Tabular Data Resource"),a("OutboundLink")],1),e._v(" against its Table Schema; or as a means to validate data being collected or updated via a data entry interface.")]),e._v(" "),a("p",[e._v("All constraints "),a("code",[e._v("MUST")]),e._v(" be tested against the logical representation of data, and the physical representation of constraint values "),a("code",[e._v("MAY")]),e._v(" be primitive types as possible in JSON, or represented as strings that are castable with the "),a("code",[e._v("type")]),e._v(" and "),a("code",[e._v("format")]),e._v(" rules of the field.")]),e._v(" "),a("p",[e._v("A constraints descriptor "),a("code",[e._v("MUST")]),e._v(" be a JSON "),a("code",[e._v("object")]),e._v(" and "),a("code",[e._v("MAY")]),e._v(" contain one or more of the following"),a("br"),e._v("\nproperties.")]),e._v(" "),a("table",[a("tr",[a("th",[e._v("\n Property\n ")]),e._v(" "),a("th",[e._v("\n Type\n ")]),e._v(" "),a("th",[e._v("\n Applies to\n ")]),e._v(" "),a("th",[e._v("\n Description\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("required")])]),e._v(" "),a("td",[e._v("\n boolean\n ")]),e._v(" "),a("td",[e._v("\n All\n ")]),e._v(" "),a("td",[e._v("\n Indicates whether this field cannot be "),a("code",[e._v("null")]),e._v(". If required is "),a("code",[e._v("false")]),e._v(" (the default), then "),a("code",[e._v("null")]),e._v(" is allowed. See the section on "),a("code",[e._v("missingValues")]),e._v(" for how, in the physical representation of the data, strings can represent "),a("code",[e._v("null")]),e._v(" values.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("unique")])]),e._v(" "),a("td",[e._v("\n boolean\n ")]),e._v(" "),a("td",[e._v("\n All\n ")]),e._v(" "),a("td",[e._v("\n If "),a("code",[e._v("true")]),e._v(", then all values for that field MUST be unique within the data file in which it is found.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("minLength")])]),e._v(" "),a("td",[e._v("\n integer\n ")]),e._v(" "),a("td",[e._v("\n collections (string, array, object)\n ")]),e._v(" "),a("td",[e._v("\n An integer that specifies the minimum length of a value.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("maxLength")])]),e._v(" "),a("td",[e._v("\n integer\n ")]),e._v(" "),a("td",[e._v("\n collections (string, array, object)\n ")]),e._v(" "),a("td",[e._v("\n An integer that specifies the maximum length of a value.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("minimum")])]),e._v(" "),a("td",[e._v("\n integer, number, date, time and datetime, year, yearmonth\n ")]),e._v(" "),a("td",[a("code",[e._v("integer, number, date, time, datetime, year, yearmonth")])]),e._v(" "),a("td",[e._v("\n Specifies a minimum value for a field. This is different to "),a("code",[e._v("minLength")]),e._v(" which checks the number of items in the value. A "),a("code",[e._v("minimum")]),e._v(" value constraint checks whether a field value is greater than or equal to the specified value. The range checking depends on the "),a("code",[e._v("type")]),e._v(" of the field. E.g. an integer field may have a minimum value of 100; a date field might have a minimum date. If a "),a("code",[e._v("minimum")]),e._v(" value constraint is specified then the field descriptor "),a("code",[e._v("MUST")]),e._v(" contain a "),a("code",[e._v("type")]),e._v(" key.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("maximum")])]),e._v(" "),a("td",[e._v("\n integer, number, date, time and datetime, year, yearmonth\n ")]),e._v(" "),a("td",[a("code",[e._v("integer, number, date, time and datetime, year, yearmonth")])]),e._v(" "),a("td",[e._v("\n As for "),a("code",[e._v("minimum")]),e._v(", but specifies a maximum value for a field.\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("pattern")])]),e._v(" "),a("td",[e._v("\n string\n ")]),e._v(" "),a("td",[a("code",[e._v("string")])]),e._v(" "),a("td",[e._v("\n A regular expression that can be used to test field values. If the regular expression matches then the value is valid. The values of this field "),a("code",[e._v("MUST")]),e._v(" conform to the standard "),a("a",{attrs:{href:"http://www.w3.org/TR/xmlschema-2/#regexs"}},[e._v("XML Schema regular expression syntax")]),e._v(".\n ")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("enum")])]),e._v(" "),a("td",[e._v("\n array\n ")]),e._v(" "),a("td",[e._v("\n All\n ")]),e._v(" "),a("td",[e._v("\n The value of the field must exactly match a value in the "),a("code",[e._v("enum")]),e._v(" array.\n ")])])]),e._v(" "),a("p",[a("strong",[e._v("Implementors")]),e._v(":")]),e._v(" "),a("ul",[a("li",[e._v("Implementations "),a("code",[e._v("SHOULD")]),e._v(" report an error if an attempt is made to evaluate a value against an unsupported constraint.")]),e._v(" "),a("li",[e._v("A constraints descriptor may contain multiple constraints, in which case implementations "),a("code",[e._v("MUST")]),e._v(" apply all the constraints when determining if a field value is valid.")]),e._v(" "),a("li",[e._v("Constraints "),a("code",[e._v("MUST")]),e._v(" be applied on the logical representation of field values and constraint values.")])]),e._v(" "),a("h2",{attrs:{id:"other-properties"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#other-properties"}},[e._v("#")]),e._v(" Other Properties")]),e._v(" "),a("p",[e._v("In additional to field descriptors, there are the following “table level” properties.")]),e._v(" "),a("h3",{attrs:{id:"missing-values"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-values"}},[e._v("#")]),e._v(" Missing Values")]),e._v(" "),a("p",[e._v("Many datasets arrive with missing data values, either because a value was not collected or it never existed. Missing values may be indicated simply by the value being empty in other cases a special value may have been used e.g. "),a("code",[e._v("-")]),e._v(", "),a("code",[e._v("NaN")]),e._v(", "),a("code",[e._v("0")]),e._v(", "),a("code",[e._v("-9999")]),e._v(" etc.")]),e._v(" "),a("p",[a("code",[e._v("missingValues")]),e._v(" dictates which string values should be treated as "),a("code",[e._v("null")]),e._v(" values. This conversion to "),a("code",[e._v("null")]),e._v(" is done before any other attempted type-specific string conversion."),a("br"),e._v("\nThe default value "),a("code",[e._v('[ "" ]')]),e._v(" means that empty strings will be converted to null before any other processing takes place."),a("br"),e._v("\nProviding the empty list "),a("code",[e._v("[]")]),e._v(" means that no conversion to null will be done, on any value.")]),e._v(" "),a("p",[a("code",[e._v("missingValues")]),e._v(" MUST be an "),a("code",[e._v("array")]),e._v(" where each entry is a "),a("code",[e._v("string")]),e._v(".")]),e._v(" "),a("p",[a("strong",[e._v("Why strings")]),e._v(": "),a("code",[e._v("missingValues")]),e._v(" are strings rather than being the data type of the particular field. This allows for comparison prior to casting and for fields to have missing value which are not of their type, for example a "),a("code",[e._v("number")]),e._v(" field to have missing values indicated by "),a("code",[e._v("-")]),e._v(".")]),e._v(" "),a("p",[e._v("Examples:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"-"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missingValues"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"NaN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"-"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("h3",{attrs:{id:"primary-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#primary-key"}},[e._v("#")]),e._v(" Primary Key")]),e._v(" "),a("p",[e._v("A primary key is a field or set of fields that uniquely identifies each row in"),a("br"),e._v("\nthe table. Per SQL standards, the fields cannot be "),a("code",[e._v("null")]),e._v(", so their use in the"),a("br"),e._v("\nprimary key is equivalent to adding "),a("code",[e._v("required: true")]),e._v(" to their"),a("br"),e._v(" "),a("a",{attrs:{href:"#constraints"}},[a("code",[e._v("constraints")])]),e._v(".")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("primaryKey")]),e._v(" entry in the schema "),a("code",[e._v("object")]),e._v(" is optional. If present it specifies"),a("br"),e._v("\nthe primary key for this table.")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("primaryKey")]),e._v(", if present, MUST be:")]),e._v(" "),a("ul",[a("li",[e._v("Either: an array of strings with each string corresponding to one of the"),a("br"),e._v("\nfield "),a("code",[e._v("name")]),e._v(" values in the "),a("code",[e._v("fields")]),e._v(" array (denoting that the primary key is"),a("br"),e._v("\nmade up of those fields). It is acceptable to have an array with a single"),a("br"),e._v("\nvalue (indicating just one field in the primary key). Strictly, order of"),a("br"),e._v("\nvalues in the array does not matter. However, it is RECOMMENDED that one"),a("br"),e._v("\nfollow the order the fields in the "),a("code",[e._v("fields")]),e._v(" has as client applications may"),a("br"),e._v("\nutilize the order of the primary key list (e.g. in concatenating values"),a("br"),e._v("\ntogether).")]),e._v(" "),a("li",[e._v("Or: a single string corresponding to one of the field "),a("code",[e._v("name")]),e._v(" values in"),a("br"),e._v("\nthe "),a("code",[e._v("fields")]),e._v(" array (indicating that this field is the primary key). Note that"),a("br"),e._v("\nthis version corresponds to the array form with a single value (and can be"),a("br"),e._v("\nseen as simply a more convenient way of specifying a single field primary"),a("br"),e._v("\nkey).")])]),e._v(" "),a("p",[e._v("Here’s an example:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v(' "fields": [\n {\n "name": "a"\n },\n ...\n ],\n "primaryKey": "a"\n')])])]),a("p",[e._v("Here’s an example with an array primary key:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v('"schema": {\n "fields": [\n {\n "name": "a"\n },\n {\n "name": "b"\n },\n {\n "name": "c"\n },\n ...\n ],\n "primaryKey": ["a", "c"]\n }\n')])])]),a("h3",{attrs:{id:"foreign-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#foreign-keys"}},[e._v("#")]),e._v(" Foreign Keys")]),e._v(" "),a("p",[e._v("A foreign key is a reference where values in a field (or fields) on the"),a("br"),e._v("\ntable (‘resource’ in data package terminology) described by this Table Schema"),a("br"),e._v("\nconnect to values a field (or fields) on this or a separate table (resource)."),a("br"),e._v("\nThey are directly modelled on the concept of foreign keys in SQL.")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("foreignKeys")]),e._v(" property, if present, "),a("code",[e._v("MUST")]),e._v(" be an Array. Each entry in the"),a("br"),e._v("\narray must be a "),a("code",[e._v("foreignKey")]),e._v(". A "),a("code",[e._v("foreignKey")]),e._v(" "),a("code",[e._v("MUST")]),e._v(" be a "),a("code",[e._v("object")]),e._v(" and MUST have the following properties:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("fields")]),e._v(" - "),a("code",[e._v("fields")]),e._v(" is a string or array specifying the"),a("br"),e._v("\nfield or fields on this resource that form the source part of the foreign"),a("br"),e._v("\nkey. The structure of the string or array is as per "),a("code",[e._v("primaryKey")]),e._v(" above.")]),e._v(" "),a("li",[a("code",[e._v("reference")]),e._v(" - "),a("code",[e._v("reference")]),e._v(" MUST be a "),a("code",[e._v("object")]),e._v(". The "),a("code",[e._v("object")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("MUST")]),e._v(" have a property "),a("code",[e._v("resource")]),e._v(" which is the name of the resource within"),a("br"),e._v("\nthe current data package (i.e. the data package within which this Table"),a("br"),e._v("\nSchema is located). For self-referencing foreign keys, i.e. references"),a("br"),e._v("\nbetween fields in this Table Schema, the value of "),a("code",[e._v("resource")]),e._v(" "),a("code",[e._v("MUST")]),e._v(" be "),a("code",[e._v('""')]),a("br"),e._v("\n(i.e. the empty string).")]),e._v(" "),a("li",[a("code",[e._v("MUST")]),e._v(" have a property "),a("code",[e._v("fields")]),e._v(" which is a string if the outer "),a("code",[e._v("fields")]),e._v(" is a"),a("br"),e._v("\nstring, else an array of the same length as the outer "),a("code",[e._v("fields")]),e._v(", describing the"),a("br"),e._v("\nfield (or fields) references on the destination resource. The structure of"),a("br"),e._v("\nthe string or array is as per "),a("code",[e._v("primaryKey")]),e._v(" above.")])])])]),e._v(" "),a("p",[e._v("Here’s an example:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("// these are resources inside a Data Package")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-codes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"code"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"population-by-state"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-code"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-code"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"reference"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resource"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"state-codes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"code"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v("...")]),e._v("\n")])])]),a("p",[e._v("An example of a self-referencing foreign key:")]),e._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"parent"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"id"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"foreignKeys"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"parent"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"reference"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"resource"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"id"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("p",[a("strong",[e._v("Comment")]),e._v(": Foreign Keys create links between one Table Schema and another Table Schema, and implicitly between the data tables described by those Table Schemas. If the foreign key is referring to another Table Schema how is that other Table Schema discovered? The answer is that a Table Schema will usually be embedded inside some larger descriptor for a dataset, in particular as the schema for a resource in the resources array of a "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-package/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Data Package"),a("OutboundLink")],1),e._v(". It is the use of Table Schema in this way that permits a meaningful use of a non-empty "),a("code",[e._v("resource")]),e._v(" property on the foreign key.")]),e._v(" "),a("h2",{attrs:{id:"appendix-related-work"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#appendix-related-work"}},[e._v("#")]),e._v(" Appendix: Related Work")]),e._v(" "),a("p",[e._v("Table Schema draws content and/or inspiration from, among others, the following specifications and implementations:")]),e._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes",target:"_blank",rel:"noopener noreferrer"}},[e._v("XML Schema"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"https://developers.google.com/bigquery/docs/import#loading_json_files",target:"_blank",rel:"noopener noreferrer"}},[e._v("Google BigQuery"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"http://json-schema.org",target:"_blank",rel:"noopener noreferrer"}},[e._v("JSON Schema"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"https://developers.google.com/public-data/docs/schema/dspl18",target:"_blank",rel:"noopener noreferrer"}},[e._v("DSPL"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"http://www.whatwg.org/specs/web-apps/current-work/#attr-input-typ",target:"_blank",rel:"noopener noreferrer"}},[e._v("HTML5 Forms"),a("OutboundLink")],1)]),e._v(" "),a("li",[a("a",{attrs:{href:"http://www.elasticsearch.org/guide/reference/mapping/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Elasticsearch"),a("OutboundLink")],1)])])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/28.ec459688.js b/assets/js/28.64dcc20f.js similarity index 99% rename from assets/js/28.ec459688.js rename to assets/js/28.64dcc20f.js index 3f4a2895..7a3b2663 100644 --- a/assets/js/28.ec459688.js +++ b/assets/js/28.64dcc20f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{399:function(a,t,s){"use strict";s.r(t);var e=s(26),r=Object(e.a)({},(function(){var a=this,t=a.$createElement,s=a._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h1",{attrs:{id:"page-frontmatter-title"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[a._v("#")]),a._v(" "+a._s(a.$page.frontmatter.title))]),a._v(" "),s("p",[a._v(a._s(a.$page.frontmatter.abstract))]),a._v(" "),s("MetadataTable"),a._v(" "),s("h2",{attrs:{id:"language"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[a._v("#")]),a._v(" Language")]),a._v(" "),s("Language"),a._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),s("p",[a._v("Tabular Data Package is a simple container format used for publishing and sharing tabular-style data. The format’s focus is on simplicity and ease of use, especially online. In addition, the format is focused on data that can be presented in a tabular structure and in making it easy to produce (and consume) tabular data packages from spreadsheets and relational databases.")]),a._v(" "),s("p",[a._v("The key features of this format are the following:")]),a._v(" "),s("ul",[s("li",[a._v("CSV (comma separated variables) for data files")]),a._v(" "),s("li",[a._v("Single JSON file (datapackage.json) to describe the dataset including a schema for data files")]),a._v(" "),s("li",[a._v("Reuse of existing work including other Frictionless Data specifications")])]),a._v(" "),s("p",[a._v("As suggested by the name, Tabular Data Package extends and specializes the "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package")]),a._v(" spec for the specific case where the data is tabular.")],1),a._v(" "),s("h3",{attrs:{id:"why-csv"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#why-csv"}},[a._v("#")]),a._v(" Why CSV")]),a._v(" "),s("p",[a._v("We chose CSV as the data format for the Tabular Data Package specification because:")]),a._v(" "),s("ol",[s("li",[a._v("CSV is very simple – it is possibly "),s("em",[a._v("the")]),a._v(" most simple data format")]),a._v(" "),s("li",[a._v("CSV is tabular-oriented. Most data structures are either tabular or can be transformed to a tabular structure by some form of normalization")]),a._v(" "),s("li",[a._v("It is open and the “standard” is well-known")]),a._v(" "),s("li",[a._v("It is widely supported - practically every spreadsheet program, relational database and programming language in existence can handle CSV in some form or other")]),a._v(" "),s("li",[a._v("It is text-based and therefore amenable to manipulation and access from a wide range of standard tools (including revision control systems such as git, mercurial and subversion)")]),a._v(" "),s("li",[a._v("It is line-oriented which means it can be incrementally processed - you do not need to read an entire file to extract a single row. For similar reasons it means that the format supports streaming.")])]),a._v(" "),s("p",[a._v("More informally:")]),a._v(" "),s("blockquote",[s("p",[a._v("CSV is the data Kalashnikov: not pretty, but many wars have been"),s("br"),a._v("\nfought with it and kids can use it."),s("br"),a._v("\n["),s("a",{attrs:{href:"https://twitter.com/pudo/status/248473299741446144",target:"_blank",rel:"noopener noreferrer"}},[a._v("@pudo"),s("OutboundLink")],1),a._v(" (Friedrich"),s("br"),a._v("\nLindenberg)]")])]),a._v(" "),s("blockquote",[s("p",[a._v("CSV is the ultimate simple, standard data format - streamable,"),s("br"),a._v("\ntext-based, no need for proprietary tools etc [@rufuspollock (Rufus"),s("br"),a._v("\nPollock)]")])]),a._v(" "),s("h2",{attrs:{id:"specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[a._v("#")]),a._v(" Specification")]),a._v(" "),s("p",[a._v("Tabular Data Package builds directly on the "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package")]),a._v(" specification. Thus a Tabular Data Package "),s("code",[a._v("MUST")]),a._v(" be a Data Package and conform to the "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package specification")]),a._v(".")],1),a._v(" "),s("p",[a._v("Tabular Data Package has the following requirements over and above those imposed by "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package")]),a._v(":")],1),a._v(" "),s("ul",[s("li",[a._v("There "),s("code",[a._v("MUST")]),a._v(" be at least one "),s("code",[a._v("resource")]),a._v(" in the "),s("code",[a._v("resources")]),a._v(" "),s("code",[a._v("array")])]),a._v(" "),s("li",[a._v("There "),s("code",[a._v("MUST")]),a._v(" be a "),s("code",[a._v("profile")]),a._v(" property with the value "),s("code",[a._v("tabular-data-package")])]),a._v(" "),s("li",[a._v("Each "),s("code",[a._v("resource")]),a._v(" "),s("code",[a._v("MUST")]),a._v(" be a "),s("RouterLink",{attrs:{to:"/tabular-data-resource/"}},[a._v("Tabular Data Resource")])],1)]),a._v(" "),s("h3",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[a._v("#")]),a._v(" Example")]),a._v(" "),s("p",[a._v("Here’s an example of a minimal tabular data package:")]),a._v(" "),s("p",[a._v("On disk we have 2 files:")]),a._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("data.csv\ndatapackage.json\n")])])]),s("p",[s("code",[a._v("data.csv")]),a._v(" looks like:")]),a._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("var1,var2,var3\nA,1,2.1\nB,3,4.5\n")])])]),s("p",[s("code",[a._v("datapackage.json")]),a._v(" looks like:")]),a._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"profile"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tabular-data-package"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"my-dataset"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("// here we list the data files in this dataset")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"resources"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"profile"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tabular-data-resource"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"data"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"data.csv"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"schema"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fields"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"var1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"string"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"var2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"integer"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"var3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"number"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n")])])])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{397:function(a,t,s){"use strict";s.r(t);var e=s(26),r=Object(e.a)({},(function(){var a=this,t=a.$createElement,s=a._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h1",{attrs:{id:"page-frontmatter-title"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[a._v("#")]),a._v(" "+a._s(a.$page.frontmatter.title))]),a._v(" "),s("p",[a._v(a._s(a.$page.frontmatter.abstract))]),a._v(" "),s("MetadataTable"),a._v(" "),s("h2",{attrs:{id:"language"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[a._v("#")]),a._v(" Language")]),a._v(" "),s("Language"),a._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),s("p",[a._v("Tabular Data Package is a simple container format used for publishing and sharing tabular-style data. The format’s focus is on simplicity and ease of use, especially online. In addition, the format is focused on data that can be presented in a tabular structure and in making it easy to produce (and consume) tabular data packages from spreadsheets and relational databases.")]),a._v(" "),s("p",[a._v("The key features of this format are the following:")]),a._v(" "),s("ul",[s("li",[a._v("CSV (comma separated variables) for data files")]),a._v(" "),s("li",[a._v("Single JSON file (datapackage.json) to describe the dataset including a schema for data files")]),a._v(" "),s("li",[a._v("Reuse of existing work including other Frictionless Data specifications")])]),a._v(" "),s("p",[a._v("As suggested by the name, Tabular Data Package extends and specializes the "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package")]),a._v(" spec for the specific case where the data is tabular.")],1),a._v(" "),s("h3",{attrs:{id:"why-csv"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#why-csv"}},[a._v("#")]),a._v(" Why CSV")]),a._v(" "),s("p",[a._v("We chose CSV as the data format for the Tabular Data Package specification because:")]),a._v(" "),s("ol",[s("li",[a._v("CSV is very simple – it is possibly "),s("em",[a._v("the")]),a._v(" most simple data format")]),a._v(" "),s("li",[a._v("CSV is tabular-oriented. Most data structures are either tabular or can be transformed to a tabular structure by some form of normalization")]),a._v(" "),s("li",[a._v("It is open and the “standard” is well-known")]),a._v(" "),s("li",[a._v("It is widely supported - practically every spreadsheet program, relational database and programming language in existence can handle CSV in some form or other")]),a._v(" "),s("li",[a._v("It is text-based and therefore amenable to manipulation and access from a wide range of standard tools (including revision control systems such as git, mercurial and subversion)")]),a._v(" "),s("li",[a._v("It is line-oriented which means it can be incrementally processed - you do not need to read an entire file to extract a single row. For similar reasons it means that the format supports streaming.")])]),a._v(" "),s("p",[a._v("More informally:")]),a._v(" "),s("blockquote",[s("p",[a._v("CSV is the data Kalashnikov: not pretty, but many wars have been"),s("br"),a._v("\nfought with it and kids can use it."),s("br"),a._v("\n["),s("a",{attrs:{href:"https://twitter.com/pudo/status/248473299741446144",target:"_blank",rel:"noopener noreferrer"}},[a._v("@pudo"),s("OutboundLink")],1),a._v(" (Friedrich"),s("br"),a._v("\nLindenberg)]")])]),a._v(" "),s("blockquote",[s("p",[a._v("CSV is the ultimate simple, standard data format - streamable,"),s("br"),a._v("\ntext-based, no need for proprietary tools etc [@rufuspollock (Rufus"),s("br"),a._v("\nPollock)]")])]),a._v(" "),s("h2",{attrs:{id:"specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[a._v("#")]),a._v(" Specification")]),a._v(" "),s("p",[a._v("Tabular Data Package builds directly on the "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package")]),a._v(" specification. Thus a Tabular Data Package "),s("code",[a._v("MUST")]),a._v(" be a Data Package and conform to the "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package specification")]),a._v(".")],1),a._v(" "),s("p",[a._v("Tabular Data Package has the following requirements over and above those imposed by "),s("RouterLink",{attrs:{to:"/data-package/"}},[a._v("Data Package")]),a._v(":")],1),a._v(" "),s("ul",[s("li",[a._v("There "),s("code",[a._v("MUST")]),a._v(" be at least one "),s("code",[a._v("resource")]),a._v(" in the "),s("code",[a._v("resources")]),a._v(" "),s("code",[a._v("array")])]),a._v(" "),s("li",[a._v("There "),s("code",[a._v("MUST")]),a._v(" be a "),s("code",[a._v("profile")]),a._v(" property with the value "),s("code",[a._v("tabular-data-package")])]),a._v(" "),s("li",[a._v("Each "),s("code",[a._v("resource")]),a._v(" "),s("code",[a._v("MUST")]),a._v(" be a "),s("RouterLink",{attrs:{to:"/tabular-data-resource/"}},[a._v("Tabular Data Resource")])],1)]),a._v(" "),s("h3",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[a._v("#")]),a._v(" Example")]),a._v(" "),s("p",[a._v("Here’s an example of a minimal tabular data package:")]),a._v(" "),s("p",[a._v("On disk we have 2 files:")]),a._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("data.csv\ndatapackage.json\n")])])]),s("p",[s("code",[a._v("data.csv")]),a._v(" looks like:")]),a._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[a._v("var1,var2,var3\nA,1,2.1\nB,3,4.5\n")])])]),s("p",[s("code",[a._v("datapackage.json")]),a._v(" looks like:")]),a._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"profile"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tabular-data-package"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"my-dataset"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("// here we list the data files in this dataset")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"resources"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"profile"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tabular-data-resource"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"data"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"path"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"data.csv"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"schema"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fields"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"var1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"string"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"var2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"integer"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"var3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"number"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n")])])])],1)}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/29.d686a7b6.js b/assets/js/29.814104b2.js similarity index 99% rename from assets/js/29.d686a7b6.js rename to assets/js/29.814104b2.js index 2e113f4c..11ac34c7 100644 --- a/assets/js/29.d686a7b6.js +++ b/assets/js/29.814104b2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{398:function(t,s,a){"use strict";a.r(s);var e=a(26),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("A "),a("strong",[t._v("Tabular Data Resource")]),t._v(" is a type of "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource"),a("OutboundLink")],1),t._v(" specialized for describing tabular data like CSV files or spreadsheets.")]),t._v(" "),a("p",[t._v("Tabular Data Resource extends "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource"),a("OutboundLink")],1),t._v(" in following key ways:")]),t._v(" "),a("ul",[a("li",[t._v("The "),a("code",[t._v("schema")]),t._v(" property MUST follow the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/table-schema/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Table Schema"),a("OutboundLink")],1),t._v(" specification,"),a("br"),t._v("\neither as a JSON object directly under the property, or a string referencing another"),a("br"),t._v("\nJSON document containing the Table Schema")]),t._v(" "),a("li",[t._v("A new "),a("code",[t._v("dialect")]),t._v(" property to describe the CSV dialect. This property follows the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/csv-dialect/",target:"_blank",rel:"noopener noreferrer"}},[t._v("CSV Dialect"),a("OutboundLink")],1),t._v(" specification.")])]),t._v(" "),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("A minimal Tabular Data Resource, referencing external JSON documents, looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// with data and a schema accessible via the local filesystem")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-path.csv"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tableschema.json"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// with data accessible via http")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/resource-path.csv"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/tableschema.json"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dialect"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/csvdialect.json"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A minimal Tabular Data Resource example using the data property to inline data looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"first_name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Louise"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"first_name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Julia"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"first_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"primaryKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A comprehensive Tabular Data Resource example with all required, recommended and optional properties looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"solar-system"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/solar-system.csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Solar System"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My favourite data about the solar system."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mediatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"encoding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"utf-8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bytes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"primaryKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dialect"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"delimiter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('";"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"doubleQuote"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Solar System - 2001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/solar-system-2001.json"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"email"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CC-BY-4.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Creative Commons Attribution 4.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://creativecommons.org/licenses/by/4.0/"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[t._v("#")]),t._v(" Specification")]),t._v(" "),a("p",[t._v("A Tabular Data Resource MUST be a "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource"),a("OutboundLink")],1),t._v(", that is it MUST conform to the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource specification"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("In addition:")]),t._v(" "),a("ul",[a("li",[t._v("The Data Resource "),a("code",[t._v("schema")]),t._v(" property MUST follow the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/table-schema/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Table Schema"),a("OutboundLink")],1),t._v(" specification,"),a("br"),t._v("\neither as a JSON object directly under the property, or a string referencing another"),a("br"),t._v("\nJSON document containing the Table Schema")])]),t._v(" "),a("ul",[a("li",[t._v("There "),a("code",[t._v("MUST")]),t._v(" be a "),a("code",[t._v("profile")]),t._v(" property with the value "),a("code",[t._v("tabular-data-resource")])])]),t._v(" "),a("ul",[a("li",[t._v("The data the Data Resource describes MUST:\n"),a("ul",[a("li",[t._v("If non-inline: Be a CSV file")]),t._v(" "),a("li",[t._v("If inline data: be “JSON tabular data” that is array of data rows where each row is an "),a("code",[t._v("array")]),t._v(" or "),a("code",[t._v("object")]),t._v(" (see below)")])])])]),t._v(" "),a("h3",{attrs:{id:"csv-file-requirements"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-file-requirements"}},[t._v("#")]),t._v(" CSV file requirements")]),t._v(" "),a("p",[t._v("CSV files in the wild come in a bewildering array of formats. There is a standard for CSV files described in "),a("a",{attrs:{href:"https://tools.ietf.org/html/rfc4180",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC 4180"),a("OutboundLink")],1),t._v(", but unfortunately this standard does not reflect reality. In Tabular Data Resource, CSV files "),a("code",[t._v("MUST")]),t._v(" follow RFC 4180 with the following important exceptions allowed:")]),t._v(" "),a("h4",{attrs:{id:"file-encoding"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file-encoding"}},[t._v("#")]),t._v(" File encoding")]),t._v(" "),a("p",[t._v("Files MUST:")]),t._v(" "),a("ul",[a("li",[t._v("EITHER be encoded as UTF-8 (the default)")]),t._v(" "),a("li",[t._v("OR the Tabular Data Resource MUST include an "),a("code",[t._v("encoding")]),t._v(" property and the files "),a("code",[t._v("MUST")]),t._v(" follow that encoding")])]),t._v(" "),a("p",[t._v("NB: the RFC requires 7-bit ASCII encoding.")]),t._v(" "),a("h4",{attrs:{id:"csv-dialect"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-dialect"}},[t._v("#")]),t._v(" CSV Dialect")]),t._v(" "),a("p",[t._v("The line terminator character "),a("code",[t._v("MUST")]),t._v(" be LF or CRLF (the RFC allows CRLF only).")]),t._v(" "),a("p",[t._v("If the CSV differs from this or the RFC in any other way regarding dialect (e.g. line terminators, quote characters, field delimiters), the Tabular Data Resource MUST contain a "),a("code",[t._v("dialect")]),t._v(" property describing its dialect. The "),a("code",[t._v("dialect")]),t._v(" property MUST follow the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/csv-dialect/",target:"_blank",rel:"noopener noreferrer"}},[t._v("CSV Dialect"),a("OutboundLink")],1),t._v(" specification.")]),t._v(" "),a("p",[t._v("The value for the "),a("code",[t._v("dialect")]),t._v(" property on a "),a("code",[t._v("resource")]),t._v(" MUST be an "),a("code",[t._v("object")]),t._v(" representing the dialect OR a "),a("code",[t._v("string")]),t._v(" that identifies the location of the dialect.")]),t._v(" "),a("p",[t._v("If a "),a("code",[t._v("string")]),t._v(" it must be a "),a("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(", that is a fully qualified http URL or a relative POSIX path. The file at the the location specified by this url-or-path string "),a("code",[t._v("MUST")]),t._v(" be a JSON document containing the dialect.")],1),t._v(" "),a("h3",{attrs:{id:"json-tabular-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-tabular-data"}},[t._v("#")]),t._v(" JSON Tabular Data")]),t._v(" "),a("p",[t._v("JSON Tabular Data MUST be an "),a("code",[t._v("array")]),t._v(" where each item in the array MUST be:")]),t._v(" "),a("ul",[a("li",[t._v("EITHER: an array where each entry in the array is the value for that cell in the table")]),t._v(" "),a("li",[t._v("OR: an object where each key corresponds to the header for that row and the value corresponds to the cell value for that row for that header")])]),t._v(" "),a("h4",{attrs:{id:"row-arrays"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#row-arrays"}},[t._v("#")]),t._v(" Row Arrays")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"B"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"C"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),a("h4",{attrs:{id:"row-objects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#row-objects"}},[t._v("#")]),t._v(" Row Objects")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"B"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"C"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"B"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"C"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])],1)}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{399:function(t,s,a){"use strict";a.r(s);var e=a(26),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("A "),a("strong",[t._v("Tabular Data Resource")]),t._v(" is a type of "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource"),a("OutboundLink")],1),t._v(" specialized for describing tabular data like CSV files or spreadsheets.")]),t._v(" "),a("p",[t._v("Tabular Data Resource extends "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource"),a("OutboundLink")],1),t._v(" in following key ways:")]),t._v(" "),a("ul",[a("li",[t._v("The "),a("code",[t._v("schema")]),t._v(" property MUST follow the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/table-schema/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Table Schema"),a("OutboundLink")],1),t._v(" specification,"),a("br"),t._v("\neither as a JSON object directly under the property, or a string referencing another"),a("br"),t._v("\nJSON document containing the Table Schema")]),t._v(" "),a("li",[t._v("A new "),a("code",[t._v("dialect")]),t._v(" property to describe the CSV dialect. This property follows the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/csv-dialect/",target:"_blank",rel:"noopener noreferrer"}},[t._v("CSV Dialect"),a("OutboundLink")],1),t._v(" specification.")])]),t._v(" "),a("h3",{attrs:{id:"examples"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),a("p",[t._v("A minimal Tabular Data Resource, referencing external JSON documents, looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// with data and a schema accessible via the local filesystem")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-path.csv"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tableschema.json"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// with data accessible via http")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/resource-path.csv"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/tableschema.json"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dialect"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/csvdialect.json"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A minimal Tabular Data Resource example using the data property to inline data looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resource-name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"first_name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Louise"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"first_name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Julia"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"first_name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"primaryKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("A comprehensive Tabular Data Resource example with all required, recommended and optional properties looks as follows.")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"profile"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tabular-data-resource"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"solar-system"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/solar-system.csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Solar System"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My favourite data about the solar system."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"format"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mediatype"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/csv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"encoding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"utf-8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bytes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"schema"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fields"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"integer"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"primaryKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dialect"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"delimiter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('";"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"doubleQuote"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Solar System - 2001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://example.com/solar-system-2001.json"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"email"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"licenses"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CC-BY-4.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Creative Commons Attribution 4.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://creativecommons.org/licenses/by/4.0/"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[t._v("#")]),t._v(" Specification")]),t._v(" "),a("p",[t._v("A Tabular Data Resource MUST be a "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource"),a("OutboundLink")],1),t._v(", that is it MUST conform to the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/data-resource/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Resource specification"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("In addition:")]),t._v(" "),a("ul",[a("li",[t._v("The Data Resource "),a("code",[t._v("schema")]),t._v(" property MUST follow the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/table-schema/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Table Schema"),a("OutboundLink")],1),t._v(" specification,"),a("br"),t._v("\neither as a JSON object directly under the property, or a string referencing another"),a("br"),t._v("\nJSON document containing the Table Schema")])]),t._v(" "),a("ul",[a("li",[t._v("There "),a("code",[t._v("MUST")]),t._v(" be a "),a("code",[t._v("profile")]),t._v(" property with the value "),a("code",[t._v("tabular-data-resource")])])]),t._v(" "),a("ul",[a("li",[t._v("The data the Data Resource describes MUST:\n"),a("ul",[a("li",[t._v("If non-inline: Be a CSV file")]),t._v(" "),a("li",[t._v("If inline data: be “JSON tabular data” that is array of data rows where each row is an "),a("code",[t._v("array")]),t._v(" or "),a("code",[t._v("object")]),t._v(" (see below)")])])])]),t._v(" "),a("h3",{attrs:{id:"csv-file-requirements"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-file-requirements"}},[t._v("#")]),t._v(" CSV file requirements")]),t._v(" "),a("p",[t._v("CSV files in the wild come in a bewildering array of formats. There is a standard for CSV files described in "),a("a",{attrs:{href:"https://tools.ietf.org/html/rfc4180",target:"_blank",rel:"noopener noreferrer"}},[t._v("RFC 4180"),a("OutboundLink")],1),t._v(", but unfortunately this standard does not reflect reality. In Tabular Data Resource, CSV files "),a("code",[t._v("MUST")]),t._v(" follow RFC 4180 with the following important exceptions allowed:")]),t._v(" "),a("h4",{attrs:{id:"file-encoding"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file-encoding"}},[t._v("#")]),t._v(" File encoding")]),t._v(" "),a("p",[t._v("Files MUST:")]),t._v(" "),a("ul",[a("li",[t._v("EITHER be encoded as UTF-8 (the default)")]),t._v(" "),a("li",[t._v("OR the Tabular Data Resource MUST include an "),a("code",[t._v("encoding")]),t._v(" property and the files "),a("code",[t._v("MUST")]),t._v(" follow that encoding")])]),t._v(" "),a("p",[t._v("NB: the RFC requires 7-bit ASCII encoding.")]),t._v(" "),a("h4",{attrs:{id:"csv-dialect"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-dialect"}},[t._v("#")]),t._v(" CSV Dialect")]),t._v(" "),a("p",[t._v("The line terminator character "),a("code",[t._v("MUST")]),t._v(" be LF or CRLF (the RFC allows CRLF only).")]),t._v(" "),a("p",[t._v("If the CSV differs from this or the RFC in any other way regarding dialect (e.g. line terminators, quote characters, field delimiters), the Tabular Data Resource MUST contain a "),a("code",[t._v("dialect")]),t._v(" property describing its dialect. The "),a("code",[t._v("dialect")]),t._v(" property MUST follow the "),a("a",{attrs:{href:"http://specs.frictionlessdata.io/csv-dialect/",target:"_blank",rel:"noopener noreferrer"}},[t._v("CSV Dialect"),a("OutboundLink")],1),t._v(" specification.")]),t._v(" "),a("p",[t._v("The value for the "),a("code",[t._v("dialect")]),t._v(" property on a "),a("code",[t._v("resource")]),t._v(" MUST be an "),a("code",[t._v("object")]),t._v(" representing the dialect OR a "),a("code",[t._v("string")]),t._v(" that identifies the location of the dialect.")]),t._v(" "),a("p",[t._v("If a "),a("code",[t._v("string")]),t._v(" it must be a "),a("RouterLink",{attrs:{to:"/data-resource/#url-or-path"}},[t._v("url-or-path")]),t._v(", that is a fully qualified http URL or a relative POSIX path. The file at the the location specified by this url-or-path string "),a("code",[t._v("MUST")]),t._v(" be a JSON document containing the dialect.")],1),t._v(" "),a("h3",{attrs:{id:"json-tabular-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-tabular-data"}},[t._v("#")]),t._v(" JSON Tabular Data")]),t._v(" "),a("p",[t._v("JSON Tabular Data MUST be an "),a("code",[t._v("array")]),t._v(" where each item in the array MUST be:")]),t._v(" "),a("ul",[a("li",[t._v("EITHER: an array where each entry in the array is the value for that cell in the table")]),t._v(" "),a("li",[t._v("OR: an object where each key corresponds to the header for that row and the value corresponds to the cell value for that row for that header")])]),t._v(" "),a("h4",{attrs:{id:"row-arrays"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#row-arrays"}},[t._v("#")]),t._v(" Row Arrays")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"B"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"C"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),a("h4",{attrs:{id:"row-objects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#row-objects"}},[t._v("#")]),t._v(" Row Objects")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"B"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"C"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"B"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"C"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])],1)}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/30.f456e511.js b/assets/js/30.7e1f8a56.js similarity index 99% rename from assets/js/30.f456e511.js rename to assets/js/30.7e1f8a56.js index cf8c1f95..0528ce60 100644 --- a/assets/js/30.f456e511.js +++ b/assets/js/30.7e1f8a56.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{401:function(t,s,a){"use strict";a.r(s);var r=a(26),e=Object(r.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Producers and consumers of data want to have data presented in tables and graphs – “views” on the data. They want this for a range of reasons, from simple eyeballing to drawing out key insights,")]),t._v(" "),a("p",[t._v("This specification sets out a way to describe views for data packages using a simple declarative syntax that can be easily serialized in JSON.")]),t._v(" "),a("p",[t._v("We focus on doing the minimum to connect data package data with existing graph and table specification systems like Vega.")]),t._v(" "),a("h3",{attrs:{id:"desired-features"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#desired-features"}},[t._v("#")]),t._v(" Desired Features")]),t._v(" "),a("ul",[a("li",[t._v("Specify views such as graphs and tables as part of a data package\n"),a("ul",[a("li",[t._v("=> views should be describable in a specification serializable as JSON")])])]),t._v(" "),a("li",[t._v("Simple things are simple: adding a bar chart or line chart is fast and easy – seconds to do and requiring minimal knowledge")]),t._v(" "),a("li",[t._v("Powerful and extensible: complex and powerful graphing is also powerful")]),t._v(" "),a("li",[t._v("Reuse: leverage the power of existing specs like "),a("a",{attrs:{href:"http://vega.github.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vega"),a("OutboundLink")],1),t._v(" (and tools like Vega and Plotly)")]),t._v(" "),a("li",[t._v("Composable: the views spec should be independent but composable with the other data package specs (and even usable on its own)")])]),t._v(" "),a("h3",{attrs:{id:"concepts-and-background"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#concepts-and-background"}},[t._v("#")]),t._v(" Concepts and Background")]),t._v(" "),a("p",[t._v("To generate visualizations you need three kinds of information:")]),t._v(" "),a("ul",[a("li",[t._v("metadata: e.g. title of graph, credits etc")]),t._v(" "),a("li",[t._v("graph: description / specification of the graph itself")]),t._v(" "),a("li",[t._v("data: specification of data sources for the graph including information on location and metadata like types")])]),t._v(" "),a("p",[t._v("The data spec itself often consists of three distinct parts:")]),t._v(" "),a("ul",[a("li",[t._v("“raw / graph data”: a spec / description of data exactly in the form needed by the visualization system. This is often a very well defined spec e.g. an array of series.")]),t._v(" "),a("li",[t._v("locate/describe: a spec of where to get data from e.g. "),a("code",[t._v("url")]),t._v(" or "),a("code",[t._v("data")]),t._v(" attribute plus some information on that data such as format and types.")]),t._v(" "),a("li",[t._v("transform: a spec of how transform external data prior to use e.g. pivoting or filtering it")])]),t._v(" "),a("p",[t._v("From this description it should be clear that the latter two data specs – locate/describe and transform – are actually generic and independent of the specific graphing library. The only thing the graphing library really needs is a clear description of the “raw” format which it directly consumes. Thus, we can consider a natural grouping of specs as:")]),t._v(" "),a("ul",[a("li",[t._v("general-metadata - e.g. title of graph, credits etc [provided by e.g. Data Package / define yourself!]")]),t._v(" "),a("li",[t._v("data: sourcing and transform [provided by e.g. Data Resource]\n"),a("ul",[a("li",[t._v("sourcing: how to source data from external sources")]),t._v(" "),a("li",[t._v("transform: how to transform data e.g. pivot it, select one field, scale a field etc")])])]),t._v(" "),a("li",[t._v("graph description / specification [provided by e.g. Vega]\n"),a("ul",[a("li",[t._v("graph data (raw): data as directly consumed by graph spec (usually JSON based if we are talking about JS web-based visualization)")])])])]),t._v(" "),a("p",[t._v("However, in many visualization tools – including specs like Vega – these items are combined together. This is understandable as these tools seek to off users a “complete solution”. However, "),a("strong",[t._v("decoupling these parts and having clearly defined interfaces would offer significant benefits")]),t._v(":")]),t._v(" "),a("ul",[a("li",[t._v("Extensibility: it would be easier to extend and adapt the system. For example, adding new data import options could be done without changing the graph system.")]),t._v(" "),a("li",[t._v("Composability: we can combine different parts together in different ways. For example, data import and transformation could be used for generating data for tabular display as well as graphing.")]),t._v(" "),a("li",[t._v("Reusability: we want to reuse existing tools and specifications wherever possible. If we keep the specs relatively separate we can reuse the best spec for each job.")]),t._v(" "),a("li",[t._v("Reliability: when the system is decoupled it is easier to test and check.")])]),t._v(" "),a("p",[t._v("In summary, a smaller pieces, loosely joined makes it easier to adapt and evolve the specs and the associated tooling.")]),t._v(" "),a("h2",{attrs:{id:"specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[t._v("#")]),t._v(" Specification")]),t._v(" "),a("p",[t._v("Data Package Views (“Views”) define data views such as graphs or tables based on the data in a Data Package.")]),t._v(" "),a("p",[t._v("Views are defined in the "),a("code",[t._v("views")]),t._v(" property of the Data Package descriptor.")]),t._v(" "),a("p",[a("code",[t._v("views")]),t._v(" MUST be an array. Each entry in the array MUST be an object. This object MUST follow the Data Package View specification set out here.")]),t._v(" "),a("p",[t._v("A View MUST have the following form:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// generic metadata - very similar to Data Resource or Data Package")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"..."')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// unique identifier for view within list of views. (should we call it id ?)")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My view"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// title for this graph")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// data sources for this spec")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" resource1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" resource2 "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"specType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// one of simple | plotly | vega | vega-lite")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// graph spec")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"spec"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"data-source-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-source-spec"}},[t._v("#")]),t._v(" Data Source Spec")]),t._v(" "),a("p",[t._v("The data source spec is as follows:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("resources: [ resourceObjOrId, resourceObjOrId ]\n")])])]),a("p",[t._v("That is: an array where each entry is either:")]),t._v(" "),a("ul",[a("li",[t._v("A number - indicating the resource index in the resource array of the parent Data Package")]),t._v(" "),a("li",[t._v("A string - indicating the name of the resource in the resource array of the parent Data Package")]),t._v(" "),a("li",[t._v("An Object: being a full Data Resource object")])]),t._v(" "),a("h4",{attrs:{id:"compiled-resources"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#compiled-resources"}},[t._v("#")]),t._v(" “Compiled” Resources")]),t._v(" "),a("p",[t._v("The resources is termed “compiled” if all resources are objects and all data on those resources has been inlined onto an attribute named "),a("code",[t._v("_values")]),t._v(". At this point, the view is entirely self-contained – all resources and their associated data is “inside” the view object and no external data loading is required.")]),t._v(" "),a("h3",{attrs:{id:"graph-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#graph-spec"}},[t._v("#")]),t._v(" Graph Spec")]),t._v(" "),a("h4",{attrs:{id:"simple-graph-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#simple-graph-spec"}},[t._v("#")]),t._v(" Simple Graph Spec")]),t._v(" "),a("p",[t._v("The simple graph spec provides a very simple graph descriptor setup that aims for an 80/20 result. It supports only the following graph types:")]),t._v(" "),a("ul",[a("li",[t._v("Line "),a("code",[t._v("line")]),t._v(" (single and multiple). Especially time series")]),t._v(" "),a("li",[t._v("Bar "),a("code",[t._v("bar")]),t._v(" - Especially time series")]),t._v(" "),a("li",[t._v("(?) Pie "),a("code",[t._v("pie")]),t._v(" – we are considering excluding pie charts as they are not widely used, often poor information design")]),t._v(" "),a("li",[t._v("(?) Stacked bar")])]),t._v(" "),a("p",[t._v("Example data")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("x")]),t._v(" "),a("th",[t._v("y")]),t._v(" "),a("th",[t._v("z")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("8")]),t._v(" "),a("td",[t._v("5")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("9")]),t._v(" "),a("td",[t._v("7")])])])]),t._v(" "),a("p",[t._v("Spec:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"line"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"group"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"series"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"z"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"vega-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vega-spec"}},[t._v("#")]),t._v(" Vega Spec")]),t._v(" "),a("p",[a("em",[t._v("We are using Vega as an input: raw Vega plus a few tweaks to support data input out of line from their spec (e.g. resources)")])]),t._v(" "),a("p",[t._v("This is straight-up "),a("a",{attrs:{href:"https://vega.github.io/vega",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vega"),a("OutboundLink")],1),t._v(". The only modification that we leave out the actual data and instead only declare the existence of the datasets. The names of the datasets are the same as the names in the resources array.")]),t._v(" "),a("p",[t._v("This example is just copied from "),a("a",{attrs:{href:"https://vega.github.io/editor/#/examples/vega/bar-chart",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://vega.github.io/editor/#/examples/vega/bar-chart"),a("OutboundLink")],1),t._v(" with only the name of the datasets declared (here "),a("code",[t._v("table)")]),t._v(". The data can then be dynamically provided when the visualization is instantiated.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("400")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"padding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"top"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"left"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bottom"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"right"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scales"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ordinal"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"linear"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nice"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"marks"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rect"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"properties"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"enter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"band"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"offset"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("-1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"update"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"steelblue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hover"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("To understand how this fits together with the overall spec here’s the full view – note how the data and graph spec are separated:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My amazing bar chart"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("55")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("81")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("53")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("52")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("27")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("68")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("18")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"specType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"vega"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"spec"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("400")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"padding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"top"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"left"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bottom"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"right"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scales"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ordinal"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"linear"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nice"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"marks"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rect"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"properties"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"enter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"band"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"offset"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("-1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"update"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"steelblue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hover"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"vega-lite-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vega-lite-spec"}},[t._v("#")]),t._v(" Vega-Lite spec")]),t._v(" "),a("p",[t._v("The approach for "),a("a",{attrs:{href:"https://vega.github.io/vega-lite",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vega-Lite"),a("OutboundLink")],1),t._v(" is similar to the approach for Vega. Instead of specifying the data in the Vega-Lite spec itself, only use "),a("a",{attrs:{href:"https://vega.github.io/vega-lite/docs/data.html#named",target:"_blank",rel:"noopener noreferrer"}},[t._v("named datasets"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My amazing bar chart"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("55")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("81")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("53")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("52")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("27")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("68")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("18")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"specType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"vega-lite"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"spec"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bar"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encoding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ordinal"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"quantitative"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"plotly-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#plotly-spec"}},[t._v("#")]),t._v(" Plotly spec")]),t._v(" "),a("p",[t._v("Identical to Vega approach but without any data specified in the visualization specification.")]),t._v(" "),a("h3",{attrs:{id:"table-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#table-spec"}},[t._v("#")]),t._v(" Table Spec")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "name": "table-1",\n "resources": ["resource-1"]\n "specType": "table"\n}\n')])])]),a("h3",{attrs:{id:"data-transforms"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-transforms"}},[t._v("#")]),t._v(" Data Transforms")]),t._v(" "),a("p",[a("em",[t._v("In progress.")])])],1)}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{400:function(t,s,a){"use strict";a.r(s);var r=a(26),e=Object(r.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v("Producers and consumers of data want to have data presented in tables and graphs – “views” on the data. They want this for a range of reasons, from simple eyeballing to drawing out key insights,")]),t._v(" "),a("p",[t._v("This specification sets out a way to describe views for data packages using a simple declarative syntax that can be easily serialized in JSON.")]),t._v(" "),a("p",[t._v("We focus on doing the minimum to connect data package data with existing graph and table specification systems like Vega.")]),t._v(" "),a("h3",{attrs:{id:"desired-features"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#desired-features"}},[t._v("#")]),t._v(" Desired Features")]),t._v(" "),a("ul",[a("li",[t._v("Specify views such as graphs and tables as part of a data package\n"),a("ul",[a("li",[t._v("=> views should be describable in a specification serializable as JSON")])])]),t._v(" "),a("li",[t._v("Simple things are simple: adding a bar chart or line chart is fast and easy – seconds to do and requiring minimal knowledge")]),t._v(" "),a("li",[t._v("Powerful and extensible: complex and powerful graphing is also powerful")]),t._v(" "),a("li",[t._v("Reuse: leverage the power of existing specs like "),a("a",{attrs:{href:"http://vega.github.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vega"),a("OutboundLink")],1),t._v(" (and tools like Vega and Plotly)")]),t._v(" "),a("li",[t._v("Composable: the views spec should be independent but composable with the other data package specs (and even usable on its own)")])]),t._v(" "),a("h3",{attrs:{id:"concepts-and-background"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#concepts-and-background"}},[t._v("#")]),t._v(" Concepts and Background")]),t._v(" "),a("p",[t._v("To generate visualizations you need three kinds of information:")]),t._v(" "),a("ul",[a("li",[t._v("metadata: e.g. title of graph, credits etc")]),t._v(" "),a("li",[t._v("graph: description / specification of the graph itself")]),t._v(" "),a("li",[t._v("data: specification of data sources for the graph including information on location and metadata like types")])]),t._v(" "),a("p",[t._v("The data spec itself often consists of three distinct parts:")]),t._v(" "),a("ul",[a("li",[t._v("“raw / graph data”: a spec / description of data exactly in the form needed by the visualization system. This is often a very well defined spec e.g. an array of series.")]),t._v(" "),a("li",[t._v("locate/describe: a spec of where to get data from e.g. "),a("code",[t._v("url")]),t._v(" or "),a("code",[t._v("data")]),t._v(" attribute plus some information on that data such as format and types.")]),t._v(" "),a("li",[t._v("transform: a spec of how transform external data prior to use e.g. pivoting or filtering it")])]),t._v(" "),a("p",[t._v("From this description it should be clear that the latter two data specs – locate/describe and transform – are actually generic and independent of the specific graphing library. The only thing the graphing library really needs is a clear description of the “raw” format which it directly consumes. Thus, we can consider a natural grouping of specs as:")]),t._v(" "),a("ul",[a("li",[t._v("general-metadata - e.g. title of graph, credits etc [provided by e.g. Data Package / define yourself!]")]),t._v(" "),a("li",[t._v("data: sourcing and transform [provided by e.g. Data Resource]\n"),a("ul",[a("li",[t._v("sourcing: how to source data from external sources")]),t._v(" "),a("li",[t._v("transform: how to transform data e.g. pivot it, select one field, scale a field etc")])])]),t._v(" "),a("li",[t._v("graph description / specification [provided by e.g. Vega]\n"),a("ul",[a("li",[t._v("graph data (raw): data as directly consumed by graph spec (usually JSON based if we are talking about JS web-based visualization)")])])])]),t._v(" "),a("p",[t._v("However, in many visualization tools – including specs like Vega – these items are combined together. This is understandable as these tools seek to off users a “complete solution”. However, "),a("strong",[t._v("decoupling these parts and having clearly defined interfaces would offer significant benefits")]),t._v(":")]),t._v(" "),a("ul",[a("li",[t._v("Extensibility: it would be easier to extend and adapt the system. For example, adding new data import options could be done without changing the graph system.")]),t._v(" "),a("li",[t._v("Composability: we can combine different parts together in different ways. For example, data import and transformation could be used for generating data for tabular display as well as graphing.")]),t._v(" "),a("li",[t._v("Reusability: we want to reuse existing tools and specifications wherever possible. If we keep the specs relatively separate we can reuse the best spec for each job.")]),t._v(" "),a("li",[t._v("Reliability: when the system is decoupled it is easier to test and check.")])]),t._v(" "),a("p",[t._v("In summary, a smaller pieces, loosely joined makes it easier to adapt and evolve the specs and the associated tooling.")]),t._v(" "),a("h2",{attrs:{id:"specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification"}},[t._v("#")]),t._v(" Specification")]),t._v(" "),a("p",[t._v("Data Package Views (“Views”) define data views such as graphs or tables based on the data in a Data Package.")]),t._v(" "),a("p",[t._v("Views are defined in the "),a("code",[t._v("views")]),t._v(" property of the Data Package descriptor.")]),t._v(" "),a("p",[a("code",[t._v("views")]),t._v(" MUST be an array. Each entry in the array MUST be an object. This object MUST follow the Data Package View specification set out here.")]),t._v(" "),a("p",[t._v("A View MUST have the following form:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// generic metadata - very similar to Data Resource or Data Package")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"..."')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// unique identifier for view within list of views. (should we call it id ?)")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My view"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// title for this graph")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// data sources for this spec")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" resource1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" resource2 "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"specType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// one of simple | plotly | vega | vega-lite")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// graph spec")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"spec"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"data-source-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-source-spec"}},[t._v("#")]),t._v(" Data Source Spec")]),t._v(" "),a("p",[t._v("The data source spec is as follows:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("resources: [ resourceObjOrId, resourceObjOrId ]\n")])])]),a("p",[t._v("That is: an array where each entry is either:")]),t._v(" "),a("ul",[a("li",[t._v("A number - indicating the resource index in the resource array of the parent Data Package")]),t._v(" "),a("li",[t._v("A string - indicating the name of the resource in the resource array of the parent Data Package")]),t._v(" "),a("li",[t._v("An Object: being a full Data Resource object")])]),t._v(" "),a("h4",{attrs:{id:"compiled-resources"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#compiled-resources"}},[t._v("#")]),t._v(" “Compiled” Resources")]),t._v(" "),a("p",[t._v("The resources is termed “compiled” if all resources are objects and all data on those resources has been inlined onto an attribute named "),a("code",[t._v("_values")]),t._v(". At this point, the view is entirely self-contained – all resources and their associated data is “inside” the view object and no external data loading is required.")]),t._v(" "),a("h3",{attrs:{id:"graph-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#graph-spec"}},[t._v("#")]),t._v(" Graph Spec")]),t._v(" "),a("h4",{attrs:{id:"simple-graph-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#simple-graph-spec"}},[t._v("#")]),t._v(" Simple Graph Spec")]),t._v(" "),a("p",[t._v("The simple graph spec provides a very simple graph descriptor setup that aims for an 80/20 result. It supports only the following graph types:")]),t._v(" "),a("ul",[a("li",[t._v("Line "),a("code",[t._v("line")]),t._v(" (single and multiple). Especially time series")]),t._v(" "),a("li",[t._v("Bar "),a("code",[t._v("bar")]),t._v(" - Especially time series")]),t._v(" "),a("li",[t._v("(?) Pie "),a("code",[t._v("pie")]),t._v(" – we are considering excluding pie charts as they are not widely used, often poor information design")]),t._v(" "),a("li",[t._v("(?) Stacked bar")])]),t._v(" "),a("p",[t._v("Example data")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("x")]),t._v(" "),a("th",[t._v("y")]),t._v(" "),a("th",[t._v("z")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("8")]),t._v(" "),a("td",[t._v("5")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("9")]),t._v(" "),a("td",[t._v("7")])])])]),t._v(" "),a("p",[t._v("Spec:")]),t._v(" "),a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"line"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"group"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"series"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"z"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"vega-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vega-spec"}},[t._v("#")]),t._v(" Vega Spec")]),t._v(" "),a("p",[a("em",[t._v("We are using Vega as an input: raw Vega plus a few tweaks to support data input out of line from their spec (e.g. resources)")])]),t._v(" "),a("p",[t._v("This is straight-up "),a("a",{attrs:{href:"https://vega.github.io/vega",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vega"),a("OutboundLink")],1),t._v(". The only modification that we leave out the actual data and instead only declare the existence of the datasets. The names of the datasets are the same as the names in the resources array.")]),t._v(" "),a("p",[t._v("This example is just copied from "),a("a",{attrs:{href:"https://vega.github.io/editor/#/examples/vega/bar-chart",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://vega.github.io/editor/#/examples/vega/bar-chart"),a("OutboundLink")],1),t._v(" with only the name of the datasets declared (here "),a("code",[t._v("table)")]),t._v(". The data can then be dynamically provided when the visualization is instantiated.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("400")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"padding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"top"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"left"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bottom"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"right"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scales"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ordinal"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"linear"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nice"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"marks"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rect"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"properties"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"enter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"band"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"offset"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("-1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"update"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"steelblue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hover"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("To understand how this fits together with the overall spec here’s the full view – note how the data and graph spec are separated:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My amazing bar chart"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("55")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("81")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("53")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("52")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("27")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("68")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("18")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"specType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"vega"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"spec"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("400")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"padding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"top"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"left"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bottom"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"right"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scales"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ordinal"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"linear"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"range"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nice"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"axes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"marks"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rect"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"properties"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"enter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"width"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"band"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"offset"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("-1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scale"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"update"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"steelblue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hover"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fill"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"vega-lite-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vega-lite-spec"}},[t._v("#")]),t._v(" Vega-Lite spec")]),t._v(" "),a("p",[t._v("The approach for "),a("a",{attrs:{href:"https://vega.github.io/vega-lite",target:"_blank",rel:"noopener noreferrer"}},[t._v("Vega-Lite"),a("OutboundLink")],1),t._v(" is similar to the approach for Vega. Instead of specifying the data in the Vega-Lite spec itself, only use "),a("a",{attrs:{href:"https://vega.github.io/vega-lite/docs/data.html#named",target:"_blank",rel:"noopener noreferrer"}},[t._v("named datasets"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My amazing bar chart"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resources"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("55")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("81")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("53")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("52")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("87")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("27")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("68")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("18")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("49")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"specType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"vega-lite"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"spec"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"table"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bar"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encoding"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"x"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ordinal"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"y"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"field"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"quantitative"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"plotly-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#plotly-spec"}},[t._v("#")]),t._v(" Plotly spec")]),t._v(" "),a("p",[t._v("Identical to Vega approach but without any data specified in the visualization specification.")]),t._v(" "),a("h3",{attrs:{id:"table-spec"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#table-spec"}},[t._v("#")]),t._v(" Table Spec")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "name": "table-1",\n "resources": ["resource-1"]\n "specType": "table"\n}\n')])])]),a("h3",{attrs:{id:"data-transforms"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-transforms"}},[t._v("#")]),t._v(" Data Transforms")]),t._v(" "),a("p",[a("em",[t._v("In progress.")])])],1)}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/4.627e831d.js b/assets/js/4.a981ee64.js similarity index 100% rename from assets/js/4.627e831d.js rename to assets/js/4.a981ee64.js diff --git a/assets/js/5.3c75b492.js b/assets/js/5.02f86579.js similarity index 100% rename from assets/js/5.3c75b492.js rename to assets/js/5.02f86579.js diff --git a/assets/js/6.9cbfe13d.js b/assets/js/6.96220469.js similarity index 100% rename from assets/js/6.9cbfe13d.js rename to assets/js/6.96220469.js diff --git a/assets/js/7.9ebea86b.js b/assets/js/7.323437e3.js similarity index 100% rename from assets/js/7.9ebea86b.js rename to assets/js/7.323437e3.js diff --git a/assets/js/8.7632112f.js b/assets/js/8.ad8a6967.js similarity index 100% rename from assets/js/8.7632112f.js rename to assets/js/8.ad8a6967.js diff --git a/assets/js/9.d491b2cb.js b/assets/js/9.2e4ee646.js similarity index 99% rename from assets/js/9.d491b2cb.js rename to assets/js/9.2e4ee646.js index e4ff091b..f0883eaf 100644 --- a/assets/js/9.d491b2cb.js +++ b/assets/js/9.2e4ee646.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{335:function(t,e,a){},367:function(t,e,a){"use strict";a(335)},400:function(t,e,a){"use strict";a.r(e);a(367);var s=a(26),d=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[t._v("#")]),t._v(" Summary")]),t._v(" "),a("p",[t._v("The tabular diff format expresses the difference between two versions of a table."),a("br"),t._v("\nHere’s an example of a diff:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",[a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",[t._v("designer")]),a("th",[t._v("length")])]),t._v(" "),a("tr",[a("td"),a("td",[t._v("Brooklyn")]),a("td",[t._v("J. A. Roebling")]),a("td",[t._v("1595")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",[t._v("+++")]),a("td",[t._v("Manhattan")]),a("td",[t._v("G. Lindenthal")]),a("td",[t._v("1470")])]),t._v(" "),a("tr",{staticClass:"modify"},[a("td",{staticClass:"modify"},[t._v("->")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"modify"},[t._v("D. Duck->L. L. Buck")]),a("td",[t._v("1600")])]),t._v(" "),a("tr",[a("td"),a("td",[t._v("Queensborough")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",[t._v("1182")])]),t._v(" "),a("tr",[a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td"),a("td",[t._v("George Washington")]),a("td",[t._v("O. H. Ammann")]),a("td",[t._v("3500")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td",[t._v("S. Spamington")]),a("td",[t._v("10000 ")])])])]),t._v(" "),a("p",[t._v("As for text diffs, the format emphasizes significant changes. Also like text diffs, the format is unambiguous without color, but readily enhanced with it. Unlike text diffs, the format preserves the original tabular structure, allowing presentation with sensible visual alignment.")]),t._v(" "),a("p",[t._v("There is a reference implementation of a tool for generating and processing tabular diffs at "),a("a",{attrs:{href:"https://github.com/paulfitz/daff",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/paulfitz/daff"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"scope"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#scope"}},[t._v("#")]),t._v(" Scope")]),t._v(" "),a("p",[t._v("The tabular diff format can express the following kinds of changes in a table:")]),t._v(" "),a("ul",[a("li",[t._v("Inserted or deleted rows.")]),t._v(" "),a("li",[t._v("Inserted, deleted, or renamed columns.")]),t._v(" "),a("li",[t._v("Modified cell values.")])]),t._v(" "),a("p",[t._v("If the order of the rows or columns of the the table are meaningful, then the format can also express:")]),t._v(" "),a("ul",[a("li",[t._v("Reordered rows or columns.")])]),t._v(" "),a("p",[t._v("Changes in formatting and systematic transformation of data (such as capitalization) are not expressible.")]),t._v(" "),a("h2",{attrs:{id:"general-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#general-structure"}},[t._v("#")]),t._v(" General structure")]),t._v(" "),a("p",[t._v("Assume we have two tables, called "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(". The diff summarizes the changes needed to modify "),a("code",[t._v("LOCAL")]),t._v(" to match "),a("code",[t._v("REMOTE")]),t._v(".")]),t._v(" "),a("p",[t._v("The diff contains rows and columns from the tables being compared. As in regular text diffs, there is flexibility in what data is given and what is omitted.")]),t._v(" "),a("ul",[a("li",[t._v("A column or row that is common to the tables being compared should appear at most once.")]),t._v(" "),a("li",[t._v("Any column or row containing a modified cell should be included in the diff, and the modified cell should be represented using the procedure in "),a("a",{attrs:{href:"#expressing-a-modified-cell-value"}},[t._v("Expressing a modified cell value")]),t._v(".")]),t._v(" "),a("li",[t._v("Columns or rows that are present in one table and not in the other should be included in the diff.")]),t._v(" "),a("li",[t._v("Columns or rows that are unchanged and unneeded for context may be omitted, at the diff creator’s discretion.")]),t._v(" "),a("li",[t._v("Omitted blocks of rows or columns should be marked with a row/column full of "),a("code",[t._v("...")]),t._v(" cells.")])]),t._v(" "),a("p",[t._v("In addition, the diff contains the following special rows and columns:")]),t._v(" "),a("ul",[a("li",[t._v("The "),a("em",[t._v("action")]),t._v(" column. This is always present, and is the first column in the diff if columns are ordered. If columns are "),a("em",[t._v("not")]),t._v(" ordered, it is the column named "),a("code",[t._v("__hilite_diff__")]),t._v(".")]),t._v(" "),a("li",[t._v("A "),a("em",[t._v("header")]),t._v(" row with column names. This row can be recognized since it will have the tag "),a("code",[t._v("@@")]),t._v(" in the action column.")]),t._v(" "),a("li",[t._v("A "),a("em",[t._v("schema")]),t._v(" row that is needed when the column structure differs between tables. This row can be recognized since it will have the tag "),a("code",[t._v("!")]),t._v(" in the action column.")])]),t._v(" "),a("p",[t._v("Here’s an example diff, where the tables being compared share the same three columns:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action column")]),a("td",{attrs:{colspan:"3"}},[t._v("data from compared tables")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",[t._v("designer")]),a("th",[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"}),a("td"),a("td",[t._v("Brooklyn")]),a("td",[t._v("J. A. Roebling")]),a("td",[t._v("1595")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"}),a("td",[t._v("+++")]),a("td",[t._v("Manhattan")]),a("td",[t._v("G. Lindenthal")]),a("td",[t._v("1470")])]),t._v(" "),a("tr",{staticClass:"modify"},[a("td",{staticClass:"desc"}),a("td",{staticClass:"modify"},[t._v("->")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"modify"},[t._v("D. Duck->L. L. Buck")]),a("td",[t._v("1600")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"}),a("td"),a("td",[t._v("Queensborough")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",[t._v("1182")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("omitted rows")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"}),a("td"),a("td",[t._v("George Washington")]),a("td",[t._v("O. H. Ammann")]),a("td",[t._v("3500")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"}),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td",[t._v("S. Spamington")]),a("td",[t._v("10000 ")])])])]),t._v(" "),a("p",[t._v("The colors do not make up part of this specification, they are just syntax highlighting. The meaning of the various tags will become clear in later sections, for now we are just concerned with the structure of the diff. Here’s an example where there is a difference in columns: "),a("code",[t._v("LOCAL")]),t._v(" has a "),a("em",[t._v("length")]),t._v(" column that is removed in "),a("code",[t._v("REMOTE")]),t._v(", "),a("code",[t._v("REMOTE")]),t._v(" has an "),a("em",[t._v("opened")]),t._v(" column that wasn’t present in "),a("code",[t._v("LOCAL")]),t._v(", and the "),a("em",[t._v("designer")]),t._v(" column in "),a("code",[t._v("LOCAL")]),t._v(" is renamed as "),a("em",[t._v("lead designer")]),t._v(" in "),a("code",[t._v("REMOTE")]),t._v(":")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action column")]),a("td",{attrs:{colspan:"4"}},[t._v("data from compared tables")])]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc",attrs:{rowspan:"8"}}),a("td",[t._v("+")]),a("td",[t._v("Brooklyn")]),a("td",{staticClass:"add"},[t._v("1883")]),a("td",[t._v("J. A. Roebling")]),a("td",{staticClass:"remove"},[t._v("1595")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Manhattan")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("G. Lindenthal")]),a("td",{staticClass:"remove"},[t._v("1470")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"add"},[t._v("1903")]),a("td",[t._v("L. L. Buck")]),a("td",{staticClass:"remove"},[t._v("1600")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Queensborough")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",{staticClass:"remove"},[t._v("1182")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Triborough")]),a("td",{staticClass:"add"},[t._v("1936")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("1380,383")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Bronx Whitestone")]),a("td",{staticClass:"add"},[t._v("1939")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("2300")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Throgs Neck")]),a("td",{staticClass:"add"},[t._v("1961")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("1800")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("George Washington")]),a("td",{staticClass:"add"},[t._v("1931")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("3500")])])])]),t._v(" "),a("p",[t._v("We see that a schema row is added above the header row to represent the changes in columns. With this general anatomy of a diff in mind, let’s look at the details of how to interpret it.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("If writing a rule to “sniff” a file to see if it is a tabular diff, the "),a("code",[t._v("@@")]),t._v(" tag is a handy tell-tale. But watch out for that schema row! Also, to allow for future evolution of this format, please try to be robust to a few extra rows or columns appearing before the "),a("code",[t._v("@@")]),t._v(".")])]),t._v(" "),a("h2",{attrs:{id:"expressing-inserted-and-deleted-columns"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-inserted-and-deleted-columns"}},[t._v("#")]),t._v(" Expressing inserted and deleted columns")]),t._v(" "),a("p",[t._v("An inserted column is expressed simply by including that column in the diff, and placing "),a("code",[t._v("+++")]),t._v(" in the schema row above the corresponding column name in the header row. Similarly, a deleted column is expressed by including that column in the diff, and placing "),a("code",[t._v("---")]),t._v(" in the schema row above the corresponding column name. As a special case, a renamed column is represented by simply placing its old name in parentheses in the schema row.")]),t._v(" "),a("p",[t._v("In our earlier example, "),a("code",[t._v("LOCAL")]),t._v(" has the columns "),a("em",[t._v("bridge")]),t._v(", "),a("em",[t._v("designer")]),t._v(", and "),a("em",[t._v("length")]),t._v(", while "),a("code",[t._v("REMOTE")]),t._v(" has the columns "),a("em",[t._v("bridge")]),t._v(", "),a("em",[t._v("opened")]),t._v(", and "),a("em",[t._v("lead designer")]),t._v(" ("),a("em",[t._v("designer")]),t._v(" renamed). So "),a("em",[t._v("opened")]),t._v(" is inserted and "),a("em",[t._v("length")]),t._v(" is deleted:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}},[t._v("data from compared tables")])]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc",attrs:{rowspan:"3"}}),a("td",[t._v("+")]),a("td",[t._v("Brooklyn")]),a("td",{staticClass:"add"},[t._v("1883")]),a("td",[t._v("J. A. Roebling")]),a("td",{staticClass:"remove"},[t._v("1595")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Manhattan")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("G. Lindenthal")]),a("td",{staticClass:"remove"},[t._v("1470")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"add"},[t._v("1903")]),a("td",[t._v("L. L. Buck")]),a("td",{staticClass:"remove"},[t._v("1600")])])])]),t._v(" "),a("p",[t._v("If we are dealing with a data store where columns are unordered, then likewise column order in the diff is irrelevant. Otherwise, the inserted and deleted rows should be placed in their appropriate order.")]),t._v(" "),a("p",[t._v("Any rows in the diff that are present only the "),a("code",[t._v("LOCAL")]),t._v(" table will leave inserted columns blank. Similarly, any rows in the diff that are present only in the "),a("code",[t._v("REMOTE")]),t._v(" table will leave deleted columns blank. Rows that are present in both tables will have values in all cells.")]),t._v(" "),a("h2",{attrs:{id:"expressing-inserted-and-deleted-rows"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-inserted-and-deleted-rows"}},[t._v("#")]),t._v(" Expressing inserted and deleted rows")]),t._v(" "),a("p",[t._v("An inserted row is expressed simply by placing "),a("code",[t._v("+++")]),t._v(" in the action column, and placing cell values in the appropriate columns. If there are columns in the diff that are in "),a("code",[t._v("LOCAL")]),t._v(" but not in "),a("code",[t._v("REMOTE")]),t._v(", these are left blank. Likewise, a deleted row is expressed by placing "),a("code",[t._v("---")]),t._v(" in the action column, and its cell values in the appropriate columns. If there are columns in the diff that are in "),a("code",[t._v("REMOTE")]),t._v(" but not in "),a("code",[t._v("LOCAL")]),t._v(", these are left blank. For example, suppose in "),a("code",[t._v("REMOTE")]),t._v(" there is a row about a New Bridge that wasn’t in "),a("code",[t._v("LOCAL")]),t._v(", and a row about a bridge called Spamspan has been dropped. Here is what the inserted and deleted rows would look like, lined up with the header row for reference:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}})]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",{staticClass:"blank"},[a("td",[t._v(" ")]),a("td"),a("td"),a("td"),a("td"),a("td")]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"},[t._v("inserted row")]),a("td",[t._v("+++")]),a("td",[t._v("New Bridge")]),a("td",{staticClass:"add"},[t._v("2050")]),a("td",[t._v("Chimp N Zee")]),a("td",{staticClass:"remove"},[t._v("   ")])]),t._v(" "),a("tr",{staticClass:"blank"},[a("td",[t._v(" ")]),a("td"),a("td"),a("td"),a("td"),a("td")]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"},[t._v("deleted row")]),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td"),a("td",[t._v("S. Spamington")]),a("td",{staticClass:"remove"},[t._v("10000")])])])]),t._v(" "),a("p",[t._v("If the diff is on a database table where rows have no ordering, then we can just stick these rows together and we have our diff:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}})]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"},[t._v("inserted row")]),a("td",[t._v("+++")]),a("td",[t._v("New Bridge")]),a("td",{staticClass:"add"},[t._v("2050")]),a("td",[t._v("Chimp N Zee")]),a("td",{staticClass:"remove"},[t._v("   ")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"},[t._v("deleted row")]),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td"),a("td",[t._v("S. Spamington")]),a("td",{staticClass:"remove"},[t._v("10000")])])])]),t._v(" "),a("p",[t._v("If the diff is on a spreadsheet table or CSV file, we’d generally want to respect row ordering. In this case, we can add context rows around insertions so we know where to put them. Less importantly, since they are going away anyway, we can do the same for deletions:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}})]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("omitted rows")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("context row")]),a("td",[t._v("+")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"add"},[t._v("1903")]),a("td",[t._v("L. L. Buck")]),a("td",{staticClass:"remove"},[t._v("1600")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"},[t._v("inserted row")]),a("td",[t._v("+++")]),a("td",[t._v("New Bridge")]),a("td",{staticClass:"add"},[t._v("2050")]),a("td",[t._v("Chimp N Zee")]),a("td",{staticClass:"remove"},[t._v("   ")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("context row")]),a("td",[t._v("+")]),a("td",[t._v("Queensborough")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",{staticClass:"remove"},[t._v("1182")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("omitted rows")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("context row")]),a("td",[t._v("+")]),a("td",[t._v("George Washington")]),a("td",{staticClass:"add"},[t._v("1931")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("3500")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"},[t._v("deleted row")]),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td"),a("td",[t._v("S. Spamington")]),a("td",{staticClass:"remove"},[t._v("10000")])])])]),t._v(" "),a("p",[t._v("The action column for a context row may contain a blank, or "),a("code",[t._v(":")]),t._v(", or "),a("code",[t._v("+")]),t._v(". The "),a("code",[t._v(":")]),t._v(" tag signifies the context row was moved (and its location is now as in the "),a("code",[t._v("REMOTE")]),t._v(" table). The "),a("code",[t._v("+")]),t._v(" signifies that there are cells added on that row.")]),t._v(" "),a("h2",{attrs:{id:"expressing-a-modified-cell-value"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-a-modified-cell-value"}},[t._v("#")]),t._v(" Expressing a modified cell value")]),t._v(" "),a("p",[t._v("If a row contains a cell whose value is different in the compared tables, then that row should be shown in the diff, with a tag in the action column that ends in "),a("code",[t._v("->")]),t._v(". Then, the modified cell will be represented by converting the "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(" values to text (we have yet to say how) and using the action tag as a separator. So for example here we change the last cell in a row from “Green” to “Blue”:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",[a("td",{staticClass:"modify"},[t._v("->")]),a("td",[t._v("Gnome")]),a("td",[t._v("Home and Garden")]),a("td",{staticClass:"modify"},[t._v("Green->Blue")])])])]),t._v(" "),a("p",[t._v("The tag must be preceded with as many extra "),a("code",[t._v("-")]),t._v(" characters as are needed to avoid collision with any character sequence on that row. So here is another row with exactly one cell changed:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",[a("td",{staticClass:"modify"},[t._v("--\x3e")]),a("td",[t._v("Console")]),a("td",[t._v("Toddlers -> Teenagers")]),a("td",{staticClass:"modify"},[t._v("White--\x3ePale")])])])]),t._v(" "),a("p",[t._v("When encoding a cell change as a string, we lose information about the type of the cell value. One distinction that may be important to retain is the difference between a NULL or empty cell, and the empty string. The tabular diff uses the following encoding:")]),t._v(" "),a("ul",[a("li",[t._v("A NULL value, if available, represents itself.")]),t._v(" "),a("li",[t._v("The encoded string "),a("code",[t._v("NULL")]),t._v(" represents a NULL value.")]),t._v(" "),a("li",[t._v("The encoded string "),a("code",[t._v("_NULL")]),t._v(" represents the string “NULL”.")]),t._v(" "),a("li",[t._v("The encoded string "),a("code",[t._v("__NULL")]),t._v(" represents the string “_NULL”.")]),t._v(" "),a("li",[t._v("…")])]),t._v(" "),a("p",[t._v("The goal is that the diff can be safely converted to and from CSV by existing tools without changing its meaning. To that end:")]),t._v(" "),a("ul",[a("li",[t._v("For matching (e.g. on context lines) blank cells in the diff (either the NULL value or an empty string) should be treated as ambiguous, and match "),a("em",[t._v("either")]),t._v(" of NULL or an empty string if an exact match is not available.")]),t._v(" "),a("li",[t._v("When using a diff as a patch, and inserting new cells, a blank cell in the diff (either the NULL value or an empty string) should be treated as ambiguous, and the “right” thing done given the column type. If either value could be inserted, then the blank string should be inserted (since the encoded string "),a("code",[t._v("NULL")]),t._v(" is available to specifically identify the NULL value).")])]),t._v(" "),a("p",[t._v("Note that if the diff is being expressed in a table that allows nested structure (e.g. a JSON representation), a list representation for modified cells might be used to avoid this issue. There is no specification for that at this time.")]),t._v(" "),a("h2",{attrs:{id:"expressing-a-moved-row"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-a-moved-row"}},[t._v("#")]),t._v(" Expressing a moved row")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("This can be ignored for tables for which row order is meaningless, e.g. in typical relational databases.")])]),t._v(" "),a("p",[t._v("A row that have been moved in a table for which row order is meaningful is marked with a "),a("code",[t._v(":")]),t._v(" tag in the action column and placed in the order it appears in the "),a("code",[t._v("REMOTE")]),t._v(" table.")]),t._v(" "),a("p",[t._v("To avoid burdening human readers with too much arcana, tags are "),a("em",[t._v("not")]),t._v(" combined when multiple kinds of actions apply to a row or column. So for example, a context row that was moved and had a cell added will "),a("em",[t._v("not")]),t._v(" be tagged as "),a("code",[t._v(":+")]),t._v(" or "),a("code",[t._v("+:")]),t._v(" or such-like, but rather by "),a("code",[t._v(":")]),t._v(". Cell addition can be determined from the schema row. These weak tags are included as aids for highlighting to express the most significant thing to know about a row.")]),t._v(" "),a("h2",{attrs:{id:"expressing-a-moved-column"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-a-moved-column"}},[t._v("#")]),t._v(" Expressing a moved column")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("This can be ignored for tables for which column order is meaningless.")])]),t._v(" "),a("p",[t._v("A column that have been moved in a table for which column order is meaningful is marked with a "),a("code",[t._v(":")]),t._v(" tag in the schema row and placed in the order it appears in the "),a("code",[t._v("REMOTE")]),t._v(" table.")]),t._v(" "),a("p",[t._v("If a diff that contains a "),a("code",[t._v(":")]),t._v(" tag is used to patch a table for which column order is not meaningful, that tag should simply be ignored.")]),t._v(" "),a("h2",{attrs:{id:"reference-action-column-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reference-action-column-tags"}},[t._v("#")]),t._v(" Reference: action column tags")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Symbol")]),t._v(" "),a("th",[t._v("Meaning")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("@@")])]),t._v(" "),a("td",[t._v("The header row, giving column names.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("!")])]),t._v(" "),a("td",[t._v("The schema row, given column differences.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("+++")])]),t._v(" "),a("td",[t._v("An inserted row (present in "),a("code",[t._v("REMOTE")]),t._v(", not present in "),a("code",[t._v("LOCAL")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("---")])]),t._v(" "),a("td",[t._v("A deleted row (present in "),a("code",[t._v("LOCAL")]),t._v(", not present in "),a("code",[t._v("REMOTE")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("->")])]),t._v(" "),a("td",[t._v("A row with at least one cell modified cell. "),a("code",[t._v("--\x3e")]),t._v(", "),a("code",[t._v("---\x3e")]),t._v(", "),a("code",[t._v("----\x3e")]),t._v(" etc. have the same meaning.")])]),t._v(" "),a("tr",[a("td",[t._v("Blank")]),t._v(" "),a("td",[t._v("A blank string or NULL marks a row common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(", given for context.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("...")])]),t._v(" "),a("td",[t._v("Declares that rows common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(" are being skipped.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("+")])]),t._v(" "),a("td",[t._v("A row with at least one added cell.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v(":")])]),t._v(" "),a("td",[t._v("A reordered row.")])])])]),t._v(" "),a("h2",{attrs:{id:"reference-schema-row-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reference-schema-row-tags"}},[t._v("#")]),t._v(" Reference: schema row tags")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Symbol")]),t._v(" "),a("th",[t._v("Meaning")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("+++")])]),t._v(" "),a("td",[t._v("An inserted column (present in "),a("code",[t._v("REMOTE")]),t._v(", not present in "),a("code",[t._v("LOCAL")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("---")])]),t._v(" "),a("td",[t._v("A deleted column (present in "),a("code",[t._v("LOCAL")]),t._v(", not present in "),a("code",[t._v("REMOTE")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("()")])]),t._v(" "),a("td",[t._v("A renamed column (the name in "),a("code",[t._v("LOCAL")]),t._v(" is given in parenthesis, and the name in "),a("code",[t._v("REMOTE")]),t._v(" will be in the header row).")])]),t._v(" "),a("tr",[a("td",[t._v("Blank")]),t._v(" "),a("td",[t._v("A blank string or NULL marks a column common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(", given for context.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("...")])]),t._v(" "),a("td",[t._v("Declares that columns common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(" are being skipped.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v(":")])]),t._v(" "),a("td",[t._v("A reordered column.")])])])])],1)}),[],!1,null,null,null);e.default=d.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{335:function(t,e,a){},367:function(t,e,a){"use strict";a(335)},401:function(t,e,a){"use strict";a.r(e);a(367);var s=a(26),d=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"page-frontmatter-title"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#page-frontmatter-title"}},[t._v("#")]),t._v(" "+t._s(t.$page.frontmatter.title))]),t._v(" "),a("p",[t._v(t._s(t.$page.frontmatter.abstract))]),t._v(" "),a("MetadataTable"),t._v(" "),a("h2",{attrs:{id:"language"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#language"}},[t._v("#")]),t._v(" Language")]),t._v(" "),a("Language"),t._v(" "),a("h2",{attrs:{id:"summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[t._v("#")]),t._v(" Summary")]),t._v(" "),a("p",[t._v("The tabular diff format expresses the difference between two versions of a table."),a("br"),t._v("\nHere’s an example of a diff:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",[a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",[t._v("designer")]),a("th",[t._v("length")])]),t._v(" "),a("tr",[a("td"),a("td",[t._v("Brooklyn")]),a("td",[t._v("J. A. Roebling")]),a("td",[t._v("1595")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",[t._v("+++")]),a("td",[t._v("Manhattan")]),a("td",[t._v("G. Lindenthal")]),a("td",[t._v("1470")])]),t._v(" "),a("tr",{staticClass:"modify"},[a("td",{staticClass:"modify"},[t._v("->")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"modify"},[t._v("D. Duck->L. L. Buck")]),a("td",[t._v("1600")])]),t._v(" "),a("tr",[a("td"),a("td",[t._v("Queensborough")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",[t._v("1182")])]),t._v(" "),a("tr",[a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td"),a("td",[t._v("George Washington")]),a("td",[t._v("O. H. Ammann")]),a("td",[t._v("3500")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td",[t._v("S. Spamington")]),a("td",[t._v("10000 ")])])])]),t._v(" "),a("p",[t._v("As for text diffs, the format emphasizes significant changes. Also like text diffs, the format is unambiguous without color, but readily enhanced with it. Unlike text diffs, the format preserves the original tabular structure, allowing presentation with sensible visual alignment.")]),t._v(" "),a("p",[t._v("There is a reference implementation of a tool for generating and processing tabular diffs at "),a("a",{attrs:{href:"https://github.com/paulfitz/daff",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/paulfitz/daff"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"scope"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#scope"}},[t._v("#")]),t._v(" Scope")]),t._v(" "),a("p",[t._v("The tabular diff format can express the following kinds of changes in a table:")]),t._v(" "),a("ul",[a("li",[t._v("Inserted or deleted rows.")]),t._v(" "),a("li",[t._v("Inserted, deleted, or renamed columns.")]),t._v(" "),a("li",[t._v("Modified cell values.")])]),t._v(" "),a("p",[t._v("If the order of the rows or columns of the the table are meaningful, then the format can also express:")]),t._v(" "),a("ul",[a("li",[t._v("Reordered rows or columns.")])]),t._v(" "),a("p",[t._v("Changes in formatting and systematic transformation of data (such as capitalization) are not expressible.")]),t._v(" "),a("h2",{attrs:{id:"general-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#general-structure"}},[t._v("#")]),t._v(" General structure")]),t._v(" "),a("p",[t._v("Assume we have two tables, called "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(". The diff summarizes the changes needed to modify "),a("code",[t._v("LOCAL")]),t._v(" to match "),a("code",[t._v("REMOTE")]),t._v(".")]),t._v(" "),a("p",[t._v("The diff contains rows and columns from the tables being compared. As in regular text diffs, there is flexibility in what data is given and what is omitted.")]),t._v(" "),a("ul",[a("li",[t._v("A column or row that is common to the tables being compared should appear at most once.")]),t._v(" "),a("li",[t._v("Any column or row containing a modified cell should be included in the diff, and the modified cell should be represented using the procedure in "),a("a",{attrs:{href:"#expressing-a-modified-cell-value"}},[t._v("Expressing a modified cell value")]),t._v(".")]),t._v(" "),a("li",[t._v("Columns or rows that are present in one table and not in the other should be included in the diff.")]),t._v(" "),a("li",[t._v("Columns or rows that are unchanged and unneeded for context may be omitted, at the diff creator’s discretion.")]),t._v(" "),a("li",[t._v("Omitted blocks of rows or columns should be marked with a row/column full of "),a("code",[t._v("...")]),t._v(" cells.")])]),t._v(" "),a("p",[t._v("In addition, the diff contains the following special rows and columns:")]),t._v(" "),a("ul",[a("li",[t._v("The "),a("em",[t._v("action")]),t._v(" column. This is always present, and is the first column in the diff if columns are ordered. If columns are "),a("em",[t._v("not")]),t._v(" ordered, it is the column named "),a("code",[t._v("__hilite_diff__")]),t._v(".")]),t._v(" "),a("li",[t._v("A "),a("em",[t._v("header")]),t._v(" row with column names. This row can be recognized since it will have the tag "),a("code",[t._v("@@")]),t._v(" in the action column.")]),t._v(" "),a("li",[t._v("A "),a("em",[t._v("schema")]),t._v(" row that is needed when the column structure differs between tables. This row can be recognized since it will have the tag "),a("code",[t._v("!")]),t._v(" in the action column.")])]),t._v(" "),a("p",[t._v("Here’s an example diff, where the tables being compared share the same three columns:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action column")]),a("td",{attrs:{colspan:"3"}},[t._v("data from compared tables")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",[t._v("designer")]),a("th",[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"}),a("td"),a("td",[t._v("Brooklyn")]),a("td",[t._v("J. A. Roebling")]),a("td",[t._v("1595")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"}),a("td",[t._v("+++")]),a("td",[t._v("Manhattan")]),a("td",[t._v("G. Lindenthal")]),a("td",[t._v("1470")])]),t._v(" "),a("tr",{staticClass:"modify"},[a("td",{staticClass:"desc"}),a("td",{staticClass:"modify"},[t._v("->")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"modify"},[t._v("D. Duck->L. L. Buck")]),a("td",[t._v("1600")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"}),a("td"),a("td",[t._v("Queensborough")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",[t._v("1182")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("omitted rows")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"}),a("td"),a("td",[t._v("George Washington")]),a("td",[t._v("O. H. Ammann")]),a("td",[t._v("3500")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"}),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td",[t._v("S. Spamington")]),a("td",[t._v("10000 ")])])])]),t._v(" "),a("p",[t._v("The colors do not make up part of this specification, they are just syntax highlighting. The meaning of the various tags will become clear in later sections, for now we are just concerned with the structure of the diff. Here’s an example where there is a difference in columns: "),a("code",[t._v("LOCAL")]),t._v(" has a "),a("em",[t._v("length")]),t._v(" column that is removed in "),a("code",[t._v("REMOTE")]),t._v(", "),a("code",[t._v("REMOTE")]),t._v(" has an "),a("em",[t._v("opened")]),t._v(" column that wasn’t present in "),a("code",[t._v("LOCAL")]),t._v(", and the "),a("em",[t._v("designer")]),t._v(" column in "),a("code",[t._v("LOCAL")]),t._v(" is renamed as "),a("em",[t._v("lead designer")]),t._v(" in "),a("code",[t._v("REMOTE")]),t._v(":")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action column")]),a("td",{attrs:{colspan:"4"}},[t._v("data from compared tables")])]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc",attrs:{rowspan:"8"}}),a("td",[t._v("+")]),a("td",[t._v("Brooklyn")]),a("td",{staticClass:"add"},[t._v("1883")]),a("td",[t._v("J. A. Roebling")]),a("td",{staticClass:"remove"},[t._v("1595")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Manhattan")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("G. Lindenthal")]),a("td",{staticClass:"remove"},[t._v("1470")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"add"},[t._v("1903")]),a("td",[t._v("L. L. Buck")]),a("td",{staticClass:"remove"},[t._v("1600")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Queensborough")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",{staticClass:"remove"},[t._v("1182")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Triborough")]),a("td",{staticClass:"add"},[t._v("1936")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("1380,383")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Bronx Whitestone")]),a("td",{staticClass:"add"},[t._v("1939")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("2300")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Throgs Neck")]),a("td",{staticClass:"add"},[t._v("1961")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("1800")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("George Washington")]),a("td",{staticClass:"add"},[t._v("1931")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("3500")])])])]),t._v(" "),a("p",[t._v("We see that a schema row is added above the header row to represent the changes in columns. With this general anatomy of a diff in mind, let’s look at the details of how to interpret it.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("If writing a rule to “sniff” a file to see if it is a tabular diff, the "),a("code",[t._v("@@")]),t._v(" tag is a handy tell-tale. But watch out for that schema row! Also, to allow for future evolution of this format, please try to be robust to a few extra rows or columns appearing before the "),a("code",[t._v("@@")]),t._v(".")])]),t._v(" "),a("h2",{attrs:{id:"expressing-inserted-and-deleted-columns"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-inserted-and-deleted-columns"}},[t._v("#")]),t._v(" Expressing inserted and deleted columns")]),t._v(" "),a("p",[t._v("An inserted column is expressed simply by including that column in the diff, and placing "),a("code",[t._v("+++")]),t._v(" in the schema row above the corresponding column name in the header row. Similarly, a deleted column is expressed by including that column in the diff, and placing "),a("code",[t._v("---")]),t._v(" in the schema row above the corresponding column name. As a special case, a renamed column is represented by simply placing its old name in parentheses in the schema row.")]),t._v(" "),a("p",[t._v("In our earlier example, "),a("code",[t._v("LOCAL")]),t._v(" has the columns "),a("em",[t._v("bridge")]),t._v(", "),a("em",[t._v("designer")]),t._v(", and "),a("em",[t._v("length")]),t._v(", while "),a("code",[t._v("REMOTE")]),t._v(" has the columns "),a("em",[t._v("bridge")]),t._v(", "),a("em",[t._v("opened")]),t._v(", and "),a("em",[t._v("lead designer")]),t._v(" ("),a("em",[t._v("designer")]),t._v(" renamed). So "),a("em",[t._v("opened")]),t._v(" is inserted and "),a("em",[t._v("length")]),t._v(" is deleted:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}},[t._v("data from compared tables")])]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc",attrs:{rowspan:"3"}}),a("td",[t._v("+")]),a("td",[t._v("Brooklyn")]),a("td",{staticClass:"add"},[t._v("1883")]),a("td",[t._v("J. A. Roebling")]),a("td",{staticClass:"remove"},[t._v("1595")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Manhattan")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("G. Lindenthal")]),a("td",{staticClass:"remove"},[t._v("1470")])]),t._v(" "),a("tr",[a("td",[t._v("+")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"add"},[t._v("1903")]),a("td",[t._v("L. L. Buck")]),a("td",{staticClass:"remove"},[t._v("1600")])])])]),t._v(" "),a("p",[t._v("If we are dealing with a data store where columns are unordered, then likewise column order in the diff is irrelevant. Otherwise, the inserted and deleted rows should be placed in their appropriate order.")]),t._v(" "),a("p",[t._v("Any rows in the diff that are present only the "),a("code",[t._v("LOCAL")]),t._v(" table will leave inserted columns blank. Similarly, any rows in the diff that are present only in the "),a("code",[t._v("REMOTE")]),t._v(" table will leave deleted columns blank. Rows that are present in both tables will have values in all cells.")]),t._v(" "),a("h2",{attrs:{id:"expressing-inserted-and-deleted-rows"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-inserted-and-deleted-rows"}},[t._v("#")]),t._v(" Expressing inserted and deleted rows")]),t._v(" "),a("p",[t._v("An inserted row is expressed simply by placing "),a("code",[t._v("+++")]),t._v(" in the action column, and placing cell values in the appropriate columns. If there are columns in the diff that are in "),a("code",[t._v("LOCAL")]),t._v(" but not in "),a("code",[t._v("REMOTE")]),t._v(", these are left blank. Likewise, a deleted row is expressed by placing "),a("code",[t._v("---")]),t._v(" in the action column, and its cell values in the appropriate columns. If there are columns in the diff that are in "),a("code",[t._v("REMOTE")]),t._v(" but not in "),a("code",[t._v("LOCAL")]),t._v(", these are left blank. For example, suppose in "),a("code",[t._v("REMOTE")]),t._v(" there is a row about a New Bridge that wasn’t in "),a("code",[t._v("LOCAL")]),t._v(", and a row about a bridge called Spamspan has been dropped. Here is what the inserted and deleted rows would look like, lined up with the header row for reference:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}})]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",{staticClass:"blank"},[a("td",[t._v(" ")]),a("td"),a("td"),a("td"),a("td"),a("td")]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"},[t._v("inserted row")]),a("td",[t._v("+++")]),a("td",[t._v("New Bridge")]),a("td",{staticClass:"add"},[t._v("2050")]),a("td",[t._v("Chimp N Zee")]),a("td",{staticClass:"remove"},[t._v("   ")])]),t._v(" "),a("tr",{staticClass:"blank"},[a("td",[t._v(" ")]),a("td"),a("td"),a("td"),a("td"),a("td")]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"},[t._v("deleted row")]),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td"),a("td",[t._v("S. Spamington")]),a("td",{staticClass:"remove"},[t._v("10000")])])])]),t._v(" "),a("p",[t._v("If the diff is on a database table where rows have no ordering, then we can just stick these rows together and we have our diff:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}})]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"},[t._v("inserted row")]),a("td",[t._v("+++")]),a("td",[t._v("New Bridge")]),a("td",{staticClass:"add"},[t._v("2050")]),a("td",[t._v("Chimp N Zee")]),a("td",{staticClass:"remove"},[t._v("   ")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"},[t._v("deleted row")]),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td"),a("td",[t._v("S. Spamington")]),a("td",{staticClass:"remove"},[t._v("10000")])])])]),t._v(" "),a("p",[t._v("If the diff is on a spreadsheet table or CSV file, we’d generally want to respect row ordering. In this case, we can add context rows around insertions so we know where to put them. Less importantly, since they are going away anyway, we can do the same for deletions:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",{staticClass:"desc"},[a("td",{staticClass:"desc"}),a("td",[t._v("action"),a("br"),t._v("column")]),a("td",{attrs:{colspan:"4"}})]),t._v(" "),a("tr",{staticClass:"spec"},[a("td",{staticClass:"desc"},[t._v("schema row")]),a("td",[t._v("!")]),a("td"),a("td",{staticClass:"add"},[t._v("+++")]),a("td",[t._v("(designer)")]),a("td",{staticClass:"remove"},[t._v("---")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("header row")]),a("th",[t._v("@@")]),a("th",[t._v("bridge")]),a("th",{staticClass:"add"},[t._v("opened")]),a("th",[t._v("lead designer")]),a("th",{staticClass:"remove"},[t._v("length")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("omitted rows")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("context row")]),a("td",[t._v("+")]),a("td",[t._v("Williamsburg")]),a("td",{staticClass:"add"},[t._v("1903")]),a("td",[t._v("L. L. Buck")]),a("td",{staticClass:"remove"},[t._v("1600")])]),t._v(" "),a("tr",{staticClass:"add"},[a("td",{staticClass:"desc"},[t._v("inserted row")]),a("td",[t._v("+++")]),a("td",[t._v("New Bridge")]),a("td",{staticClass:"add"},[t._v("2050")]),a("td",[t._v("Chimp N Zee")]),a("td",{staticClass:"remove"},[t._v("   ")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("context row")]),a("td",[t._v("+")]),a("td",[t._v("Queensborough")]),a("td",{staticClass:"add"},[t._v("1909")]),a("td",[t._v("Palmer & Hornbostel")]),a("td",{staticClass:"remove"},[t._v("1182")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("omitted rows")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")]),a("td",[t._v("...")])]),t._v(" "),a("tr",[a("td",{staticClass:"desc"},[t._v("context row")]),a("td",[t._v("+")]),a("td",[t._v("George Washington")]),a("td",{staticClass:"add"},[t._v("1931")]),a("td",[t._v("O. H. Ammann")]),a("td",{staticClass:"remove"},[t._v("3500")])]),t._v(" "),a("tr",{staticClass:"remove"},[a("td",{staticClass:"desc"},[t._v("deleted row")]),a("td",[t._v("---")]),a("td",[t._v("Spamspan")]),a("td"),a("td",[t._v("S. Spamington")]),a("td",{staticClass:"remove"},[t._v("10000")])])])]),t._v(" "),a("p",[t._v("The action column for a context row may contain a blank, or "),a("code",[t._v(":")]),t._v(", or "),a("code",[t._v("+")]),t._v(". The "),a("code",[t._v(":")]),t._v(" tag signifies the context row was moved (and its location is now as in the "),a("code",[t._v("REMOTE")]),t._v(" table). The "),a("code",[t._v("+")]),t._v(" signifies that there are cells added on that row.")]),t._v(" "),a("h2",{attrs:{id:"expressing-a-modified-cell-value"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-a-modified-cell-value"}},[t._v("#")]),t._v(" Expressing a modified cell value")]),t._v(" "),a("p",[t._v("If a row contains a cell whose value is different in the compared tables, then that row should be shown in the diff, with a tag in the action column that ends in "),a("code",[t._v("->")]),t._v(". Then, the modified cell will be represented by converting the "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(" values to text (we have yet to say how) and using the action tag as a separator. So for example here we change the last cell in a row from “Green” to “Blue”:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",[a("td",{staticClass:"modify"},[t._v("->")]),a("td",[t._v("Gnome")]),a("td",[t._v("Home and Garden")]),a("td",{staticClass:"modify"},[t._v("Green->Blue")])])])]),t._v(" "),a("p",[t._v("The tag must be preceded with as many extra "),a("code",[t._v("-")]),t._v(" characters as are needed to avoid collision with any character sequence on that row. So here is another row with exactly one cell changed:")]),t._v(" "),a("div",{staticClass:"highlighter"},[a("table",[a("tr",[a("td",{staticClass:"modify"},[t._v("--\x3e")]),a("td",[t._v("Console")]),a("td",[t._v("Toddlers -> Teenagers")]),a("td",{staticClass:"modify"},[t._v("White--\x3ePale")])])])]),t._v(" "),a("p",[t._v("When encoding a cell change as a string, we lose information about the type of the cell value. One distinction that may be important to retain is the difference between a NULL or empty cell, and the empty string. The tabular diff uses the following encoding:")]),t._v(" "),a("ul",[a("li",[t._v("A NULL value, if available, represents itself.")]),t._v(" "),a("li",[t._v("The encoded string "),a("code",[t._v("NULL")]),t._v(" represents a NULL value.")]),t._v(" "),a("li",[t._v("The encoded string "),a("code",[t._v("_NULL")]),t._v(" represents the string “NULL”.")]),t._v(" "),a("li",[t._v("The encoded string "),a("code",[t._v("__NULL")]),t._v(" represents the string “_NULL”.")]),t._v(" "),a("li",[t._v("…")])]),t._v(" "),a("p",[t._v("The goal is that the diff can be safely converted to and from CSV by existing tools without changing its meaning. To that end:")]),t._v(" "),a("ul",[a("li",[t._v("For matching (e.g. on context lines) blank cells in the diff (either the NULL value or an empty string) should be treated as ambiguous, and match "),a("em",[t._v("either")]),t._v(" of NULL or an empty string if an exact match is not available.")]),t._v(" "),a("li",[t._v("When using a diff as a patch, and inserting new cells, a blank cell in the diff (either the NULL value or an empty string) should be treated as ambiguous, and the “right” thing done given the column type. If either value could be inserted, then the blank string should be inserted (since the encoded string "),a("code",[t._v("NULL")]),t._v(" is available to specifically identify the NULL value).")])]),t._v(" "),a("p",[t._v("Note that if the diff is being expressed in a table that allows nested structure (e.g. a JSON representation), a list representation for modified cells might be used to avoid this issue. There is no specification for that at this time.")]),t._v(" "),a("h2",{attrs:{id:"expressing-a-moved-row"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-a-moved-row"}},[t._v("#")]),t._v(" Expressing a moved row")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("This can be ignored for tables for which row order is meaningless, e.g. in typical relational databases.")])]),t._v(" "),a("p",[t._v("A row that have been moved in a table for which row order is meaningful is marked with a "),a("code",[t._v(":")]),t._v(" tag in the action column and placed in the order it appears in the "),a("code",[t._v("REMOTE")]),t._v(" table.")]),t._v(" "),a("p",[t._v("To avoid burdening human readers with too much arcana, tags are "),a("em",[t._v("not")]),t._v(" combined when multiple kinds of actions apply to a row or column. So for example, a context row that was moved and had a cell added will "),a("em",[t._v("not")]),t._v(" be tagged as "),a("code",[t._v(":+")]),t._v(" or "),a("code",[t._v("+:")]),t._v(" or such-like, but rather by "),a("code",[t._v(":")]),t._v(". Cell addition can be determined from the schema row. These weak tags are included as aids for highlighting to express the most significant thing to know about a row.")]),t._v(" "),a("h2",{attrs:{id:"expressing-a-moved-column"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#expressing-a-moved-column"}},[t._v("#")]),t._v(" Expressing a moved column")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("This can be ignored for tables for which column order is meaningless.")])]),t._v(" "),a("p",[t._v("A column that have been moved in a table for which column order is meaningful is marked with a "),a("code",[t._v(":")]),t._v(" tag in the schema row and placed in the order it appears in the "),a("code",[t._v("REMOTE")]),t._v(" table.")]),t._v(" "),a("p",[t._v("If a diff that contains a "),a("code",[t._v(":")]),t._v(" tag is used to patch a table for which column order is not meaningful, that tag should simply be ignored.")]),t._v(" "),a("h2",{attrs:{id:"reference-action-column-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reference-action-column-tags"}},[t._v("#")]),t._v(" Reference: action column tags")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Symbol")]),t._v(" "),a("th",[t._v("Meaning")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("@@")])]),t._v(" "),a("td",[t._v("The header row, giving column names.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("!")])]),t._v(" "),a("td",[t._v("The schema row, given column differences.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("+++")])]),t._v(" "),a("td",[t._v("An inserted row (present in "),a("code",[t._v("REMOTE")]),t._v(", not present in "),a("code",[t._v("LOCAL")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("---")])]),t._v(" "),a("td",[t._v("A deleted row (present in "),a("code",[t._v("LOCAL")]),t._v(", not present in "),a("code",[t._v("REMOTE")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("->")])]),t._v(" "),a("td",[t._v("A row with at least one cell modified cell. "),a("code",[t._v("--\x3e")]),t._v(", "),a("code",[t._v("---\x3e")]),t._v(", "),a("code",[t._v("----\x3e")]),t._v(" etc. have the same meaning.")])]),t._v(" "),a("tr",[a("td",[t._v("Blank")]),t._v(" "),a("td",[t._v("A blank string or NULL marks a row common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(", given for context.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("...")])]),t._v(" "),a("td",[t._v("Declares that rows common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(" are being skipped.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("+")])]),t._v(" "),a("td",[t._v("A row with at least one added cell.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v(":")])]),t._v(" "),a("td",[t._v("A reordered row.")])])])]),t._v(" "),a("h2",{attrs:{id:"reference-schema-row-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reference-schema-row-tags"}},[t._v("#")]),t._v(" Reference: schema row tags")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Symbol")]),t._v(" "),a("th",[t._v("Meaning")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("+++")])]),t._v(" "),a("td",[t._v("An inserted column (present in "),a("code",[t._v("REMOTE")]),t._v(", not present in "),a("code",[t._v("LOCAL")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("---")])]),t._v(" "),a("td",[t._v("A deleted column (present in "),a("code",[t._v("LOCAL")]),t._v(", not present in "),a("code",[t._v("REMOTE")]),t._v(").")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("()")])]),t._v(" "),a("td",[t._v("A renamed column (the name in "),a("code",[t._v("LOCAL")]),t._v(" is given in parenthesis, and the name in "),a("code",[t._v("REMOTE")]),t._v(" will be in the header row).")])]),t._v(" "),a("tr",[a("td",[t._v("Blank")]),t._v(" "),a("td",[t._v("A blank string or NULL marks a column common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(", given for context.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("...")])]),t._v(" "),a("td",[t._v("Declares that columns common to "),a("code",[t._v("LOCAL")]),t._v(" and "),a("code",[t._v("REMOTE")]),t._v(" are being skipped.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v(":")])]),t._v(" "),a("td",[t._v("A reordered column.")])])])])],1)}),[],!1,null,null,null);e.default=d.exports}}]); \ No newline at end of file diff --git a/assets/js/app.2cbe3852.js b/assets/js/app.51b46ea3.js similarity index 92% rename from assets/js/app.2cbe3852.js rename to assets/js/app.51b46ea3.js index 499f9b78..58283e61 100644 --- a/assets/js/app.2cbe3852.js +++ b/assets/js/app.51b46ea3.js @@ -1,8 +1,8 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,s=e[0],c=e[1],u=e[2],f=0,p=[];f=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(6),o=n(7),i=n(37);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(53),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(2),o=n(12),i=n(8),a=n(73),s=n(79),c=n(30),u=c.get,l=c.enforce,f=String(String).split("String");(t.exports=function(t,e,n,s){var c,u=!!s&&!!s.unsafe,p=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),(c=l(n)).source||(c.source=f.join("string"==typeof e?e:""))),t!==r?(u?!d&&t[e]&&(p=!0):delete t[e],p?t[e]=n:o(t,e,n)):p?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},function(t,e,n){var r=n(2),o=n(128),i=n(104),a=n(12),s=n(3),c=s("iterator"),u=s("toStringTag"),l=i.values;for(var f in o){var p=r[f],d=p&&p.prototype;if(d){if(d[c]!==l)try{a(d,c,l)}catch(t){d[c]=l}if(d[u]||a(d,u,f),o[f])for(var v in i)if(d[v]!==i[v])try{a(d,v,i[v])}catch(t){d[v]=i[v]}}}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(35),o=n(20);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(138),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e,n){var r=n(106),o=n(2),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!1},function(t,e,n){var r=n(6),o=n(80),i=n(37),a=n(17),s=n(36),c=n(8),u=n(105),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=s(e,!0),u)try{return l(t,e)}catch(t){}if(c(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(229),o=n(232);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):o&&(c=s?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r,o=n(5),i=n(184),a=n(78),s=n(40),c=n(110),u=n(74),l=n(54),f=l("IE_PROTO"),p=function(){},d=function(t){return" - + @@ -117,6 +117,6 @@

# Product pages

hexagon:
 github: # list of github repos ...
 
Last Updated: 2/17/2020, 12:56:48 PM
- + diff --git a/csv-dialect/index.html b/csv-dialect/index.html index 74eefeb8..dbf016c2 100644 --- a/csv-dialect/index.html +++ b/csv-dialect/index.html @@ -8,7 +8,7 @@ - + @@ -98,6 +98,6 @@ } }
- + diff --git a/data-package-identifier/index.html b/data-package-identifier/index.html index 83a61873..883906b2 100644 --- a/data-package-identifier/index.html +++ b/data-package-identifier/index.html @@ -8,7 +8,7 @@ - + @@ -105,6 +105,6 @@ original: }

It can be parsed (and less importantly) serialized to a simple string. Spec strings will be frequently used on e.g. the command line to identify a data package.

# Identifier String

An Identifier String is a single string (rather than JSON object) that points to a Data Package. An Identifier String can be, in decreasing order of explicitness:

  • A URL that points directly to the datapackage.json (no resolution needed):

http://mywebsite.com/mydatapackage/datapackage.json (opens new window)

  • A URL that points directly to the Data Package (that is, the directory containing the datapackage.json):

http://mywebsite.com/mydatapackage/ (opens new window)

resolves to:

http://mywebsite.com/mydatapackage/datapackage.json (opens new window)

  • A GitHub URL:

http://github.com/datasets/gold-prices (opens new window)

resolves to:

https://raw.githubusercontent.com/datasets/gold-prices/master/datapackage.json (opens new window)

gold-prices

resolves to:

https://datahub.io/core/gold-prices/datapackage.json (opens new window)

- + diff --git a/data-package/index.html b/data-package/index.html index b4531a63..13cc7a8b 100644 --- a/data-package/index.html +++ b/data-package/index.html @@ -8,7 +8,7 @@ - + @@ -150,6 +150,6 @@ "created": "1985-04-12T23:20:50.52Z" }
Last Updated: 10/11/2022, 4:12:07 PM
- + diff --git a/data-resource/index.html b/data-resource/index.html index 127ce1ad..c77da1d5 100644 --- a/data-resource/index.html +++ b/data-resource/index.html @@ -8,7 +8,7 @@ - + @@ -166,6 +166,6 @@ the hash’s value with the algorithm name in lower-case. For example:

"hash": "sha1:8843d7f92416211de9ebb963ff4ce28125932878"
 
  • sources: as for Data Package metadata.

  • licenses: as for Data Package metadata. If not specified the resource
    inherits from the data package.

  • # Resource Schemas

    A Data Resource MAY have a schema property to describe the schema of the resource data.

    The value for the schema property on a resource MUST be an object representing the schema OR a string that identifies the location of the schema.

    If a string it must be a url-or-path as defined above, that is a fully qualified http URL or a relative POSIX path. The file at the location specified by this url-or-path string MUST be a JSON document containing the schema.

    NOTE: the Data Package specification places no restrictions on the form of the schema Object. This flexibility enables specific communities to define schemas appropriate for the data they manage. As an example, the Tabular Data Package specification requires the schema to conform to Table Schema.

    - + diff --git a/fiscal-data-package--budgets/index.html b/fiscal-data-package--budgets/index.html index 8608e7b5..0d164d68 100644 --- a/fiscal-data-package--budgets/index.html +++ b/fiscal-data-package--budgets/index.html @@ -8,7 +8,7 @@ - + @@ -87,6 +87,6 @@ (opens new window)

    WARNING

    This is a draft specification and still under development. If you have comments or suggestions please file them in the issue tracker (opens new window). If you have explicit changes please fork the git repo (opens new window) and submit a pull request.

    # Fiscal Data Package - Budget Standard Taxonomy

    The Budget Taxonomy is a set of ColumnTypes to be used in the context of a Fiscal Data Package to describe budget data of organizations (governments or otherwise.)

    Author(s)
    Created 14 March 2014
    Updated 22 April 2018
    JSON Schema fiscal-data-package-budgets.json
    Version 1.0-rc.1

    # Language

    The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119

    # Changelog

    • 1.0.0rc1: Initial text

    # Introduction

    This document contains a ColumnType taxonomy to be used for publishing budget data files.

    The ColumnTypes contained in this taxonomy contain:

    • Generic value types
    • Generic time types as well as the more specific ‘fiscal year’ type
    • Classifications:
      • Functional: COFOG and Generic
      • Economic: GFSM and Generic
      • Administrative
      • Activity
    • Other Budgeting-related Properties
    • Geo-Related types

    # References

    # Location

    The canonic location for this taxonomy’s ColumnType definition - to be used in fiscal data package descriptors - is

    https://specs.frictionlessdata.io/taxonomies/fiscal/budgets.json

    # The Taxonomy

    # Amounts and their properties

    # value

    Numeric value depicting a fiscal amount related to the budget item, spending transaction etc.

    • dataType: number
    # value-kind:code

    Unique identifier for the amount kind

    • dataType: string
    • unique: True
    # value-kind:label

    Display name for the amount kind

    • dataType: string
    • labelOf: value-kind:code
    # value-currency:code

    Unique identifier for the amount currency

    • dataType: string
    • unique: True
    # value-currency:label

    Display name for the amount currency

    • dataType: string
    • labelOf: value-kind:code

    # Time Indication

    # date:fiscal-year

    The fiscal-year for which the values in this record are relevant

    • dataType: integer
    • unique: True
    # date:fiscal:activity-approval

    The approval date of a specific activity

    • dataType: date
    • unique: True
    # date:fiscal:activity-end

    The ending date of a specific activity

    • dataType: date
    • unique: True
    # date:fiscal:activity-start

    The starting date of a specific activity

    • dataType: date
    • unique: True
    # date:fiscal:final-payment

    The date of the last payment for a specific activity

    • dataType: date
    • unique: True
    # date:fiscal:first-payment

    The date of the first payment for a specific activity

    • dataType: date
    • unique: True
    # date:generic

    An non-specific date related to the values in this record (e.g. transaction date etc.)

    • dataType: date
    • unique: True

    # Classifications: Functional (COFOG)

    # functional-classification:cofog:class:code

    The COFOG ‘Class’ Level code

    • dataType: string
    • prior: functional-classification:cofog:group:code
    • unique: True
    # functional-classification:cofog:class:description

    A more detailed textual description for this class

    • dataType: string
    # functional-classification:cofog:class:label

    A label or display name for this class

    • dataType: string
    • labelOf: functional-classification:cofog:class:code
    # functional-classification:cofog:code

    The complete COFOG classification code, non level-specific

    • dataType: string
    • unique: True
    # functional-classification:cofog:description

    Description for this COFOG classification, non level-specific

    • dataType: string
    # functional-classification:cofog:division:code

    The COFOG ‘Division’ Level code

    • dataType: string
    • unique: True
    # functional-classification:cofog:division:description

    A more detailed textual description for this division

    • dataType: string
    # functional-classification:cofog:division:label

    A label or display name for this division

    • dataType: string
    • labelOf: functional-classification:cofog:division:code
    # functional-classification:cofog:group:code

    The COFOG ‘Group’ Level code

    • dataType: string
    • prior: functional-classification:cofog:division:code
    • unique: True
    # functional-classification:cofog:group:description

    A more detailed textual description for this group

    • dataType: string
    # functional-classification:cofog:group:label

    A label or display name for this group

    • dataType: string
    • labelOf: functional-classification:cofog:group:code
    # functional-classification:cofog:label

    Display name for this COFOG classification, non level-specific

    • dataType: string
    • labelOf: functional-classification:cofog:code

    # Classifications: Functional (non-specific)

    # functional-classification:generic:code

    A code or unique identifier for the classification (not level specific)

    • dataType: string
    • unique: True
    # functional-classification:generic:description

    A longer descriptive text for this classification

    • dataType: string
    # functional-classification:generic:label

    A label, title or display name for the classification

    • dataType: string
    • labelOf: functional-classification:generic:code
    # functional-classification:generic:level{1..8}:code

    A code or unique identifier for the top level of the classification

    • dataType: string
    • unique: True
    # functional-classification:generic:level{1..8}:description

    A longer descriptive text for this level of the classification

    • dataType: string
    # functional-classification:generic:level{1..8}:label

    A label, title or display name for this level of the classification

    • dataType: string
    • labelOf: functional-classification:generic:level1:code

    # Classifications: Economic (GFSM)

    # economic-classification:gfsm:level{1..4}:code

    A code or unique identifier for the top level of the classification

    • dataType: string
    • unique: True
    # economic-classification:gfsm:level{1..4}:description

    A longer descriptive text for this level of the classification

    • dataType: string
    # economic-classification:gfsm:level{1..4}:label

    A label, title or display name for this level of the classification

    • dataType: string
    • labelOf: economic-classification:gfsm:level1:code

    # Classifications: Economic (non-specific)

    # economic-classification:generic:code

    A code or unique identifier for the classification (not level specific)

    • dataType: string
    • unique: True
    # economic-classification:generic:description

    A longer descriptive text for this classification

    • dataType: string
    # economic-classification:generic:label

    A label, title or display name for the classification

    • dataType: string
    • labelOf: economic-classification:generic:code
    # economic-classification:generic:level{1..4}:code

    A code or unique identifier for the top level of the classification

    • dataType: string
    • unique: True
    # economic-classification:generic:level{1..4}:description

    A longer descriptive text for this level of the classification

    • dataType: string
    # economic-classification:generic:level{1..4}:label

    A label, title or display name for this level of the classification

    • dataType: string
    • labelOf: economic-classification:generic:level1:code

    # Classifications: Administrative

    # administrative-classification:generic:code

    A code or unique identifier for the classification (not level specific)

    • dataType: string
    • unique: True
    # administrative-classification:generic:description

    A longer descriptive text for this classification

    • dataType: string
    # administrative-classification:generic:label

    A label, title or display name for the classification

    • dataType: string
    • labelOf: administrative-classification:generic:code
    # administrative-classification:generic:level{1..8}:code

    A code or unique identifier for the top level of the classification

    • dataType: string
    • unique: True
    # administrative-classification:generic:level{1..8}:description

    A longer descriptive text for this level of the classification

    • dataType: string
    # administrative-classification:generic:level{1..8}:label

    A label, title or display name for this level of the classification

    • dataType: string
    • labelOf: administrative-classification:generic:level1:code
    # activity:generic:contract:code

    A code or unique identifier for the contract

    • dataType: string
    • prior: activity:generic:subproject:code
    • unique: True
    # activity:generic:contract:label

    A label, title or display name for this contract

    • dataType: string
    • labelOf: activity:generic:contract:code
    # activity:generic:program:code

    A code or unique identifier for the program

    • dataType: string
    • unique: True
    # activity:generic:program:label

    A label, title or display name for this program

    • dataType: string
    • labelOf: activity:generic:program:code
    # activity:generic:project:code

    A code or unique identifier for the project

    • dataType: string
    • prior: activity:generic:subprogram:code
    • unique: True
    # activity:generic:project:label

    A label, title or display name for this project

    • dataType: string
    • labelOf: activity:generic:project:code
    # activity:generic:subprogram:code

    A code or unique identifier for the subprogram

    • dataType: string
    • prior: activity:generic:program:code
    • unique: True
    # activity:generic:subprogram:label

    A label, title or display name for this subprogram

    • dataType: string
    • labelOf: activity:generic:subprogram:code
    # activity:generic:subproject:code

    A code or unique identifier for the sub-project

    • dataType: string
    • prior: activity:generic:project:code
    • unique: True
    # activity:generic:subproject:label

    A label, title or display name for this sub-project

    • dataType: string
    • labelOf: activity:generic:subproject:code
    # budget-line-id

    A unique identifier for this budget line

    • dataType: string
    • unique: True
    # budgetary-transfers

    Extra properties regarding whether the expenditure contains budgetary transfers

    • dataType: string
    # direction

    Specifies whether the values in this line are expenditure or revenues

    • dataType: string
    • unique: True
    # phase:id

    The phase identifier

    • dataType: string
    • unique: True
    # phase:label

    The phase display name

    • dataType: string
    • labelOf: phase:id
    # expenditure-type:code

    Unique identifier for the expenditure type

    • dataType: string
    • unique: True
    # expenditure-type:label

    Display name for the expenditure type

    • dataType: string
    • labelOf: expenditure-type:code
    # fin-source:generic:code

    A code or unique identifier for the financial source

    • dataType: string
    • unique: True
    # fin-source:generic:label

    Display name or title for the financial source

    • dataType: string
    • labelOf: fin-source:generic:code
    # fin-source:generic:level{1..3}:code

    A code or unique identifier for the top level of the financial source hierarchy

    • dataType: string
    • unique: True
    # fin-source:generic:level{1..3}:label

    Display name or title for the top level of the financial source hierarchy

    • dataType: string
    • labelOf: fin-source:generic:level1:code

    # Geographic Information

    # geo:generic:code

    Unique identifier or code for Geographic feature specified in the data

    • dataType: string
    • unique: True
    # geo:generic:codeList

    Indicates a specific code list from which a Geographic identifier is drawn

    • dataType: string
    • unique: True
    # geo:generic:title

    The display name of the geographic feature

    • dataType: string
    • labelOf: geo:generic:code
    # geo:source:code

    Unique identifier or code for Geographic feature specified in the data

    • dataType: string
    • unique: True
    # geo:source:codeList

    Indicates a specific code list from which a Geographic identifier is drawn

    • dataType: string
    • unique: True
    # geo:source:title

    The display name of the geographic feature

    • dataType: string
    • labelOf: geo:source:code
    # geo:target:code

    Unique identifier or code for Geographic feature specified in the data

    • dataType: string
    • unique: True
    # geo:target:codeList

    Indicates a specific code list from which a Geographic identifier is drawn

    • dataType: string
    • unique: True
    # geo:target:level{1..2}:code

    Unique identifier or code for the Top Level Geographic feature specified in the data

    • dataType: string
    • unique: True
    # geo:target:level{1..2}:title

    The display name for the Top Level Geographic feature specified in the data

    • dataType: string
    • labelOf: geo:target:level1:code
    # geo:target:title

    The display name of the geographic feature

    • dataType: string
    • labelOf: geo:target:code
    - + diff --git a/fiscal-data-package--spending/index.html b/fiscal-data-package--spending/index.html index f5d0d1a7..884edb62 100644 --- a/fiscal-data-package--spending/index.html +++ b/fiscal-data-package--spending/index.html @@ -8,7 +8,7 @@ - + @@ -86,6 +86,6 @@ Back to the main site (opens new window)

    WARNING

    This is a draft specification and still under development. If you have comments or suggestions please file them in the issue tracker (opens new window). If you have explicit changes please fork the git repo (opens new window) and submit a pull request.

    # Fiscal Data Package - Spending Standard Taxonomy

    The Budget Taxonomy is a set of ColumnTypes to be used in the context of a Fiscal Data Package to describe spending data of organizations (governments or otherwise.)

    Author(s)
    Created 14 March 2014
    Updated 22 April 2018
    JSON Schema fiscal-data-package-spending.json
    Version 1.0-rc.1

    # Language

    The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119

    # Changelog

    • 1.0.0rc1: Initial text

    # Introduction

    This document contains a ColumnType taxonomy to be used for publishing spending data files. It should be used in conjunction with the budget taxonomy, as it contains some common ColumnTypes as well.

    The ColumnTypes contained in this taxonomy contain:

    • Transactions Identifiers
    • Details about administrators, procurers, suppliers and recipients
    • Some Geographic related types (esp. for addresses)

    # References

    # Location

    The canonic location for this taxonomy’s ColumnType definition - to be used in fiscal data package descriptors - is

    https://specs.frictionlessdata.io/taxonomies/fiscal/spending.json

    # The Taxonomy

    # Amounts and their properties

    # Geographic Information

    # geo:address:city:code

    The code of the city part of the address

    • dataType: string
    • prior: geo:address:county:code
    • unique: True
    # geo:address:city:label

    The name of the city part of the address

    • dataType: string
    • labelOf: geo:address:city:code
    # geo:address:country:code

    The code of the country part of the address

    • dataType: string
    • unique: True
    # geo:address:country:label

    The name of the country part of the address

    • dataType: string
    • labelOf: geo:address:country:code
    # geo:address:county:code

    The code of the county part of the address

    • dataType: string
    • prior: geo:address:region:code
    • unique: True
    # geo:address:county:label

    The name of the county part of the address

    • dataType: string
    • labelOf: geo:address:county:code
    # geo:address:region:code

    The code of the region part of the address

    • dataType: string
    • prior: geo:address:country:code
    • unique: True
    # geo:address:region:label

    The name of the region part of the address

    • dataType: string
    • labelOf: geo:address:region:code
    # geo:address:street-address:description

    Actual street address in whole address

    • dataType: string
    # geo:address:zip:code

    The postal code in the address

    • dataType: string
    • prior: geo:address:city:code
    • unique: True

    # Actors involved in the Transaction (Administrator, Procurer)

    # administrator:generic:id

    Unique identifier for the Administrator

    • dataType: string
    • unique: True
    # administrator:generic:name

    The display name for the Administrator

    • dataType: string
    • labelOf: administrator:generic:id
    # procurer:bank:account

    Unique identifier for the bank account of the Procurer

    • dataType: string
    # procurer:bank:branch:code

    Unique identifier of the bank’s branch of the Procurer

    • dataType: string
    • unique: True
    # procurer:bank:branch:name

    Name of the bank’s branch of the Procurer

    • dataType: string
    • labelOf: procurer:bank:branch:code
    # procurer:bank:code

    Unique identifier for the bank of the Procurer

    • dataType: string
    • unique: True
    # procurer:generic:id

    Unique identifier for the Procurer

    • dataType: string
    • unique: True
    # procurer:generic:name

    The display name of the Procurer

    • dataType: string
    • labelOf: procurer:generic:id

    # Recipient of the Transaction

    # recipient:bank:account

    Unique identifier for the bank account of the Recipient

    • dataType: string
    # recipient:bank:branch:code

    Unique identifier of the bank’s branch of the Recipient

    • dataType: string
    • unique: True
    # recipient:bank:branch:name

    Name of the bank’s branch of the Recipient

    • dataType: string
    • labelOf: recipient:bank:branch:name
    # recipient:bank:code

    Unique identifier for the bank of the Recipient

    • dataType: string
    • unique: True
    # recipient:generic:id

    Unique identifier for the Recipient

    • dataType: string
    • unique: True

    Unique identifier for the codelist from which the legal entity code comes from

    • dataType: string
    • prior: recipient:generic:id
    • unique: True

    Unique identifier for the legal entity

    • dataType: string
    • prior: recipient:generic:legal-entity:code-type
    • unique: True

    Trading name (or other) of the legal entity

    • dataType: string
    • labelOf: recipient:generic:legal-entity:code

    Text describing the representative of the legal entity

    • dataType: string

    Code of the specific project inside the legal entity

    • dataType: string
    • prior: recipient:generic:legal-entity:code
    • unique: True

    Name of the specific project inside the legal entity

    • dataType: string

    Name of the specific project inside the legal entity

    • dataType: string
    • labelOf: recipient:generic:legal-entity:receiving-project:code

    Status of the specific project inside the legal entity

    • dataType: string
    # recipient:generic:name

    The display name for the Recipient

    • dataType: string
    • labelOf: recipient:generic:id
    # recipient:generic:url

    An Internet address for the Recipient

    • dataType: string

    # Supplier Details

    # supplier:generic:id

    Unique identifier for the Supplier

    • dataType: string
    • unique: True
    # supplier:generic:name

    The display name for the Supplier

    • dataType: string
    • labelOf: supplier:generic:id

    # Transaction Details

    # transaction-id:budget-code

    Unique identifier for the Budget Line for this transaction

    • dataType: string
    • unique: True
    # transaction-id:code

    A Unique identifier for this transaction

    • dataType: string
    • unique: True
    # transaction-id:contract-id

    Unique identifier for the Contract for this transaction

    • dataType: string
    • unique: True
    # transaction-id:court-order

    Unique identifier for the Court Order for this transaction

    • dataType: string
    • unique: True
    # transaction-id:invoice-id

    Unique identifier for the Invoice for this transaction

    • dataType: string
    • unique: True
    # transaction-id:purchase-order

    Unique identifier for the Purchase Order for this transaction

    • dataType: string
    • unique: True
    # transaction-id:tender-id

    Unique identifier for the Tender for this transaction

    • dataType: string
    • unique: True
    # transaction-id:tender-kind

    Unique identifier for the Tender Kind for this transaction

    • dataType: string
    # transaction-id:transaction-kind

    Unique identifier for the Transaction Kind for this transaction

    • dataType: string
    - + diff --git a/fiscal-data-package/index.html b/fiscal-data-package/index.html index 0753767e..0a26ad35 100644 --- a/fiscal-data-package/index.html +++ b/fiscal-data-package/index.html @@ -8,7 +8,7 @@ - + @@ -499,6 +499,6 @@
    Last Updated: 5/28/2020, 10:00:53 AM
    - + diff --git a/guides/data-package/index.html b/guides/data-package/index.html index 31654a11..cc703366 100644 --- a/guides/data-package/index.html +++ b/guides/data-package/index.html @@ -8,7 +8,7 @@ - + @@ -170,6 +170,6 @@ } }

    # Examples

    Many exemplar data packages can be found on datahub (opens new window). Specific examples:

    # World GDP

    A Data Package which includes the data locally in the repo (data is CSV).

    http://datahub.io/core/gdp (opens new window)

    Here’s the datapackage.json:

    https://pkgstore.datahub.io/core/gdp/9/datapackage.json (opens new window)

    # S&P 500 Companies Data

    This is an example with more than one resource in the data package.

    http://datahub.io/core/s-and-p-500-companies (opens new window)

    Here’s the datapackage.json:

    https://pkgstore.datahub.io/core/s-and-p-500-companies/10/datapackage.json (opens new window)

    # GeoJSON and TopoJSON

    You can see an example on how to package GeoJSON files here (opens new window).

    DataHub does not currently support the TopoJSON format. You can use “Vega Graph Spec” and display your TopoJSON data using the Vega specification (opens new window). See an example here (opens new window).

    - + diff --git a/guides/implementation/index.html b/guides/implementation/index.html index 8019bcf6..ce2bdaba 100644 --- a/guides/implementation/index.html +++ b/guides/implementation/index.html @@ -8,7 +8,7 @@ - + @@ -85,6 +85,6 @@

    # Implementation

    This document is meant to serve as an introduction and an entry point into writing a library that implements a Frictionless Data specification. The focus is on two libraries in particular - Data Package and Table Schema - as implementing these libraries essentially implements the whole family of specifications.

    The reader, being an implementer/maintainer of such libraries, should get a clear understanding of the reference material available for undertaking work, and the minimal set of actions that such libraries must enable for their users.

    We prefer to focus on actions rather than features, feature sets, user stories, or more formal API specifications as we want to leave enough flexibility for implementations that follow the idioms of the host language, yet we do want to ensure a common base of what can be done with an implementation in any language.

    # Context

    While OKI and various other 3rd parties have been using the Data Package family of specifications with great success for several years, it has mostly been over the last 12 months that we are starting to see more mature libraries to implement the specifications at a “low level” for ease of reuse.

    At present, we consider the libraries maintained by Open Knowledge International in both Python and JavaScript to be reference implementations that serve as a guide for how to approach the specifications in code, and the type of actions that are enabled for users of the libraries. Further, we make extensive use of JSON Schema (opens new window) to validate descriptors that are passed to these libraries. This enables significant reuse across implementations for descriptor validation logic.

    # High-level requirements

    Here we will describe the minimal requirements for implementing Frictionless Data specifications in a given programming language. Based on the Python and JavaScript implementations, the implementations are split across two packages: Data Package and Table Schema.

    Also, see the stack reference (opens new window) section below for some naming conventions we use, and that ideally should be followed in new implementations.

    # Data Package library

    The Data Package library can load and validate any descriptor for a Data Package Profile, allow the creation and modification of descriptors, and expose methods for reading and streaming data in the package. When a descriptor is a Tabular Data Package, it uses the Table Schema library, and exposes its functionality, for each resource object in the resources array.

    # References

    # Actions

    • read an existing Data Package descriptor
    • validate an existing Data Package descriptor, including profile-specific validation via the registry of JSON Schemas
    • create a new Data Package descriptor
    • edit an existing Data Package descriptor
    • as part of editing a descriptor, helper methods to add and remove resources from the resources array
    • validate edits made to a data package descriptor
    • save a Data Package descriptor to a file path
    • zip a Data Package descriptor and its co-located references (more generically: “zip a data package”)
    • read a zip file that “claims” to be a data package
    • save a zipped Data Package to disk

    # Examples

    # Table Schema library

    The Table Schema library can load and validate any Table Schema descriptor, allow the creation and modification of descriptors, expose methods for reading and streaming data that conforms to a Table Schema via the Tabular Data Resource abstraction.

    # References

    # Actions

    • read an existing Table Schema descriptor
    • validate an existing Table Schema descriptor using the JSON Schema spec
    • create a new Table Schema descriptor
    • edit an existing Table Schema descriptor
    • provide a model-type interface to interact with a descriptor
    • infer a Table Schema descriptor from a supplied sample of data
    • validate a data source against the Table Schema descriptor, including in response to editing the descriptor
    • enable streaming and reading of a data source through a Table Schema (cast on iteration)

    # Examples

    # On dereferencing and descriptor validation

    Some properties in the Frictionless Data specifications allow a path (a URL or a POSIX path) that resolves to an object.

    The most prominent example of this is the schema property on Tabular Data Resource descriptors.

    Allowing such references has practical use for publishers, for example in allowing schema reuse. However, it does introduce difficulties in the validation of such properties. For example, validating a path pointing to a schema rather than the schema object itself will do little to guarantee the integrity of the schema definition. Therefore implementors MUST dereference such “referential” property values before attempting to validate a descriptor. At present, this requirement applies to the following properties in Tabular Data Package and Tabular Data Resource:

    • schema
    • dialect

    # Other libraries

    Data Package and Table Schema implement the core Frictionless Data specifications. The JavaScript implementations maintained by Open Knowledge International essentially follow the above requirements as is. However, our Python toolchain has some additional libraries - goodtables and tabulator - which are an important part of the Frictionless Data stack, and we would be delighted to see them implemented in other languages either as standalone libraries, or, as part of a wider effort in implementing Data Package and Table Schema.

    # tabulator

    tabulator provides a consistent interface for streaming reading and writing of tabular data. It supports CSV, which is required for Table Schema, Tabular Data Resource, and Tabular Data Package, and also supports Excel, JSON, newline delimited JSON, Google Sheets, and ODS.

    # References

    # goodtables

    goodtables validates tabular data, checking for structural and schematic errors, and producing reports that can be used to iterate on data file sources as part of common data publication work flows. goodtables uses tabulator, tableschema, and datapackage internally, as well as implementing data-quality-spec.

    It may be of general interest that goodtables is also available as a service - goodtables.io (opens new window) - providing continuous data validation in the style of CI solutions for code.

    # References

    # Work process

    Open Knowledge International coding standards can be found here (opens new window). While some of the standards document refers to idioms in JavaScript and Python, much of it is about more general standards around using git, testing requirements and so on. These need to be adhered to.

    We have some small example code repositories in Python and JavaScript that demonstrate these coding standards.

    If you would like to contribute sections based on idioms in your target language, that would be great: it will serve as a further reference to others, and also have the added benefit of enabling our team to learn from you.

    - + diff --git a/index.html b/index.html index 9ec946ae..38f3c07c 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - + @@ -97,6 +97,6 @@ style tdp fill:#f9f,stroke:#333,stroke-width:4px;

    # Design Philosophy

    # Simplicity

    Seek zen-like simplicity in which there is nothing to add and nothing to take away.

    # Extensibility

    Design for extensibility and customisation. This makes hard things possible and permits future evolution – nothing we build will be perfect.

    # Human-editable and machine-usable

    Specs should preserve human readability and editability whilst making machine-use easy.

    # Reuse

    Reuse and build on existing standards and formats.

    # Cross technology

    Support a broad range of languages, technologies and infrastructures – avoid being tied to any one specific system.

    # Contribute

    Contributions, comments and corrections are warmly welcomed. Most work proceeds in an RFC-style manner with discussion in the issue tracker (opens new window).

    Material is kept in a git repo on GitHub (opens new window) - fork and submit a pull request to add material. There is also an issue tracker (opens new window) which can be used for specific issues or suggestions.

    # For Editors

    This repository is the canonical repository for the core Frictionless Data specifications. The repository features:

    • JSON Schema (opens new window) representations of all specifications. These are used both in the site itself, to generate the specification pages, and likewise in the schema registry that is used by a range of libraries that implement the specifications.

    # Quick start

    • Clone the repository
    • npm install # install the dependencies to build the specifications
    • npm run build # build the specifications
    • npm run test # test the specifications
    • npm start # start the local server

    # Contribute to the specifications

    All the source data for the specifications is in the /schemas directory. In there, you will find a .json file for each specification and a set of YAML files under /schemas/dictionary/*. There is a build.js script to build the specifications.

    • .json files are JSON Schemas for each spec, normalised using the $ref feature of JSON Schema. This normalisation ensures consistency in the way the specifications are written and validated, but is only used directly by the build.js script, which generated denormalised versions.
    • /build.js creates denormalised versions of each specification be dereferencing each $ref in the source schemas, and then saves these denormalised versions to /build/schemas directory.
    • /schemas/dictionary/* has all the property definitions for each specification. This is the place to add new properties or property collections, to edit contextual information and descriptive examples, and so on. See how this information is rendered in the macros template (opens new window).

    # Adding a new specification

    Yes we welcome and encourage additions to the registry! Any spec that is added must meet the following criteria:

    • Be related to the Data Packages family of specifications.
    • Have a publicly-accessible web page describing the specification.
    • Have a JSON Schema file that describes the specification.

    See the existing entries in the registry, and then take the following steps to add a new entry:

    1. Make a new pull request called registry/{NAME_OF_SPECIFICATION}
    2. The pull request features a JSON Schema file for the new specification, and adds the spec to registry.csv
    3. Write a brief description of the spec as part of the pull request.
    - + diff --git a/patterns/index.html b/patterns/index.html index 353902c8..a50eb4f6 100644 --- a/patterns/index.html +++ b/patterns/index.html @@ -8,7 +8,7 @@ - + @@ -792,6 +792,6 @@ system missing values can typically be easily distinguished from other missing
    values when exported in CSV format (e.g., “.” in Stata or SAS, “NA” in R, or
    “” in Pandas).

    Last Updated: 11/30/2023, 9:05:12 AM
    - + diff --git a/profiles/index.html b/profiles/index.html index e2c3c525..e67d262b 100644 --- a/profiles/index.html +++ b/profiles/index.html @@ -8,7 +8,7 @@ - + @@ -86,6 +86,6 @@ Back to the main site (opens new window)

    # Profiles

    Data Package and Data Resource Profiles

    Author(s) Paul Walsh, Rufus Pollock
    Created 11 December 2016
    Updated 24 May 2017
    JSON Schema profiles.json
    Version

    # Language

    The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119

    # Introduction

    Different kinds of data need different data and metadata formats. To support these different data and metadata formats we need to extend and specialise the generic Data Package. These specialized types of Data Package (or Data Resource) are termed profiles. For example, there is a Tabular Data Package profile that specializes Data Packages specifically for tabular data.

    Thus, every Package and Resource descriptor has a profile. The namespace for the profile is the type of descriptor, so the default profile, if none is declared, is data-package for a Package descriptor and data-resource for a Resource descriptor.

    In summary, an extension of Data Package may be formalised as a profile. A profile is a Data Package which extends the default specification towards more specific needs.

    # profile Property

    In addition to the concept, we need an explicit way for publishers to state the profile they are using and consumers to discover this.

    Thus, we have a profile property that declares the profile for the descriptor for this Package or Resource. For the default Data Package and Data Resource descriptor, this SHOULD be present with a value of data-package/data-resource, but if not, the absence of a profile is equivalent to setting "profile": "data-package"/ "profile": "data-resource".

    Custom profiles MUST have a profile property, where the value is a unique identifier for that profile. This unique identifier MUST be a string and can be in one of two forms. It can be an id from the official Data Package Schema Registry, or, a fully-qualified URL that points directly to a JSON Schema that can be used to validate the profile.

    As part of the Frictionless Data Specifications project, we publish a number of Data Package profiles such as:

    We also publish the following Data Resource profiles:

    - + diff --git a/security/index.html b/security/index.html index 241f3dd7..8186d61e 100644 --- a/security/index.html +++ b/security/index.html @@ -8,7 +8,7 @@ - + @@ -142,6 +142,6 @@ 192.168.x.x range or the 10.100.x.x range. This would blunt mapping attacks against the internal network of your users
    but needs to be well thought out as even one omission could endanger network security

    Whitelist filters are much more secure as they allow the loading of Resources from a named list of domains only, but
    might be too restrictive for some uses.

    Last Updated: 2/26/2020, 10:01:56 AM
    - + diff --git a/table-schema/index.html b/table-schema/index.html index 26728cc5..513cfc07 100644 --- a/table-schema/index.html +++ b/table-schema/index.html @@ -8,7 +8,7 @@ - + @@ -343,6 +343,6 @@ } ]

    Comment: Foreign Keys create links between one Table Schema and another Table Schema, and implicitly between the data tables described by those Table Schemas. If the foreign key is referring to another Table Schema how is that other Table Schema discovered? The answer is that a Table Schema will usually be embedded inside some larger descriptor for a dataset, in particular as the schema for a resource in the resources array of a Data Package (opens new window). It is the use of Table Schema in this way that permits a meaningful use of a non-empty resource property on the foreign key.

    Table Schema draws content and/or inspiration from, among others, the following specifications and implementations:

    - + diff --git a/tabular-data-package/index.html b/tabular-data-package/index.html index 98de8248..b83c87a3 100644 --- a/tabular-data-package/index.html +++ b/tabular-data-package/index.html @@ -8,7 +8,7 @@ - + @@ -125,6 +125,6 @@ }
    - + diff --git a/tabular-data-resource/index.html b/tabular-data-resource/index.html index dbee953c..0f5fd629 100644 --- a/tabular-data-resource/index.html +++ b/tabular-data-resource/index.html @@ -8,7 +8,7 @@ - + @@ -186,6 +186,6 @@ { "A": 4, "B": 5, "C": 6 } ]
    - + diff --git a/tabular-diff/index.html b/tabular-diff/index.html index 1a5e2959..e7ee0442 100644 --- a/tabular-diff/index.html +++ b/tabular-diff/index.html @@ -8,7 +8,7 @@ - + @@ -87,6 +87,6 @@ (opens new window)

    # Tabular Diff Format

    The Tabular Diff Format is a format for expressing the difference between two tables such that the difference is itself in tabular form.

    Author(s) Paul Fitzpatrick
    Created 16 December 2011
    Updated 27 May 2014
    JSON Schema
    Version 0.8.0

    # Language

    The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119

    # Summary

    The tabular diff format expresses the difference between two versions of a table.
    Here’s an example of a diff:

    @@bridgedesignerlength
    BrooklynJ. A. Roebling1595
    +++ManhattanG. Lindenthal1470
    ->WilliamsburgD. Duck->L. L. Buck1600
    QueensboroughPalmer & Hornbostel1182
    ............
    George WashingtonO. H. Ammann3500
    ---SpamspanS. Spamington10000

    As for text diffs, the format emphasizes significant changes. Also like text diffs, the format is unambiguous without color, but readily enhanced with it. Unlike text diffs, the format preserves the original tabular structure, allowing presentation with sensible visual alignment.

    There is a reference implementation of a tool for generating and processing tabular diffs at https://github.com/paulfitz/daff (opens new window).

    # Scope

    The tabular diff format can express the following kinds of changes in a table:

    • Inserted or deleted rows.
    • Inserted, deleted, or renamed columns.
    • Modified cell values.

    If the order of the rows or columns of the the table are meaningful, then the format can also express:

    • Reordered rows or columns.

    Changes in formatting and systematic transformation of data (such as capitalization) are not expressible.

    # General structure

    Assume we have two tables, called LOCAL and REMOTE. The diff summarizes the changes needed to modify LOCAL to match REMOTE.

    The diff contains rows and columns from the tables being compared. As in regular text diffs, there is flexibility in what data is given and what is omitted.

    • A column or row that is common to the tables being compared should appear at most once.
    • Any column or row containing a modified cell should be included in the diff, and the modified cell should be represented using the procedure in Expressing a modified cell value.
    • Columns or rows that are present in one table and not in the other should be included in the diff.
    • Columns or rows that are unchanged and unneeded for context may be omitted, at the diff creator’s discretion.
    • Omitted blocks of rows or columns should be marked with a row/column full of ... cells.

    In addition, the diff contains the following special rows and columns:

    • The action column. This is always present, and is the first column in the diff if columns are ordered. If columns are not ordered, it is the column named __hilite_diff__.
    • A header row with column names. This row can be recognized since it will have the tag @@ in the action column.
    • A schema row that is needed when the column structure differs between tables. This row can be recognized since it will have the tag ! in the action column.

    Here’s an example diff, where the tables being compared share the same three columns:

    action columndata from compared tables
    header row@@bridgedesignerlength
    BrooklynJ. A. Roebling1595
    +++ManhattanG. Lindenthal1470
    ->WilliamsburgD. Duck->L. L. Buck1600
    QueensboroughPalmer & Hornbostel1182
    omitted rows............
    George WashingtonO. H. Ammann3500
    ---SpamspanS. Spamington10000

    The colors do not make up part of this specification, they are just syntax highlighting. The meaning of the various tags will become clear in later sections, for now we are just concerned with the structure of the diff. Here’s an example where there is a difference in columns: LOCAL has a length column that is removed in REMOTE, REMOTE has an opened column that wasn’t present in LOCAL, and the designer column in LOCAL is renamed as lead designer in REMOTE:

    action columndata from compared tables
    schema row!+++(designer)---
    header row@@bridgeopenedlead designerlength
    +Brooklyn1883J. A. Roebling1595
    +Manhattan1909G. Lindenthal1470
    +Williamsburg1903L. L. Buck1600
    +Queensborough1909Palmer & Hornbostel1182
    +Triborough1936O. H. Ammann1380,383
    +Bronx Whitestone1939O. H. Ammann2300
    +Throgs Neck1961O. H. Ammann1800
    +George Washington1931O. H. Ammann3500

    We see that a schema row is added above the header row to represent the changes in columns. With this general anatomy of a diff in mind, let’s look at the details of how to interpret it.

    TIP

    If writing a rule to “sniff” a file to see if it is a tabular diff, the @@ tag is a handy tell-tale. But watch out for that schema row! Also, to allow for future evolution of this format, please try to be robust to a few extra rows or columns appearing before the @@.

    # Expressing inserted and deleted columns

    An inserted column is expressed simply by including that column in the diff, and placing +++ in the schema row above the corresponding column name in the header row. Similarly, a deleted column is expressed by including that column in the diff, and placing --- in the schema row above the corresponding column name. As a special case, a renamed column is represented by simply placing its old name in parentheses in the schema row.

    In our earlier example, LOCAL has the columns bridge, designer, and length, while REMOTE has the columns bridge, opened, and lead designer (designer renamed). So opened is inserted and length is deleted:

    action
    column
    data from compared tables
    schema row!+++(designer)---
    header row@@bridgeopenedlead designerlength
    +Brooklyn1883J. A. Roebling1595
    +Manhattan1909G. Lindenthal1470
    +Williamsburg1903L. L. Buck1600

    If we are dealing with a data store where columns are unordered, then likewise column order in the diff is irrelevant. Otherwise, the inserted and deleted rows should be placed in their appropriate order.

    Any rows in the diff that are present only the LOCAL table will leave inserted columns blank. Similarly, any rows in the diff that are present only in the REMOTE table will leave deleted columns blank. Rows that are present in both tables will have values in all cells.

    # Expressing inserted and deleted rows

    An inserted row is expressed simply by placing +++ in the action column, and placing cell values in the appropriate columns. If there are columns in the diff that are in LOCAL but not in REMOTE, these are left blank. Likewise, a deleted row is expressed by placing --- in the action column, and its cell values in the appropriate columns. If there are columns in the diff that are in REMOTE but not in LOCAL, these are left blank. For example, suppose in REMOTE there is a row about a New Bridge that wasn’t in LOCAL, and a row about a bridge called Spamspan has been dropped. Here is what the inserted and deleted rows would look like, lined up with the header row for reference:

    action
    column
    schema row!+++(designer)---
    header row@@bridgeopenedlead designerlength
     
    inserted row+++New Bridge2050Chimp N Zee   
     
    deleted row---SpamspanS. Spamington10000

    If the diff is on a database table where rows have no ordering, then we can just stick these rows together and we have our diff:

    action
    column
    schema row!+++(designer)---
    header row@@bridgeopenedlead designerlength
    inserted row+++New Bridge2050Chimp N Zee   
    deleted row---SpamspanS. Spamington10000

    If the diff is on a spreadsheet table or CSV file, we’d generally want to respect row ordering. In this case, we can add context rows around insertions so we know where to put them. Less importantly, since they are going away anyway, we can do the same for deletions:

    action
    column
    schema row!+++(designer)---
    header row@@bridgeopenedlead designerlength
    omitted rows...............
    context row+Williamsburg1903L. L. Buck1600
    inserted row+++New Bridge2050Chimp N Zee   
    context row+Queensborough1909Palmer & Hornbostel1182
    omitted rows...............
    context row+George Washington1931O. H. Ammann3500
    deleted row---SpamspanS. Spamington10000

    The action column for a context row may contain a blank, or :, or +. The : tag signifies the context row was moved (and its location is now as in the REMOTE table). The + signifies that there are cells added on that row.

    # Expressing a modified cell value

    If a row contains a cell whose value is different in the compared tables, then that row should be shown in the diff, with a tag in the action column that ends in ->. Then, the modified cell will be represented by converting the LOCAL and REMOTE values to text (we have yet to say how) and using the action tag as a separator. So for example here we change the last cell in a row from “Green” to “Blue”:

    ->GnomeHome and GardenGreen->Blue

    The tag must be preceded with as many extra - characters as are needed to avoid collision with any character sequence on that row. So here is another row with exactly one cell changed:

    -->ConsoleToddlers -> TeenagersWhite-->Pale

    When encoding a cell change as a string, we lose information about the type of the cell value. One distinction that may be important to retain is the difference between a NULL or empty cell, and the empty string. The tabular diff uses the following encoding:

    • A NULL value, if available, represents itself.
    • The encoded string NULL represents a NULL value.
    • The encoded string _NULL represents the string “NULL”.
    • The encoded string __NULL represents the string “_NULL”.

    The goal is that the diff can be safely converted to and from CSV by existing tools without changing its meaning. To that end:

    • For matching (e.g. on context lines) blank cells in the diff (either the NULL value or an empty string) should be treated as ambiguous, and match either of NULL or an empty string if an exact match is not available.
    • When using a diff as a patch, and inserting new cells, a blank cell in the diff (either the NULL value or an empty string) should be treated as ambiguous, and the “right” thing done given the column type. If either value could be inserted, then the blank string should be inserted (since the encoded string NULL is available to specifically identify the NULL value).

    Note that if the diff is being expressed in a table that allows nested structure (e.g. a JSON representation), a list representation for modified cells might be used to avoid this issue. There is no specification for that at this time.

    # Expressing a moved row

    TIP

    This can be ignored for tables for which row order is meaningless, e.g. in typical relational databases.

    A row that have been moved in a table for which row order is meaningful is marked with a : tag in the action column and placed in the order it appears in the REMOTE table.

    To avoid burdening human readers with too much arcana, tags are not combined when multiple kinds of actions apply to a row or column. So for example, a context row that was moved and had a cell added will not be tagged as :+ or +: or such-like, but rather by :. Cell addition can be determined from the schema row. These weak tags are included as aids for highlighting to express the most significant thing to know about a row.

    # Expressing a moved column

    TIP

    This can be ignored for tables for which column order is meaningless.

    A column that have been moved in a table for which column order is meaningful is marked with a : tag in the schema row and placed in the order it appears in the REMOTE table.

    If a diff that contains a : tag is used to patch a table for which column order is not meaningful, that tag should simply be ignored.

    # Reference: action column tags

    Symbol Meaning
    @@ The header row, giving column names.
    ! The schema row, given column differences.
    +++ An inserted row (present in REMOTE, not present in LOCAL).
    --- A deleted row (present in LOCAL, not present in REMOTE).
    -> A row with at least one cell modified cell. -->, --->, ----> etc. have the same meaning.
    Blank A blank string or NULL marks a row common to LOCAL and REMOTE, given for context.
    ... Declares that rows common to LOCAL and REMOTE are being skipped.
    + A row with at least one added cell.
    : A reordered row.

    # Reference: schema row tags

    Symbol Meaning
    +++ An inserted column (present in REMOTE, not present in LOCAL).
    --- A deleted column (present in LOCAL, not present in REMOTE).
    (<NAME>) A renamed column (the name in LOCAL is given in parenthesis, and the name in REMOTE will be in the header row).
    Blank A blank string or NULL marks a column common to LOCAL and REMOTE, given for context.
    ... Declares that columns common to LOCAL and REMOTE are being skipped.
    : A reordered column.
    - + diff --git a/views/index.html b/views/index.html index e7fd4520..808cd2a5 100644 --- a/views/index.html +++ b/views/index.html @@ -8,7 +8,7 @@ - + @@ -255,6 +255,6 @@ "specType": "table" }

    # Data Transforms

    In progress.

    - +