Help:Constraint schema

From Linux Web Expert

Revision as of 16:57, 25 March 2021 by >Kghbln (→‎Constraint schema: add)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

File:constraint-schema.png
Constraint schema
File:constraint-violation-indicator.png
Shows constraint violation using the page indicator

A constraint defines a limitation or restriction of a value that can be assigned to a property or class hereby making it possible to shape1 its characteristics and the nature of the "fact" or claim.

The very first value restriction a user comes in contact is the definition of a datatype for a property to describe what a value literal is expected to represent such as a number, a date, a boolean, a page or a simple text.

Additional declarative properties are available to further restrict and describe characteristics of values including:

Yet, adding more of these properties would make maintenance (technical as well as organizational) difficult therefore a different approach has been introduced with Semantic MediaWiki 3.1.0Released on an unknown date unknown versions of MediaWiki.

Constraint schema

Semantic MediaWiki 3.1.0Released on an unknown date unknown versions of MediaWiki introduced the "Constraint" class2 together with some schema types (PROPERTY_CONSTRAINT_SCHEMA schema3 and CLASS_CONSTRAINT_SCHEMA schema4) to codify and describe constraints using a more formalized and structured approach. Each of the mentioned type supports different properties that can be used to devise an individual schema that can shape a property or members of a class.

The more formalized approach is relying on a structured JSON format to define specific constraint characteristics and include things like:

  • allowed_namespaces3 specifies that values need to be a page in one of the allowed namespaces, i.e. values of datatype "Page"Holds names of wiki pages, and displays them as a link only.
  • must_exists5 specifies that values need to exist before it can be used as annotation element for a property, i.e. values of datatype "Page"Holds names of wiki pages, and displays them as a link only.
  • non_negative_integer6 specifies that values need to be positive (including 0)
  • shape_constraint7 specifies that a property is expected to have a certain "shape" such as: max_cardinality, property, property_type or min_textlength
  • single_value_constraint8 specifies that a property expects only a single value per entity
  • unique_value_constraint9 specifies that values should be unique across the wiki, that the value is likely to be different (distinct) from all other items
  • custom_constraint10 to be used to specify and implement custom constraints

The declarative special property "Constraint schema"Holds the name of a constraint schema which is not restricted to single constraint types11 was introduced to declare and assign one or more schemata to an instance of a property or category to describe constraint requirements of values for a specific instance.

To help users effectively identify and eliminate constraint violations, an indicator12 is placed on top of an article that lists violations for those errors that were classified as constraint errors132.

See also

For users and admins
For developers

#scite could not render a citation text for reference "gh:smw:3830" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3746" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3968" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3792" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3966" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3970" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3908" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3829" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3981" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:4010" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:4069" because type "pullrequest" was not assigned to a template.

References

  1. ^  https://www.w3.org/TR/shacl/
  2. a b gh:smw:3830 
  3. a b gh:smw:3746 
  4. ^ gh:smw:4033 
  5. ^ gh:smw:3981 
  6. ^ gh:smw:3970 
  7. ^ gh:smw:4069 
  8. ^ gh:smw:4010 
  9. ^ gh:smw:3908 
  10. ^ gh:smw:3966 
  11. ^ gh:smw:3829 
  12. ^ gh:smw:3968 
  13. ^ gh:smw:3792