Validate data using model-specific constraints
- Last Updated: May 29, 2026
- 5 minute read
- Semaphore
- Documentation
While SKOS-XL validation can identify many issues with your model data, the constraints are flexible by design and might not be sufficient in all scenarios. For stricter validation of your data, the Knowledge Model Management (KMM) component also supports model-specific validation. The constraints used for model-specific validation are defined by the user and can be tailored to the unique composition of a model. You can define your constraints using the following:
After your constraints are defined, validation occurs when creating or editing data in the KMM UI or when running a validation report. See the Validate data using model-specific constraints for more information.
Define model-specific constraints using the KMM UI
To add constraints to your model:
-
Open your model; then, click Open Master. Note that, in this procedure, we use the provided "Space Missions" model in the examples.
-
From the banner menu, select Master > Structure.
-
From the list of model objects on the left, expand Concept Classes and select the type of concept class to which you would like to add a constraint. For example, Select Concept Classes > Concept> Vehicle > Spacecraft.

-
In the Details view (the default), click the constraint icon (
) to add constraints for any of the Concept Relationships, Resource Metadata, Label Relationship, or Mapping Relationships that have been defined for your class. For example, under Concept Relationships, select the constraint icon for piloted by.The constraint definition window for your selected relationship or metadata appears.

-
In the constraint definition window, enable and provide values for the properties that define your constraint. Note that the properties available differ based on the type of relationship or metadata for which you are applying the constraint.
- Properties for all constraints:
- Severity: Specifies the level of severity to return when the conditions of the constraint are violated. For example, select Warning.
- Cardinality: Specifies whether there is a minimum and/or maximum number of values required to satisfy the condition. For example, check the Minimum count box, and select 1 from the drop-down. Do not check the Maximum count box.
- Properties specific to certain relationships and metadata:
- Pattern: Specifies restrictions on the string composition, such as numerals or capital letters only, and minimum and/or maximum string length. This value does not apply to our example.
- Value range: Specifies minimum and/or maximum values for the range of data. This value is not applicable to our example.
Note: You must specify the severity level and at least one condition to save your constraint.
- Properties for all constraints:
-
Click Save to save your constraint definition.
If successful, a color-coded label for your constraint label appears next to the relationship or metadata for which you applied the constraint. For example, since we created a warning for the
piloted byrelationship with a condition that required 1 related concept, there will be a yellow label, for warning, forMin count: 1.
Results: You have successfully defined a constraint. If the conditions of your constraint are not met, you will see color-coded asterisks next to your concepts in the Details view in the master model. In addition, you can run reports as described in Validate data using model-specific constraints
Add constraints using SHACL
If you need model-specific constraints that are not already definable in the KMM UI, you can add additional constraints using SHACL.
To add constraints using SHACL:
-
Open your model; then, click Open Master. Note that, in this procedure, we will use the provided "Space Missions" model in the examples.
-
From the banner menu, select Master > Export.
The Export '<model name>' window appears.

-
In the Export window for your model, select Turtle (the default) from the Export SHACL row; then, click Download.
Your SHACL file downloads. The file is named
<model_name>-shaclgraph.ttl. -
Open the SHACL file with a text editor and add your entries for SHACL constraint-definitions to the end of the file. For example, a constraint definition would take the following form:
semsh:NodeShape-targetClass-http-models.smartlogic.com-SpaceMissions-Spacecraft rdf:type sh:NodeShape ; sh:property [ sh:minCount 1 ; sh:minLength 20 ; sh:path <http://models.smartlogic.com/SpaceMissions#Wikidata-URI> ; sh:severity sh:Warning ] ; sh:targetClass <http://models.smartlogic.com/SpaceMissions#Spacecraft> . -
Save your file.
-
From the banner menu, select Master > Export.
The Import into <model_name> pane opens.
-
Select Import SHACL; then, drag your
<model_name>-shaclgraph.ttlfile into the drop zone. -
Optionally, select the Overwrite existing values box. Enable this setting when you are overwriting the entire file. You can disable this setting when only adding additional SHACL entries and are confident that there are no conflicts with the existing syntax.
-
Click Next; then, Finish.
Validate data using model-specific constraints
Validation for model-specific constraints occurs when creating and editing data in the KMM UI or when running validation reports. For the KMM UI, validation is reported in the form of warning messages when a violation occurs. However, if you want to view all the violations that occur in your model, you will need to run a validation report.
To run a validation report using model-specific constraints:
-
Open your model; then, click Open Master. Note that, in this procedure, we will use the provided "Space Missions" model in the examples.
-
From the menu, select Master > Reporting.
-
From the Reporting menu on the left, select Validation > SHACL Validation Report.

-
In the SHACL Validation Report pane, verify that the following boxes are checked:
- Under filter Results:
- Include validation results with info severity (default)
- Include validation results with warning severity (default)
- Include validation results with violation severity (default)
- Focus node ID options:
- Include focus node's URI
- Include focus node's display name (default)
- Under filter Results:
-
Click Run Report; then, select the format for the report. Note that HTML will open the report in your browser, while the other options will download a local copy.
Results: A report is generated that describes the violations of the model-specific constraints you created. You can use this report to address violations and maintain the integrity of your model data. For more information on updating your model data, see How to build your model.