Skip to content

Storing Package schema / metadata and using it to validate new datasets in json #675

Answered by roll
pchtsp asked this question in Q&A
Discussion options

You must be logged in to vote

@pchtsp
Hi, if I got you right, the migration from your JSONSchema approach to a Frictionless approach would be in creating a list of individual Table Schemas (not resources).

An excerpt from https://framework.frictionlessdata.io/docs/guides/describing-data/#describing-a-resource

Using programming terminology we could say that:

  • Table Schema descriptor is abstract (for a class of files)
  • Data Resource descriptor is concrete (for an individual file)

So consider you store somewhere:

  • durations.schema.json
  • jobs.schema.json
  • etc

You can then use them like this:

from frictionless import validate

report = validate(input['durations'], schema='durations.schema.json')

Another approach, would be…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@rufuspollock
Comment options

Comment options

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

@roll
Comment options

roll May 4, 2021
Maintainer

Answer selected by pchtsp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants