"Constraint
- Last Updated: May 29, 2026
- 9 minute read
- Semaphore
- Documentation
Introduction
KMM (Knowledge Model Management) can check for invalid and possibly undesirable data in each model in KMM. These checks occur at various points in the modelling process:
- Running the “Constraints Violations” report
- Creation and editing of data in the KMM UI
- When Tasks are committed
- When a SPARQL query is run in the SPARQL editor
This article will describe the nearly 50 different constraints that KMM checks for at these various points in the modelling process. Note that each constraint is of type Warning or Error, which can impact whether the violation will be allowed (e.g. just a warning is thrown) or disallowed (e.g. an error is thrown).
What Are Constraint Violations and How Does Invalid Data Get into a Model
KMM requires specified RDF structures to display and edit a model through its UI. These requirements can be found here: Overview of Semaphore SKOS-XL Constructs. But the backend data store of KMM will allow the storage of RDF data outside the range of what’s viewable and editable in KMM. This allows interoperability with other RDF applications and systems but can also hide bad or undesirable data. Invalid data can be introduced into the model in different ways, primarily through:
- Using SPARQL insert and/or delete queries that don’t follow the Semaphore SKOS modelling guidelines
- Importing of RDF generated in other systems
Less common ways include:
- Task conflicts, where the work done in 2 or more tasks conflict with each other
- Certain conditions when importing data through the KMM CSV/Excel importing process
Constraints Violations Report
KMM contains a number of OOB (out of the box) reports in the Reporting section of KMM. These reports are grouped onto 3 tabs, one of which is the Validation tab:

On the Validation tab, there are a number of reports that check for either invalid or possibly undesirable data in the model. Often this invalid data is not visible in the KMM UI, but may interfere with the use of the model, so it’s important to be able to find and address this data by either fixing, deleting, or making a deliberate decision to keep it.
The “Constraint Violations” report is the most comprehensive of these reports, and checks for all the violations described in the table below.
Editing in the KMM UI
Error constraints are enforced in the KMM UI, and therefore cannot be created through the UI. However, some (but not all) of the Warning constraints can be created through the UI, usually when the user is shown the warning and they elect to save the data anyway, for example:

Committing Tasks
These same Error and Warning constraints are checked when a Task is committed and the “Validate before commit” checkbox is selected:

If any Errors or Warnings are returned, the Task cannot be committed. Validating before commit might not be something you want to do if any of the Warning constraints are deemed to be acceptable in your models – for example, duplicate pref labels may be the most commonly acceptable condition.
The SPARQL Editor
When using the SPARQL editor, when an INSERT or DELETE query is put into the editor, the “Run Edit Rules” and “Check Constraints” checkboxes are included:

