Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Articulating cross-references in the schema #414

Closed
timgdavies opened this issue Jan 19, 2017 · 1 comment
Closed

Articulating cross-references in the schema #414

timgdavies opened this issue Jan 19, 2017 · 1 comment
Labels
Schema: Validation Relating to constraints in the JSON Schema Schema Relating to other changes in the JSON Schema (renamed fields, schema properties, etc.)

Comments

@timgdavies
Copy link
Contributor

We have a number of points now where our schema requires cross-references.

E.g.

  • contract.awardID should point to a valid award.id
  • award.suppliers[].id should point to an entries in parties[].id

Looking at the discussions around JSON Schema v0.5 there are proposals for a $data validation keyword at json-schema-org/json-schema-spec#51

We should check on the status of this issue, and whether there is emerging consensus that it might be supported in JSON Schema in future before looking at whether we should include our own keywords for articulating cross-references in the schema.

(Note: we might only ever be able to warn on some references when validating releases, such as contract.awardID -> award.id - as I think it is valid for a release to just include the contract without the award, whilst the record would include both together)

@jpmckinney jpmckinney added the Schema Relating to other changes in the JSON Schema (renamed fields, schema properties, etc.) label Aug 7, 2017
@jpmckinney jpmckinney added Schema: Validation Relating to constraints in the JSON Schema Schema Relating to other changes in the JSON Schema (renamed fields, schema properties, etc.) and removed Schema Relating to other changes in the JSON Schema (renamed fields, schema properties, etc.) labels Aug 26, 2017
@jpmckinney
Copy link
Member

I don't believe it is yet possible in JSON Schema to express such relationships. Rather than extend the meta-schema (as done for codelists, which was justified as they are a central concept), I figure it best to perform these sorts of 'coherence' checks through a data quality tool. Closing as that wouldn't be a standardization issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Schema: Validation Relating to constraints in the JSON Schema Schema Relating to other changes in the JSON Schema (renamed fields, schema properties, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants