status
, a list of checks
and an optional metadata type, and will be structured like this:- status: [required, either "any" or a valid status name, eg. Status]
object: [optional, either "any", or the name of a metadata type. eg. DataElement]
checks: [required, a list of Checks (or tests) to run as part of this rule, see below]
- status: Standard
object: DataElement
checks: [covered below]
- status: any
object: Indicator
checks: [covered below]
- status: Candidate
object: any
checks: [covered below]
- status: Standard
object: DataElement
checks:
- validator: RegexValidator
name: "Starts with a capital letter"
severity: warning
field: name
regex: [A-Z].+
- validator: [required, see below]
name: [optional, string, use quotes if there are special characters]
severity: [required, either warning or error]
# extra fields here
severity
to provide information about errors- status: any
object: any
checks:
- validator: RegexValidator
name: "Starts with a capital letter"
severity: error
field: name
regex: "^[A-Z].+"
- validator: RegexValidator
name: "Definition is at least than 100 characters"
severity: warning
field: definition
regex: ".{100,}"
RegexValidator
: checking the formatting of text fieldsRegexValidator
takes two extra fields:field
- the name of the field to check. This is the field name from the API or GraphQL.regex
- the regular expression to use to check the field against. Because a regex can include special characters, its recommended to enclose a regex in quotes. Note: Aristotle doesn’t current verify that this is a ‘valid’ regex.:
) between the Object Class and Property in its name.- status: Standard
object: DataElement
checks:
- validator: RegexValidator
name: Name pattern must include a colon separator
severity: warning
field: name
regex: "[A-Z].+: .+"
Note: The regex “.+
” specifies any character (.
), repeated any number of times (+
).
:
) between the Object Class and Property in its name.- status: Standard
object: DataElement
checks:
- validator: RegexValidator
name: Definition must be longer than 100 characters
severity: warning
field: name
regex: ".{100,}"
.
- Any single character[A-Z]
- Any single upper case letter[a-z]
- Any single lowercase letter[A-Za-z]
- Any upper or lower case letter[0-9]
- Any single digit[0-9A-Za-z]
- Any number, upper or lower case letter?
- match 0 or 1 of the previous token (eg. [A-Z]?
will match “” (any empty string) or any single upper case character)*
- match 0 or more of the previous token (eg. [A-Z]*
will match any number of upper case characters+
- match 1 or more of the previous token (eg. [A-Z]+
will match a string with at least one upper case characters^
- Match at the start of the line (eg. ^A
will only match if a string starts with a capital A)$
- Match at the end of the line (eg. Z$
will only match if a string ends with a capital Z)RelationValidator
: checking that metadata links existRelationValidators
can be used to check that certain related metadata is attached to an item. For example, RelationValidators can be used to check if a Data Element has an associated Value Domain:- status: Recorded
object: DataElement
checks:
- validator: RelationValidator
severity: error
field: valueDomain
name: Value Domain should be linked to Data Element
A RelationValidator
takes one extra fields:
field
- the name of the field to check. This is the field name from the API or GraphQL. It must be a field that is a relation to another metadata item.UniqueValuesValidator
: checking that Value Domains have unique valuesUniqueValuesValidator
can be used to check that Value Domains have codes that are all unique. This tests all Permissible and Supplementary Values.- status: Recorded
object: ValueDomain
checks:
- validator: UniqueValuesValidator
severity: error
field: valueDomain
name: Value Domain must have unique values
UniqueValuesValidator
takes no extra fields.StatusValidator
: checking that metadata has followed a status lifecycleStatusValidator
can be used to caputre these business rules.StatusValidator
takes one extra fields:status
- a list of statuses that an item must been at prior to being registered at the stated level. The metadata item must have been register in one of these states immediately prior to the requested status level.- status: Standard
checks:
- validator: StatusValidator
name: Candidate or Recorded -> Standard
description: Metadata should progress along the lifecycle correctly
severity: warning
status:
- Candidate
- Recorded
#
) and can either be for a whole line, or just at the end of a line:# This comment will be ignored
- status: Standard
object: DataElement # This comment is also ignored
checks: [covered below]