From e1d809a8a46545f5e880c7632bb933aee24145e9 Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu <32753274+anngvu@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:45:37 -0600 Subject: [PATCH] Update README.md (#431) --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index f881fe25..37b89426 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,29 @@ For example, `specimenID` is required, and is included for assay data class defi For that reason, it is not included at all in individual-level assay data (e.g. behavioral/psychological data). Note: In situations where "the data meets the template", issues with a required slot might indicate that the template being used doesn't actually "fit" the type of data/entity, and an additional one needs to be defined. +##### Validation rules + +Validation rules are used with slots/attributes. +We use schematic validation syntax exactly as documented in [this Confluence doc](https://sagebionetworks.jira.com/wiki/spaces/SCHEM/pages/2645262364/Data+Model+Validation+Rules). + +Here is an example of a simple validation rule: + +``` +age: + annotations: + requiresDependency: ageUnit + validationRules: num + description: A numeric value representing age of the individual. Use with `ageUnit`. + required: false +``` + +Here is an example of a more complicated [combination rule](https://sagebionetworks.jira.com/wiki/spaces/SCHEM/pages/2645262364/Data+Model+Validation+Rules#Rule-Combinations): +``` +readPair: + annotations: + validationRules: int::inRange 1 2 +... +``` #### Enum @@ -112,6 +135,7 @@ enums: #...more below ``` + ##### Example: Boolean enumeration (commonly reused) ```