{"openapi":"3.0.2","info":{"title":"API Documentation","version":"v1"},"components":{"responses":{"400BadJson":{"description":"Bad request, usually JSON schema validation failure.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/errorResponse"},"example":{"message":"JSON Schema validation failed.","status":400,"timestamp":"2021-06-14T13:46:06+00:00","data":{"keyword":"type","pointer":"path\/to\/invalid\/json\/property","message":"The attribute expected to be of type \u0027\u0027object\u0027\u0027 but \u0027array\u0027 given."}}}}},"404IdNotFound":{"description":"Not found, usually due to incorrect identifier.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/errorResponse"},"example":{"message":"Error retrieving metadata: 00000000-0000-0000-0000-000000000000 not found.","status":404,"timestamp":"2021-06-14T13:46:06+00:00"}}}},"200DatastoreCsvOk":{"description":"Ok, CSV successfully generated.","content":{"text\/csv":{"schema":{"type":"string"}}}},"200JsonOrCsvQueryOk":{"description":"Ok. JSON or CSV datastore response, depending on query.","content":{"application\/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object"}},"count":{"type":"integer"},"schema":{"type":"object","description":"Schema of all resources queries, keyed by ID."},"query":{"type":"object"}}}},"text\/csv":{"schema":{"type":"string"}}}},"200MetadataUpdated":{"description":"Metadata update successful.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/metastoreWriteResponse"}}}},"201MetadataCreated":{"description":"Metadata creation successful.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/metastoreWriteResponse"}}}},"409MetadataAlreadyExists":{"description":"Conflict; tried to create a record using an existing ID, or metadata contains identifier that doesn\u0027t match the request path.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/errorResponse"},"example":{"message":"dataset\/00000000-0000-0000-0000-000000000000 already exists.","status":409,"timestamp":"2021-06-14T13:46:06+00:00"}}}},"404MetadataObjectNotFound":{"description":"Missing object, usually due to incorrect identifier.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/errorResponse"},"example":{"message":"No data with the identifier 00000000-0000-0000-0000-000000000000 was found.","status":404,"timestamp":"2021-06-14T13:46:06+00:00"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"message":{"type":"string","description":"Error message."},"status":{"type":"integer"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","description":"Arbitrary object storing more detailed data on the error message."}}},"datastoreQuery":{"title":"Datastore Query","description":"Schema for DKAN datastore queries","type":"object","properties":{"resources":{"type":"array","title":"Resources","description":"Resources to query against and aliases. Usually you will add only one resource to this array, but if performing a join, list the primary resource first and then add resources to be used in the joins array.","items":{"type":"object","properties":{"alias":{"type":"string","description":"Alias to use to refer to this resource elsewhere in the query."}}}},"properties":{"type":"array","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryResource"},{"type":"object","title":"Aliased property from specific resource","properties":{"resource":{"$ref":"#\/components\/schemas\/datastoreQueryResource"},"property":{"$ref":"#\/components\/schemas\/datastoreQueryProperty"},"alias":{"type":"string"}},"required":["resource","property"]},{"type":"object","title":"Aliased expression","properties":{"expression":{"$ref":"#\/components\/schemas\/datastoreQueryExpression"},"alias":{"type":"string"}},"required":["expression","alias"]}]}},"conditions":{"type":"array","description":"Conditions or groups of conditions for the query, bound by \u0027and\u0027 operator.","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryCondition"},{"$ref":"#\/components\/schemas\/datastoreQueryConditionGroup"}]}},"joins":{"type":"array","description":"Joins","items":{"type":"object","properties":{"resource":{"$ref":"#\/components\/schemas\/datastoreQueryResource"},"condition":{"$ref":"#\/components\/schemas\/datastoreQueryCondition"}},"required":["resource","condition"]}},"groupings":{"type":"array","description":"Properties or aliases to group results by.","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryResource"},{"$ref":"#\/components\/schemas\/datastoreQueryResourceProperty"}]}},"limit":{"type":"integer","description":"Limit for maximum number of records returned. Must be a minumum of 1.","minimum":1},"offset":{"type":"integer","description":"Number of records to offset by or skip before returning first record.","default":0},"sorts":{"type":"array","description":"Result sorting directives.","items":{"$ref":"#\/components\/schemas\/datastoreQuerySort"}},"count":{"description":"Return a count of the total rows returned by the query, ignoring the limit\/offset.","type":"boolean","default":true},"results":{"description":"Return the result set. Set to false and set count to true to receive only a count of matches.","type":"boolean","default":true},"schema":{"description":"Return the schema for the datastore collection.","type":"boolean","default":true},"keys":{"description":"Return results as an array of keyed objects, with the column machine names as keys. If false, results will be an array of simple arrays of values.","type":"boolean","default":true},"format":{"type":"string","description":"Format to return data in. Default is JSON, can be set to CSV.","enum":["csv","json"],"default":"json"},"rowIds":{"description":"Flag to include the result_number column in output. Default is FALSE","type":"boolean","default":false}}},"datastoreResourceQuery":{"title":"Datastore Resource Query","description":"Schema for DKAN datastore queries. When querying against a specific resource, the \u0022resource\u0022 property is always optional. If you want to set it explicitly, note that it will be aliased to simply \u0022t\u0022.","type":"object","properties":{"properties":{"type":"array","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryResource"},{"type":"object","title":"Aliased property from specific resource","properties":{"resource":{"$ref":"#\/components\/schemas\/datastoreQueryResource"},"property":{"$ref":"#\/components\/schemas\/datastoreQueryProperty"},"alias":{"type":"string"}},"required":["resource","property"]},{"type":"object","title":"Aliased expression","properties":{"expression":{"$ref":"#\/components\/schemas\/datastoreQueryExpression"},"alias":{"type":"string"}},"required":["expression","alias"]}]}},"conditions":{"type":"array","description":"Conditions or groups of conditions for the query, bound by \u0027and\u0027 operator.","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryCondition"},{"$ref":"#\/components\/schemas\/datastoreQueryConditionGroup"}]}},"groupings":{"type":"array","description":"Properties or aliases to group results by.","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryResource"},{"$ref":"#\/components\/schemas\/datastoreQueryResourceProperty"}]}},"limit":{"type":"integer","description":"Limit for maximum number of records returned. Must be a minumum of 1.","minimum":1},"offset":{"type":"integer","description":"Number of records to offset by or skip before returning first record.","default":0},"sorts":{"type":"array","description":"Result sorting directives.","items":{"$ref":"#\/components\/schemas\/datastoreQuerySort"}},"count":{"description":"Return a count of the total rows returned by the query, ignoring the limit\/offset.","type":"boolean","default":true},"results":{"description":"Return the result set. Set to false and set count to true to receive only a count of matches.","type":"boolean","default":true},"schema":{"description":"Return the schema for the datastore collection.","type":"boolean","default":true},"keys":{"description":"Return results as an array of keyed objects, with the column machine names as keys. If false, results will be an array of simple arrays of values.","type":"boolean","default":true},"format":{"type":"string","description":"Format to return data in. Default is JSON, can be set to CSV.","enum":["csv","json"],"default":"json"},"rowIds":{"description":"Flag to include the result_number column in output. Default is FALSE","type":"boolean","default":false}}},"datastoreQueryResource":{"type":"string","description":"Alias to resource set in resources array. Not needed when only querying against one resource.","title":"Datastore Query: resource"},"datastoreQueryProperty":{"type":"string","description":"The property\/column or alias to filter by. Should not include collection\/table alias.","pattern":"^[^.]+$","title":"Datastore Query: property"},"datastoreQueryResourceProperty":{"type":"object","description":"Property name with optional collection\/table alias.","properties":{"resource":{"$ref":"#\/components\/schemas\/datastoreQueryResource"},"property":{"$ref":"#\/components\/schemas\/datastoreQueryProperty"}},"required":["property"],"title":"Datastore Query: resourceProperty"},"datastoreQueryConditionGroup":{"type":"object","title":"Datastore Query: Conditional group","description":"Group of conditions bound by \u0027and\u0027\/\u0027or\u0027 operators.","properties":{"groupOperator":{"type":"string","enum":["and","or"]},"conditions":{"type":"array","items":{"anyOf":[{"$ref":"#\/components\/schemas\/datastoreQueryCondition"},{"$ref":"#\/components\/schemas\/datastoreQueryConditionGroup"}]}}},"required":["conditions"]},"datastoreQueryCondition":{"type":"object","title":"Datastore Query: Condition","description":"Condition object including property, value and operator. If querying only one resource, the \u0022resource\u0022 does not need to be specified.","properties":{"resource":{"$ref":"#\/components\/schemas\/datastoreQueryResource"},"property":{"$ref":"#\/components\/schemas\/datastoreQueryProperty"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},{"$ref":"#\/components\/schemas\/datastoreQueryResourceProperty"}],"description":"The value to filter against."},"operator":{"oneOf":[{"type":"string","description":"Comparison operators","enum":["=","\u003C\u003E","\u003C","\u003C=","\u003E","\u003E="]},{"type":"string","pattern":"^([lL][iI][kK][eE]|[bB][eE][tT][wW][eE][eE][nN]|[iI][nN]|[nN][oO][tT] [iI][nN]|[cC][oO][nN][tT][aA][iI][nN][sS]|[sS][tT][aA][rR][tT][sS] [wW][iI][tT][hH]|[mM][aA][tT][cC][hH])$","description":"Alphanumeric comparison operators, case-insensitive. One of: like, between, in, not in, contains, starts with, match"}],"default":"="}},"required":["property","value"]},"datastoreQueryExpression":{"type":"object","title":"Datastore Query: Expression","description":"Arithmetic or aggregate expression performed on one or more properties. Note that performing expressions on text or other non-numeric data types my yield unexpected results.","properties":{"operator":{"oneOf":[{"type":"string","pattern":"^([sS][uU][mM]|[cC][oO][uU][nN][tT]|[aA][vV][gG]|[mM][aA][xX]|[mM][iI][nN])$","description":"Aggregate operators, case-insensitive. One of: sum, count, avg, max, min"},{"type":"string","enum":["+","-","*","\/","%"],"description":"Arithmetic operators"}]},"operands":{"type":"array","description":"Arithmetic operators will require two operands, aggregate operators should take only one. Do not combine arithmetic and aggregate operators in a single query.","items":{"anyOf":[{"type":"number","title":"Number"},{"$ref":"#\/components\/schemas\/datastoreQueryProperty"},{"$ref":"#\/components\/schemas\/datastoreQueryResourceProperty"},{"type":"object","title":"Expression","properties":{"expression":{"$ref":"#\/components\/schemas\/datastoreQueryExpression"}}}]}}}},"datastoreQuerySort":{"type":"object","description":"Properties to sort by in a particular order.","properties":{"resource":{"$ref":"#\/components\/schemas\/datastoreQueryResource"},"property":{"$ref":"#\/components\/schemas\/datastoreQueryProperty"},"order":{"type":"string","description":"Order to sort in, lowercase.","enum":["asc","desc"]}},"title":"Datastore Query: sort"},"metastoreWriteResponse":{"type":"object","properties":{"endpoint":{"type":"string","description":"Path to the metadata from the API."},"identifier":{"type":"string","description":"Identifier for metadata just created or modified."}},"additionalProperties":false},"dataset":{"title":"Project Open Data Dataset","description":"The metadata format for all federal open data. Validates a single JSON object entry (as opposed to entire Data.json catalog).","type":"object","required":["title","description","identifier","accessLevel","modified","keyword"],"properties":{"@type":{"title":"Metadata Context","type":"string","description":"IRI for the JSON-LD data type. This should be dcat:Dataset for each Dataset.","default":"dcat:Dataset"},"title":{"title":"Title","description":"Human-readable name of the asset. Should be in plain English and include sufficient detail to facilitate search and discovery.","type":"string","minLength":1},"identifier":{"title":"Unique Identifier","description":"A unique identifier for the dataset or API as maintained within an Agency catalog or database.","type":"string","minLength":1},"description":{"title":"Description","description":"Human-readable description (e.g., an abstract) with sufficient detail to enable a user to quickly understand whether the asset is of interest.","type":"string","minLength":1},"accessLevel":{"description":"The degree to which this dataset could be made publicly-available, regardless of whether it has been made available. Choices: public (Data asset is or could be made publicly available to all without restrictions), restricted public (Data asset is available under certain use restrictions), or non-public (Data asset is not available to members of the public).","title":"Public Access Level","type":"string","enum":["public","restricted public","non-public"],"default":"public"},"accrualPeriodicity":{"title":"Frequency","description":"Frequency with which dataset is published.","type":"string","enum":["R\/P10Y","R\/P4Y","R\/P1Y","R\/P2M","R\/P3.5D","R\/P1D","R\/P2W","R\/P6M","R\/P2Y","R\/P3Y","R\/P0.33W","R\/P0.33M","R\/PT1S","R\/P1M","R\/P3M","R\/P0.5M","R\/P4M","R\/P1W","R\/PT1H","irregular"]},"describedBy":{"title":"Data Dictionary","description":"URL to the data dictionary for the dataset or API. Note that documentation other than a data dictionary can be referenced using Related Documents as shown in the expanded fields.","type":"string","format":"uri"},"describedByType":{"title":"Data Dictionary Type","description":"The machine-readable file format (IANA Media Type or MIME Type) of the distribution\u2019s describedBy URL.","type":"string"},"issued":{"title":"Release Date","description":"Date of formal issuance.","type":"string"},"modified":{"title":"Last Update","description":"Most recent date on which the dataset was changed, updated or modified.","type":"string"},"license":{"title":"License","description":"The license dataset or API is published with. See \u003Ca href=\u0022https:\/\/resources.data.gov\/open-licenses\/\u0022\u003EOpen Licenses\u003C\/a\u003E for more information.","type":"string","format":"uri","default":"https:\/\/www.usa.gov\/publicdomain\/label\/1.0\/"},"spatial":{"title":"Spatial","description":"The \u003Ca href=\u0022https:\/\/project-open-data.cio.gov\/v1.1\/schema\/#spatial\u0022\u003Espatial coverage\u003C\/a\u003E of the dataset. Could include a spatial region like a bounding box or a named place.","type":"string","minLength":1},"temporal":{"title":"Temporal","description":"The \u003Ca href=\u0022https:\/\/project-open-data.cio.gov\/v1.1\/schema\/#temporal\u0022\u003Estart and end dates\u003C\/a\u003E for which the dataset is applicable, separated by a \u0022\/\u0022 (i.e., 2000-01-15T00:45:00Z\/2010-01-15T00:06:00Z).","type":"string"},"isPartOf":{"title":"Collection","description":"The collection of which the dataset is a subset.","type":"string","minLength":1},"publisher":{"title":"Organization","description":"A Dataset Publisher Organization.","type":"object","required":["name"],"properties":{"@type":{"title":"Metadata Context","description":"IRI for the JSON-LD data type. This should be org:Organization for each publisher","type":"string","default":"org:Organization"},"name":{"title":"Publisher Name","description":"","type":"string","minLength":1},"subOrganizationOf":{"title":"Parent Organization","type":"string"}}},"contactPoint":{"title":"Project Open Data ContactPoint vCard","description":"A Dataset ContactPoint as a vCard object.","type":"object","required":["fn","hasEmail"],"properties":{"@type":{"title":"Metadata Context","description":"IRI for the JSON-LD data type. This should be vcard:Contact for contactPoint.","enum":["vcard:Contact"],"type":"string"},"fn":{"title":"Contact Name","description":"A full formatted name, e.g. Firstname Lastname.","type":"string","minLength":1},"hasEmail":{"title":"Email","description":"Email address for the contact name.","pattern":"^mailto:[\\w\\_\\~\\!\\$\\\u0026\\\u0027\\(\\)\\*\\+\\,\\;\\=\\:.-]+@[\\w.-]+\\.[\\w.-]+?$|[\\w\\_\\~\\!\\$\\\u0026\\\u0027\\(\\)\\*\\+\\,\\;\\=\\:.-]+@[\\w.-]+\\.[\\w.-]+?$","type":"string"}}},"theme":{"title":"Category","description":"Main thematic category of the dataset.","type":"array","items":{"type":"string","title":"Category","minLength":1},"uniqueItems":true},"keyword":{"title":"Tags","description":"Tags (or keywords) help users discover your dataset; please include terms that would be used by technical and non-technical users.","type":"array","items":{"type":"string","title":"Tag","minLength":1},"minItems":1},"distribution":{"title":"Distribution","description":"A distribution is a container for the metadata specific to the data resource being shared. Each distribution should contain one \u003Cstrong\u003EAccess URL\u003C\/strong\u003E or \u003Cstrong\u003EDownload URL\u003C\/strong\u003E. When providing a Download URL, also include the format of the file. A distribution containing a Download URL to a csv or tsv file will generate queues that will import the data into a database table, this is referred to as a datastore. The datastore provides an API endpoint for users to run queries against the data.","type":"array","items":{"title":"Data File","type":"object","properties":{"@type":{"title":"Metadata Context","description":"IRI for the JSON-LD data type. This should be dcat:Distribution for each Distribution.","default":"dcat:Distribution","type":"string","readOnly":true},"title":{"title":"Title","description":"Human-readable name of the file.","type":"string","minLength":1},"description":{"title":"Description","description":"Human-readable description of the file.","type":"string","minLength":1},"format":{"title":"Format","description":"A human-readable description of the file format of a distribution (i.e. csv, pdf, kml, etc.).","type":"string"},"mediaType":{"title":"Media Type","description":"The machine-readable file format (\u003Ca href=\u0022https:\/\/www.iana.org\/assignments\/media-types\/media-types.xhtml\u0022\u003EIANA Media Type or MIME Type\u003C\/a\u003E) of the distribution\u2019s downloadURL.","type":"string"},"downloadURL":{"title":"Download URL","description":"URL providing direct access to a downloadable file of a dataset.","type":"string","format":"uri"},"accessURL":{"title":"Access URL","description":"URL providing indirect access to a dataset.","type":"string","format":"uri"},"conformsTo":{"title":"Data Standard","description":"URI used to identify a standardized specification the distribution conforms to.","type":"string","format":"uri"},"describedBy":{"title":"Data Dictionary","description":"URL to the data dictionary for the distribution found at the downloadURL.","type":"string"},"describedByType":{"title":"Data Dictionary Type","description":"The machine-readable file format (IANA Media Type or MIME Type) of the distribution\u2019s describedBy URL.","pattern":"^[a-z\\\/\\.\\+]+?$","type":"string"}},"uniqueItems":true},"minItems":1},"references":{"title":"Related Documents","description":"Related documents such as technical information about a dataset, developer documentation, etc.","type":"array","items":{"type":"string","format":"uri"}},"bureauCode":{"title":"Bureau Code","description":"Federal agencies, combined agency and bureau code from \u003Ca href=\u0022https:\/\/resources.data.gov\/schemas\/dcat-us\/v1.1\/omb_bureau_codes.csv\u0022\u003EOMB Circular A-11, Appendix C\u003C\/a\u003E in the format of \u003Ccode\u003E015:010\u003C\/code\u003E.","type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"programCode":{"title":"Program Code","description":"Federal agencies, list the primary program related to this data asset, from the \u003Ca href=\u0022https:\/\/resources.data.gov\/schemas\/dcat-us\/v1.1\/FederalProgramInventory_FY13_MachineReadable_091613.csv\u0022\u003EFederal Program Inventory\u003C\/a\u003E. Use the format of \u003Ccode\u003E015:001\u003C\/code\u003E","type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}}},"facets":{"type":"array","description":"Array of facet values.","items":{"type":"object","properties":{"type":{"type":"string","description":"Machine name for the metastore property to filter on."},"name":{"type":"string","description":"The facet filter value, for instance, the tet of a keyword to filter by"},"total":{"type":"integer","description":"Number of results in the current result set that match this filter."}}}}},"parameters":{"datastoreUuid":{"name":"identifier","in":"path","description":"A datastore id. Note: there is an inconsistency in this API that will be addressed in the future: The expected format is different from the format supplied in \/api\/1\/datastore\/imports.","required":true,"schema":{"type":"string"},"example":"00000000000000000000000000000000__0000000000__source"},"datastoreDistributionUuid":{"name":"distributionId","in":"path","description":"A distribution ID","required":true,"schema":{"type":"string"},"example":"13d1f0b9-d8c1-5a73-92f7-fd249d8e4b2b"},"datastoreDatasetUuid":{"name":"datasetId","in":"path","description":"A dataset ID","required":true,"schema":{"type":"string"},"example":"ae4d5347-5137-5f6c-b66c-3420fa0316d8"},"datastoreDistributionIndex":{"name":"index","in":"path","description":"The index of a distribution in a dataset\u0027s distribution array. For instance, the first distribution in a dataset would have an index of \u00220,\u0022 the second would have \u00221\u0022, etc.","required":true,"schema":{"type":"string"},"example":"0"},"datastoreQueryLimit":{"name":"limit","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/limit"}},"datastoreQueryOffset":{"name":"offset","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/offset"}},"datastoreQueryCount":{"name":"count","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/count"}},"datastoreQueryResults":{"name":"results","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/results"}},"datastoreQuerySchema":{"name":"schema","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/schema"}},"datastoreQueryKeys":{"name":"keys","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/keys"}},"datastoreQueryFormat":{"name":"format","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/format"}},"datastoreQueryRowIds":{"name":"rowIds","in":"query","style":"deepObject","explode":true,"schema":{"$ref":"#\/components\/schemas\/datastoreQuery\/properties\/rowIds"}},"harvestPlanId":{"name":"plan_id","in":"path","description":"A harvest plan identifier","required":true,"schema":{"type":"string"},"example":"data"},"harvestPlanIdQuery":{"name":"plan","in":"query","description":"A harvest plan identifier","required":true,"schema":{"type":"string"},"style":"form","example":"data"},"harvestRunId":{"name":"run_id","in":"path","description":"A harvest run identifier","required":true,"schema":{"type":"string"},"example":"HARVEST-RUN-ID"},"showReferenceIds":{"name":"show-reference-ids","in":"query","description":"Metastore objects often include references to other objects stored in other schemas. These references are usually hidden in responses. Some identifiers are necessary to work with other API endpoints (e.g. datastore endpoints may require the distribution identifier). Add `?show-reference-ids` to show the identifiers generated by DKAN.","schema":{"type":"boolean","default":false},"style":"form","allowEmptyValue":true},"schemaId":{"name":"schema_id","in":"path","description":"The name a of a specific schema. For instance, \u0022dataset.\u0022","schema":{"type":"string"},"required":true,"allowEmptyValue":false,"examples":{"dataset":{"value":"dataset"},"publisher":{"value":"publisher"},"distribution":{"value":"distribution"},"theme":{"value":"theme"},"keyword":{"value":"keyword"},"data-dictionary":{"value":"data-dictionary"}}},"datasetUuid":{"name":"identifier","in":"path","description":"A dataset identifier","required":true,"schema":{"type":"string"},"example":"ae4d5347-5137-5f6c-b66c-3420fa0316d8"},"exampleUuid":{"name":"identifier","in":"path","description":"A dataset identifier","required":true,"schema":{"type":"string"},"example":"ae4d5347-5137-5f6c-b66c-3420fa0316d8"}}},"paths":{"\/api\/1\/datastore\/imports\/{identifier}":{"get":{"operationId":"datastore-get","summary":"Datastore statistics","description":"Returns the numbers of rows and columns, and a list of columns headers from the datastore.\n","tags":["Datastore: import"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreUuid"}],"responses":{"200":{"description":"Ok","content":{"application\/json":{"schema":{"type":"object","required":["numOfRows","numOfColumns","columns"],"properties":{"numOfRows":{"type":"integer"},"numOfColumns":{"type":"integer"},"columns":{"type":"object"}}}}}}}}},"\/api\/1\/datastore\/query":{"post":{"operationId":"datastore-query-post","summary":"Query one or more datastore resources","tags":["Datastore: query"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/datastoreQuery"},"example":{"conditions":[{"resource":"t","property":"record_number","value":1,"operator":"\u003E"}],"limit":3,"resources":[{"id":"13d1f0b9-d8c1-5a73-92f7-fd249d8e4b2b","alias":"t"}]}}}},"responses":{"200":{"$ref":"#\/components\/responses\/200JsonOrCsvQueryOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"}}},"get":{"operationId":"datastore-query-get","summary":"Query one or more datastore resources","description":"Simple GET equivalent of a POST query. Note that parameters containing arrays or objects are not yet supported by SwaggerUI. For conditions, sorts, and other complex parameters, write your query in JSON and then convert to a nested query string. See [this web tool](https:\/\/www.convertonline.io\/convert\/json-to-query-string) for an example.","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreQueryLimit"},{"$ref":"#\/components\/parameters\/datastoreQueryOffset"},{"$ref":"#\/components\/parameters\/datastoreQueryCount"},{"$ref":"#\/components\/parameters\/datastoreQueryResults"},{"$ref":"#\/components\/parameters\/datastoreQuerySchema"},{"$ref":"#\/components\/parameters\/datastoreQueryKeys"},{"$ref":"#\/components\/parameters\/datastoreQueryFormat"},{"$ref":"#\/components\/parameters\/datastoreQueryRowIds"}],"responses":{"200":{"$ref":"#\/components\/responses\/200JsonOrCsvQueryOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"}}}},"\/api\/1\/datastore\/query\/download":{"post":{"operationId":"datastore-query-download-post","summary":"Query one or more datastore resources for file download","tags":["Datastore: query"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/datastoreQuery"},"example":{"conditions":[{"resource":"t","property":"record_number","value":1,"operator":"\u003E"}],"limit":3,"resources":[{"id":"13d1f0b9-d8c1-5a73-92f7-fd249d8e4b2b","alias":"t"}],"format":"csv"}}}},"responses":{"200":{"$ref":"#\/components\/responses\/200DatastoreCsvOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}},"get":{"operationId":"datastore-query-download-get","summary":"Query one or more datastore resources for file download with get","description":"Simple GET equivalent of a POST query. Note that parameters containing arrays or objects are not yet supported by SwaggerUI. For conditions, sorts, and other complex parameters, write your query in JSON and then convert to a nested query string. See [this web tool](https:\/\/www.convertonline.io\/convert\/json-to-query-string) for an example.","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreQueryLimit"},{"$ref":"#\/components\/parameters\/datastoreQueryOffset"},{"$ref":"#\/components\/parameters\/datastoreQueryCount"},{"$ref":"#\/components\/parameters\/datastoreQueryResults"},{"$ref":"#\/components\/parameters\/datastoreQuerySchema"},{"$ref":"#\/components\/parameters\/datastoreQueryKeys"},{"$ref":"#\/components\/parameters\/datastoreQueryFormat"},{"$ref":"#\/components\/parameters\/datastoreQueryRowIds"}],"responses":{"200":{"$ref":"#\/components\/responses\/200DatastoreCsvOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}}},"\/api\/1\/datastore\/query\/{distributionId}":{"post":{"operationId":"datastore-resource-query-post","summary":"Query a single datastore resource","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreDistributionUuid"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/datastoreResourceQuery"},"example":{"conditions":[{"resource":"t","property":"record_number","value":1,"operator":"\u003E"}],"limit":3}}}},"responses":{"200":{"$ref":"#\/components\/responses\/200JsonOrCsvQueryOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}},"get":{"operationId":"datastore-resource-query-get","summary":"Query a single datastore resource with get","description":"Simple GET equivalent of a POST query. Note that parameters containing arrays or objects are not yet supported by SwaggerUI. For conditions, sorts, and other complex parameters, write your query in JSON and then convert to a nested query string. See [this web tool](https:\/\/www.convertonline.io\/convert\/json-to-query-string) for an example.","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreDistributionUuid"},{"$ref":"#\/components\/parameters\/datastoreQueryLimit"},{"$ref":"#\/components\/parameters\/datastoreQueryOffset"},{"$ref":"#\/components\/parameters\/datastoreQueryCount"},{"$ref":"#\/components\/parameters\/datastoreQueryResults"},{"$ref":"#\/components\/parameters\/datastoreQuerySchema"},{"$ref":"#\/components\/parameters\/datastoreQueryKeys"},{"$ref":"#\/components\/parameters\/datastoreQueryFormat"},{"$ref":"#\/components\/parameters\/datastoreQueryRowIds"}],"responses":{"200":{"$ref":"#\/components\/responses\/200JsonOrCsvQueryOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}}},"\/api\/1\/datastore\/query\/{datasetId}\/{index}":{"post":{"operationId":"datastore-datasetindex-query-post","summary":"Query a single datastore resource","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreDatasetUuid"},{"$ref":"#\/components\/parameters\/datastoreDistributionIndex"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/datastoreResourceQuery"},"example":{"conditions":[{"resource":"t","property":"record_number","value":1,"operator":"\u003E"}],"limit":3}}}},"responses":{"200":{"$ref":"#\/components\/responses\/200JsonOrCsvQueryOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}},"get":{"operationId":"datastore-datasetindex-query-get","summary":"Query a single datastore resource with get","description":"Simple GET equivalent of a POST query -- see the POST endpoint documentation for full query schema. A few basic parameters are provided here as examples. For more reliable queries, write your query in JSON and then convert to a query string. See [this web tool](https:\/\/www.convertonline.io\/convert\/json-to-query-string) for an example.","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreDatasetUuid"},{"$ref":"#\/components\/parameters\/datastoreDistributionIndex"},{"$ref":"#\/components\/parameters\/datastoreQueryLimit"},{"$ref":"#\/components\/parameters\/datastoreQueryOffset"},{"$ref":"#\/components\/parameters\/datastoreQueryCount"},{"$ref":"#\/components\/parameters\/datastoreQueryResults"},{"$ref":"#\/components\/parameters\/datastoreQuerySchema"},{"$ref":"#\/components\/parameters\/datastoreQueryKeys"},{"$ref":"#\/components\/parameters\/datastoreQueryFormat"},{"$ref":"#\/components\/parameters\/datastoreQueryRowIds"}],"responses":{"200":{"$ref":"#\/components\/responses\/200JsonOrCsvQueryOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}}},"\/api\/1\/datastore\/query\/{distributionId}\/download":{"get":{"operationId":"datastore-resource-query-download-get","summary":"Query a single datastore resource for file download","description":"Like the other datastore query GET endpoints, additional parameters may be added by serializing a query JSON object (documented in the POST endpoints) into a query string.","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreDistributionUuid"},{"in":"query","name":"format","required":false,"schema":{"type":"string"},"example":"csv","description":"Response format. Either csv or json.","style":"deepObject"}],"responses":{"200":{"$ref":"#\/components\/responses\/200DatastoreCsvOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}}},"\/api\/1\/datastore\/query\/{datasetId}\/{index}\/download":{"get":{"operationId":"datastore-datasetindex-query-download-get","summary":"Query a single datastore resource for file download","description":"Like the other datastore query GET endpoints, additional parameters may be added by serializing a query JSON object (documented in the POST endpoints) into a query string.","tags":["Datastore: query"],"parameters":[{"$ref":"#\/components\/parameters\/datastoreDatasetUuid"},{"$ref":"#\/components\/parameters\/datastoreDistributionIndex"},{"in":"query","name":"format","required":false,"schema":{"type":"string"},"example":"csv","description":"Response format. Currently, only csv is supported.","style":"deepObject"}],"responses":{"200":{"$ref":"#\/components\/responses\/200DatastoreCsvOk"},"400":{"$ref":"#\/components\/responses\/400BadJson"},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}}},"\/api\/1\/datastore\/sql":{"get":{"operationId":"datastore-sql","summary":"Query resources in datastore","description":"Interact with resources in the datastore using an SQL-like syntax.\n","tags":["Datastore: SQL Query"],"parameters":[{"name":"query","in":"query","description":"A SQL-like query.\n\nA `SELECT` using the `show_db_columns` parameter will make it easier to build queries against the data as\nit returns columns without spaces and in some cases, truncated names where the human readable column header\nis very long.\n\n`\/api\/1\/datastore\/sql?query=[SELECT * FROM DATASTORE_UUID][LIMIT 1 OFFSET 0];\u0026show_db_columns`\n\nYou can then build the `SELECT` part of the query. Do not use spaces between its arguments.\n\n`\/api\/1\/datastore\/sql?query=[SELECT a,b,c, FROM DATASTORE_UUID]`\n\n`WHERE` can use any column in the data.\n\n`\/api\/1\/datastore\/sql?query=[SELECT a,b FROM DATASTORE_UUID][WHERE c = \u0022CCC\u0022];\u0026show_db_columns`\n\n`LIMIT` and `OFFSET` allow you to get more than the 500 record limit, by using successive queries:\n\n`\/api\/1\/datastore\/sql?query=[SELECT a,b,c FROM DATASTORE_UUID][WHERE d = \u0022CCC\u0022][LIMIT 500 OFFSET 0];\u0026show_db_columns`\n\n`\/api\/1\/datastore\/sql?query=[SELECT a,b,c FROM DATASTORE_UUID][WHERE d = \u0022DDD\u0022][LIMIT 500 OFFSET 500];\u0026show_db_columns`\n\nNote: `SELECT`, `WHERE` and `LIMIT...OFFSET` clauses must each be included within brackets `[ ]`.\n","required":true,"schema":{"type":"string"},"style":"form","example":"[SELECT * FROM 13d1f0b9-d8c1-5a73-92f7-fd249d8e4b2b][LIMIT 2]"},{"name":"show_db_columns","in":"query","description":"Add `\u0026show_db_columns` to return columns without spaces and in some cases, truncated names where the human\nreadable column header is very long.\n","schema":{"type":"boolean"},"style":"form","allowEmptyValue":true}],"responses":{"200":{"description":"Ok. Query successful.","content":{"application\/json":{"schema":{"type":"array","items":{"type":"object","description":"Simple result row, key\/value pairs."}}}}}}}},"\/api\/1\/metastore\/schemas":{"get":{"operationId":"metastore-get-schemas","summary":"Get list of all schemas","tags":["Metastore"],"responses":{"200":{"description":"List of metastore schemas.","content":{"application\/json":{"schema":{"type":"object","description":"Full collection of available metastore schemas"}}}}}}},"\/api\/1\/metastore\/schemas\/{schema_id}":{"get":{"operationId":"metastore-get-schema","summary":"Get a specific schema","tags":["Metastore"],"parameters":[{"$ref":"#\/components\/parameters\/schemaId"}],"responses":{"200":{"description":"Ok","content":{"application\/json":{"schema":{"description":"A schema definition, see https:\/\/json-schema.org\/","type":"object"}}}},"404":{"description":"Schema not found"}}}},"\/api\/1\/metastore\/schemas\/{schema_id}\/items":{"get":{"operationId":"metastore-get-all","summary":"Get all items for a specific schema (e.g., \u0022dataset\u0022)","tags":["Metastore"],"parameters":[{"$ref":"#\/components\/parameters\/schemaId"},{"$ref":"#\/components\/parameters\/showReferenceIds"}],"responses":{"200":{"description":"Full list of all items for the given schema","content":{"application\/json":{"schema":{"type":"array","description":"Array of metastore items matching the chosen schema.","items":{"type":"object"}}}}}}}},"\/api\/1\/metastore\/schemas\/dataset\/items\/{identifier}":{"get":{"operationId":"dataset-get-item","summary":"Get a single dataset.","tags":["Metastore: dataset"],"parameters":[{"$ref":"#\/components\/parameters\/datasetUuid"},{"$ref":"#\/components\/parameters\/showReferenceIds"}],"responses":{"200":{"description":"Full dataset item.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/dataset"}}}},"404":{"$ref":"#\/components\/responses\/404IdNotFound"}}}},"\/api\/1\/search":{"get":{"operationId":"search","summary":"Search the DKAN catalog","description":"Search description.\n","tags":["Search"],"parameters":[{"name":"fulltext","in":"query","description":"Full-text search to run against any metadata fields indexed for fulltext searches.","schema":{"type":"string","default":""},"allowEmptyValue":true,"style":"form"},{"name":"page","in":"query","description":"The page of the result set.","schema":{"type":"integer","default":1},"example":1,"style":"form"},{"name":"page-size","in":"query","description":"How many results per page.","schema":{"type":"integer","default":10,"minimum":1,"maximum":100},"example":20,"style":"form"},{"name":"sort","in":"query","description":"Which property to sort results on. Available properties: \u003Cem class=\u0022placeholder\u0022\u003Edescription, keyword, modified, publisher__name, theme, title, search_api_relevance\u003C\/em\u003E","schema":{"type":"array","items":{"type":"string","default":"title"}},"style":"form","explode":false},{"name":"sort-order","in":"query","description":"Sort results in ascending or descending order. Allowed values: \u003Cem\u003Easc, desc\u003C\/em\u003E","schema":{"type":"array","items":{"type":"string","default":"asc"}},"style":"form","explode":false},{"name":"facets","in":"query","required":false,"allowEmptyValue":true,"description":"Request information on facets. Pass a comma-separated list to get specific facets. Pass an empty value or \u00220\u0022 for no facet infrmation. Omit this parameter to get all facet information.","schema":{"type":"string"},"style":"form","explode":false},{"name":"publisher__name","in":"query","description":"Filter results using \u003Cem class=\u0022placeholder\u0022\u003Epublisher__name\u003C\/em\u003E facet.","schema":{"type":"string"},"example":"test","style":"form"},{"name":"keyword","in":"query","description":"Filter results using \u003Cem class=\u0022placeholder\u0022\u003Ekeyword\u003C\/em\u003E facet.","schema":{"type":"string"},"example":"urban","style":"form"},{"name":"theme","in":"query","description":"Filter results using \u003Cem class=\u0022placeholder\u0022\u003Etheme\u003C\/em\u003E facet.","schema":{"type":"string"},"example":"Eligibility","style":"form"}],"responses":{"200":{"description":"Ok","content":{"application\/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","description":"Total search results for query."},"results":{"type":"object","description":"An object with keys following the format \u0022dkan_dataset\/[uuid]\u0022, containing full dataset objects from the DKAN metastore."},"facets":{"$ref":"#\/components\/schemas\/facets"}}}}}},"400":{"description":"Bad request","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/errorResponse"}}}}}}},"\/api\/1\/search\/facets":{"get":{"operationId":"search-facets","summary":"Retrieve search facet information","tags":["Search"],"responses":{"200":{"description":"Ok","content":{"application\/json":{"schema":{"type":"object","properties":{"facets":{"$ref":"#\/components\/schemas\/facets"},"time":{"type":"number","description":"Execution time."}}}}}}}}}},"tags":[{"name":"Metastore","description":"Work with metadata items."},{"name":"Metastore: dataset","description":"CRUD operations for dataset metastore items. Substitute any other schema name for \u0022dataset\u0022 to modify other items."}]}