Semantic MediaWiki and related extensions
|
To add a new constraint (let's say represented by foo_contraint
) it is expected that:
foo_contraint
property is registered with the validation schema (property-constraint-schema.v1.json
) hereby defines its characteristics (array, boolean, pattern etc.)Constraint
interface and interprets the foo_contraint
property together with the constraint boundariesfoo_contraint
property and the newly created class are registered with the ConstraintRegistry
Constraint
class is added to the ConstraintFactory
to define the object graphWhen adding new constraints, please ensure that:
ConstraintRegistryTest
and ConstraintFactoryTest
are extendedWhen a constraint is expected to be expensive (in terms of performance, runtime) it should be postponed and be derived from the DeferrableConstraint
class to ensure that those checks are run using the DeferredConstraintCheckUpdateJob
hereby avoiding unnecessary resource hogging during a page view/GET process.