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

Type constraints #5

Open
1 of 2 tasks
timothee-haudebourg opened this issue Mar 18, 2022 · 1 comment
Open
1 of 2 tasks

Type constraints #5

timothee-haudebourg opened this issue Mar 18, 2022 · 1 comment

Comments

@timothee-haudebourg
Copy link
Collaborator

timothee-haudebourg commented Mar 18, 2022

Some schema definitions imposes constraints on the value of some properties. Such constraints can vary from pattern matching to numeric bounds, inequalities, etc. Type constraints are not just a matter of well-formedness: From a (de)serialization point of view, constraints are sometime used to distinguish between different data types (layouts).

For instance the type attribute in Verite's KYC/AML Attestation schema is required to have the value "KYCAMLAttestation". Since JSON is the medium used by Vertie to represent schema instances, this constraint is vital for the processor to disambiguate KYC/AML Attestations from other schemas when processing an arbitrary JSON document.

The implementation of type constraints is two fold:

  • Syntax. How to express type constraints (equality constraints for now, since it is required by Verite).
  • Disambiguation. Provide an API for code generators that provides a disambiguation method between a set of types/layouts, using those constraints.
@timothee-haudebourg
Copy link
Collaborator Author

Well in fact, if we specify that the type field corresponds to the http://www.w3.org/1999/02/22-rdf-syntax-ns#type property, then we don't need a syntax construct to explicitly define type constraints for Verite, since the value of the type property is always implicitly constrained by the schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant