A query can be attached to a class. In this case, the query lies within the scope of instances of the class to which it is attached. For example, suppose a query is attached to the Editor class. This means that the query-checking engine assumes an implicit range over instances of Editor for all undefined variables.
Before you attach a query to a class, you should make the class queriable. This enables the SLOT-QUERIES slot for the class. A query that has been attached to a class is visible in the SLOT-QUERIES pane of the Class Form for that class. See Making a Class Queriable for more information.
You can attach a query 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 query to a class makes the attachment at the Protégé level, and also makes the query visible at the class.
Note: By attaching a query 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 query to apply to multiple classes that are not subclasses of a single class, as otherwise you would have to write the query in the scope of each class. However, this should be used with caution, because if a query is de-attached from all of its classes, it will lose its implicit range definitions, and will have unbound variables.
You can attach a query to a class in one of three ways:
To attach a query to a class at the PAL Queries Tab:
To attach a query to a class at the Classes Tab:
For information on how to attach a query to a class by creating it at the class, see Creating a Blank Query.
PAL Queries User Interface/Attaching a Query to a Class