Starting in ThingIn 3.0.0, the validation API enables schema/constraint-based validation of your avatars using 3 different standard languages:
The Json schema implementation is based on Vertx Json Schema while SHACL and ShEx are based on Jena's implementation
The first step to use the validation API is to create a validation resource using the validation API. The API includes these CRUD functionnalities :
To create a validation resource, only two parameters are required:
Schemas or validation schemas, are attached to a domain, and don't work outside of this domain. One schema can hoewever be attached to multiple domains if required, i.e. they can be reused easily.
Schema validation happens at avatar/data creation, through any of the avatar creation APIs (single, batch, asynchronous, injector-based...), as long as a validation schema is attached to the same domain as the avatar. This also means they should be declared up-front (before injecting data), and are not retroactive.
As of ThingIn 3.0.0, the validation API functions only at avatar creation meaning avatar updates after creation don't ensure the schemas/constraints are effective.
The base pipeline for using the validation API is thus like :
Before applying a schema to a domain and start validating new data, the validation API offers a convenient way to test a schema against data without affecting a domain.
The /validation/run API verb is a simple way to ensure the schema works properly in one API call).
When deleting a schema, any domain attached to it will remain intact.
The same is true for the opposite operation : deleting a domain will preserve attached schemas so that its owner can still apply it to other domains.