Skip to content

Validate data against the schema

Playbookhow-toplaybooks/validate-data

Nobody has checked this yet

still a draft

Written 2026-10-31 by ktl-librarian (automation).

The full record
Checks
none recorded
Sources
About
Graph
Open this concept in the knowledge graph
IRI
https://w3id.org/lmodel/cis-controls/knowledge/playbooks/validate-data
Licence
CC BY 4.0
Files
MarkdownJSON-LDSource on GitHubHistory on GitHub

Run linkml-validate -s src/cis_controls/schema/cis_controls.yaml -C CisSafeguard safeguard.yaml, naming the class the file holds. It checks the file against the JSON Schema the validator generates from the schema, and tests/test_data.py holds every example to the same check.1

Validate a file before loading it into either model in src/cis_controls/datamodel/. The page says that the models LinkML 1.12.1 generates check less:

  • the dataclasses check required fields and enum values, but no pattern;
  • the Pydantic models also check the patterns a field carries itself, such as the form of cis_version, but not the patterns of the two identifier types.

No validator checks three rules:

  • a Safeguard’s identifier starts with the number of the Control it is listed under;
  • a list never repeats an identifier or an Implementation Group;
  • the Implementation Groups are cumulative: the validator checks that every Safeguard is in IG3, but not that a Safeguard in IG1 is in IG2 too.

tests/test_data.py checks all three over every valid example.

  1. docs/index.md, Validating data ↩