If “Check Constraints” is selected, then the same constraints are checked when the query is run. If any constraints are violated, whether Warnings or Errors, an error message will be displayed and the query will not be executed.
If “Check Constraints” is de-selected, then invalid data can be inserted or left in the model.
Summary of Constraint Checks
Generally, the validation checks fall into the following categories:
- Missing labels on:
- Concept Schemes
- Classes
- Relationship Types
- Alt Label Types
- Metadata Property Types
- Pref Labels on Concepts
- Label violations:
- Only one label per language for objects and Pref Labels
- Concepts that have the same value in the same language in both the “alternative label” and the “preferred label”
- Whitespace only labels
- Orphaned Concepts – Concepts must have a parent, whether another concept or as the top concept of a concept scheme
- Domain and Range Violations
- Relationships – given concept A is related to concept B, and one or both do not belong to the proper class(es) defined for that relationship type
- Metadata Properties – e.g. a value with a data type of ‘date’ is not added to a property with a type of ‘boolean’
- Hierarchical Cyclic Loops
- Duplicate URIs for different object types
- Checks for untyped subjects (i.e. objects without an rdf:type, such as a concept without a class)
Table of All Constraints
This table lists all the constraints that are checked for. Most of the time, the constraint code is included with the message, but not always.
^ Constraint ID ^ Error Level ^ Message ^ Description/Example ^
| N001 | Error | Resource should have at least one label | Concept Schemes and structural elements (e.g. Relationship Types, Metadata Property Types, etc.) need to have at least one label. |
| N002 | Warning | There should be at least one Preferred Label for the concept At least one prefLabel | Concept Pref Labels need to have at least one label. |
| N005 | Error | Object can only have one label per language | Concept Schemes and structural elements (e.g. Relationship Types, Metadata Property Types, etc.) can only have one label per language. |
| N006 | Error | Label of object should be globally unique | Labels for Concept Schemes and structural elements (e.g. Relationship Types, Metadata Property Types, etc.) must be globally unique. |
| N007 | Error | Concept should be attached to the hierarchy | Concept must have a parent, either a broader concept or as a top concept of a concept scheme. |
| N008 | Warning | Object uses x range, but requires y range. | Structural elements range violations |
| N009 | Warning | Object uses x domain, but requires y domain. | Structural elements domain violations |
| N010 | Warning | Whitespace only labels are not allowed | Labels for Concept Schemes, structural elements, and Concept Pref Labels cannot be spaces only. |
| N013 | Error | A property can‘t be inverse of itself|Symetrical relationship types cannot have the same URI for both the forward and inverse relationship name.| |N016|Error|Range type of property property must be subclass of range type of the parent property type|Sub-properties must be in the range of its parent property. For example, you cannot have a ’string’ metadata property narrower to a ‘boolean’ metadata property. | |
| N017 | Error | Domain type of property property must be subclass of domain type of the parent property type | Sub-properties must be in the domain of its parent property. For example, you cannot have a metadata property with domain “Concept” narrower to a metadata property with a domain that’s a sub-class of “Concept”. |
| N021 | Error | Local name of property must be valid | This checks that a URI is legal, e.g. for a concept. Note: this check is only made upon the creation of an object either through the UI, a SPARQL insert, or an RDF file import. |
| N024 | Warning | Concept should not be related to itself | This is for a concept having an associative relationship to itself. |
| N025 | Warning | Concepts should not create loops in the hierarchy | Concept’s path to root cannot contain itself; i.e. it’s a descendent of itself. |
| N026 | Warning | Property value incompatible with datatype for rdfs:range | This is where a metadata property value type is not of the type specified; e.g. a string value type stored in a boolean property. |
| N027 | Warning | value incompatible with its datatype | This is where a metadata property value itself is not of the type expected; e.g. a string value identified as a boolean value. |
| N028 | Error | Only One TargetSchemeInORT instance | When a review is created for KRT, optional concept schemes to separate modifications into “new concepts”, “modified concepts”, and “to do” lists are created. This constraint check ensures only one of each of these concept schemes exist in the review. |
| N031 | Warning | Verify datatype of sem:defaultValue is compatible with property range | Checks that the default value for a data property (e.g. “true” set for a boolean property) is of the correct type (e.g. a boolean vs. a string). |
| N032 | Error | Abstract classes should not be instantiated. | Checks for the use of an abstract class on a concept. |
| N033 | Error | Can not make class as abstract when it’s already been instantiated | When a class is assigned to a concept, the class cannot then be made an abstract class. |
| N034 | Error | Can not add altLabel in different language than the required one | If an alt label is set to use a specified language (e.g. language neutral), checks there are no alt labels of that type in another language. |
| N037 | Error | Concept URI is in collision with different resource type URI | The URI of an object is already in use by a different object type; for example, a concept cannot have the same URI an already existing metadata property. |
| SX13 | Warning | Concept can not have the same value in the same language in both the “alternative label” and the “preferred label”. | Pref Label value and Alt Label value are the same in the same language. |
| SX14 | Error | Only one prefLabel per language | Checks for the existence of more than one pref label in the same language for a concept. |
| S27 | Warning | A concept can’t have the same value in both a related property and a broader/narrower property. | A concept can’t also have an associative relationship to its parent concept. |
| S36 | Error | Check Ordered Collection Members | When ordered lists of relationships (hierarchical or associative) are used in the model, this constraint checks to ensure there are no errors in the ordered list data. |
| S46a | Error | A concept can’t have the same value in both a skos:broaderMatch property and a skos:exactMatch property. | skos:exactMatch and skos:broadMatch are not accessible in the KMM UI. However, if those relationships exist in the model (e.g. inserted by SPARQL or imported as RDF), then an object (e.g. a Concept) with an associative skos:exactMatch to another object cannot also have a skos:broadMatch with that object. This has the same intention as S27. |
| S46b | Error | A concept can’t have the same value in both a skos:exactMatch property and a skos:relatedMatch property. | As in S46a, these properties are not accessible in the KMM UI. However, if they exist in the model two objects (e.g. two Concepts) cannot be related to each other with both skos:exactMatch and skos:relatedMatch. |
| CUST001 | Warning | Unique concept label per concept class | Checks whether concept pref labels are unique within a class; note this violation will also cause the CUST002 violation. |
| CUST002 | Warning | Unique concept label | Checks whether concept pref labels are unique within a model, regardless of class and concept scheme. |
| E001 | Error | Concepts (and ConceptSchemes) cannot use untyped objects. | Concepts and Concept Scheme predicate objects must have an rdf:type; for example, if a Concept doesn’t have a class (i.e. doesn’t have an rdf:type of skos:Concept or a sub-class of skos:Concept), and is a top concept, then that Concept Scheme will throw this error. |
| E002 | Error | Concepts (and ConceptSchemes) cannot use untyped properties. | Concepts and Concept Schemes cannot use properties that don’t have an rdf:type; for example, if a Concept has a metadata property, but that property does not have an rdf:type, then this error is thrown. |
| E003 | Error | Each class must have at least one superclass | In KMM, all classes are of type owl:Class and must be a sub-class of skos:Concept. If an owl:Class is inserted and is not also a sub-class of skos:Concept, this error is thrown. |
| E004 | Error | Ensures the subjects have at least one type. | Checks to make sure that any element in the subject position of a triple has an rdf:type associated with it. For example, that a concept has a class. Note is check is made only when an object is created. |
| OWL001 | Error | Min cardinality constraint | Checks to make sure that KMM min cardinality conditions are met. |
| OWL002 | Error | Max cardinality constraint | Checks to make sure that KMM max cardinality conditions are met.For example, there can be no more than one instance of a boolean property on a concept. |