A constraint can be attached to a class. In this case, the constraint lies within the scope of instances of the class to which it is attached. For example, the editor-employee-salary-constraint from the newspaper sample project is attached to the Editor class. This means that the constraint-checking engine assumes an implicit range over instances of Editor for all undefined variables. A constraint that has been attached to a class is visible in the Constraints pane of the Class Form for that class. You can attach a constraint to more than one class.
Note: The same restriction to instances of the Editor class is also enforced by the syntax (defrange ?edit :FRAME Editor). However, attaching a constraint to a class makes the attachment at the Protégé level, and also makes the constraint visible at the class.
Note: By attaching a constraint to a class, you can make an implicit variable range definition, that is, you could omit a defrange statement for that variable. This can be used when you want the defrange of the constraint to apply to multiple classes that are not subclasses of a single class, as otherwise you would have to write the constraint in the scope of each class. However, this should be used with caution, because if a constraint is de-attached from all of its classes, it will lose its implicit range definitions, and will have unbound variables.
You can attach a constraint to a class in one of three ways:
To attach a constraint to a class at the PAL Constraints Tab:
To attach a constraint to a class at the Classes Tab:
For information on how to attach a constraint to a class by creating it at the class, see Creating a Blank Constraint.
PAL Constraints User Interface/Attaching a Constraint to a Class