Skip to content

Can I use one schema to validate multiple csv files? #637

Answered by augusto-herrmann
lwinfree asked this question in Q&A
Discussion options

You must be logged in to vote

You can also reference the same schema in several resources of a data package,

For a working example, see okfn/publicbodies.

In datapackage.json, we reference the schema file several times:

    {
      "path": "data/br.csv",
      "profile": "tabular-data-resource",
      "name": "br",
      "format": "csv",
      "mediatype": "text/csv",
      "schema": "public-body-schema.json"
    },
    {
      "path": "data/ch.csv",
      "profile": "tabular-data-resource",
      "name": "ch",
      "format": "csv",
      "mediatype": "text/csv",
      "schema": "public-body-schema.json"
    },

and the actual schema is on public-body-schema.json.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@jm-moreau
Comment options

Comment options

You must be logged in to vote
2 replies
@mingfang
Comment options

@roll
Comment options

roll Aug 15, 2021
Maintainer

Comment options

You must be logged in to vote
0 replies
Answer selected by roll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants