Difference between revisions of "PrF UG queries create query"

From Protege Wiki
Jump to: navigation, search
(Automated import of articles)
 
Line 4: Line 4:
 
{{PrF_UG_TOC_queries}}<div id='prf_ug'>
 
{{PrF_UG_TOC_queries}}<div id='prf_ug'>
  
The Queries Tab allows you to query your project and locate all instances that match the criteria you specify.
+
The Queries Tab allows you to query your project and locate all instances
 +
that match the criteria you specify.
 
You can create a simple query,
 
You can create a simple query,
 
or combine multiple criteria to restrict or expand your results.
 
or combine multiple criteria to restrict or expand your results.
  
You can create a simple query based on a class,
+
You can create a simple query based on a class, a slot, or both.
a slot,
 
or both.
 
 
When you specify a slot,
 
When you specify a slot,
 
you also specify the criteria for matching the slot:
 
you also specify the criteria for matching the slot:
Line 16: Line 15:
 
<ul class='a'>
 
<ul class='a'>
 
   <li><p>
 
   <li><p>
     A query based solely on a class will find all instances of the selected class <i>and</i> all of its subclasses.
+
     A query based solely on a class will find all instances
 +
    of the selected class <i>and</i> all of its subclasses.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     A query based solely on a slot will find all instances whose value at the slot match the criteria you specify.
+
     A query based solely on a slot will find all instances
 +
    whose value at the slot match the criteria you specify.
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
     A query based on a class and a slot will find all instances of the class that match the criteria at the selected slot.
+
     A query based on a class and a slot will find all instances
 +
    of the class that match the criteria at the selected slot.
 
     </p>
 
     </p>
 
</ul>
 
</ul>
  
<b>Note:</b> Sometimes the query buttons or query entry bar will not display correctly.
+
<b>Note:</b>
You can refresh the query entry by clicking on another tab and then returning to the Query Tab.
+
Sometimes the query buttons or query entry bar will not display correctly.
 +
You can refresh the query entry by clicking on another tab
 +
and then returning to the Query Tab.
  
The directions below show how to select a class first,
+
The directions below show how to select a class first, then a slot.
then a slot.
 
 
You can also select the slot first and then the class;
 
You can also select the slot first and then the class;
 
this is useful if you remember the slot name,
 
this is useful if you remember the slot name,
 
but are not certain of the classes that it is attached to.
 
but are not certain of the classes that it is attached to.
To do this,
+
To do this, select the slot as in Steps 3 and 4,
select the slot as in Steps 3 and 4,
 
 
then select the class as in Steps 1 and 2.
 
then select the class as in Steps 1 and 2.
In this case,
+
In this case, the <b>Select Classes</b> dialog box
the <b>Select Classes</b> dialog box will show only those classes that have the selected slot.
+
will show only those classes that have the selected slot.
  
 
To create a query:
 
To create a query:
Line 48: Line 50:
 
     To specify a class,
 
     To specify a class,
 
     click the <b>Select Class</b>
 
     click the <b>Select Class</b>
     [[Image:PrF_UG_all_object.add.gif|all_object.add]]
+
     [[Image:PrF_UG_all_object.add.gif|all_object.add]] button
     button above the Class entry bar. (If you wish to create a query based solely on a slot,
+
     above the Class entry bar.
    start at Step 3.)
+
    (If you wish to create a query based solely on a slot, start at Step 3.)
   
+
     </p>
     </p><p> <div>[[Image:PrF_UG_queries_query_class_entry.png|queries_query_class_entry]]</div>
+
    <div>[[Image:PrF_UG_queries_query_class_entry.png|
 +
          queries_query_class_entry]]</div>
 
     </p>
 
     </p>
  
 
   <li><p>
 
   <li><p>
 
     Select the class you want from the <b>Select Classes</b> dialog box,
 
     Select the class you want from the <b>Select Classes</b> dialog box,
     then click <b>OK</b>. (If you wish to create a query solely on that class,
+
     then click <b>OK</b>.
     you are now ready to
+
    (If you wish to create a query solely on that class,
    [[PrF_UG_queries_run_query|run]]
+
     you are now ready to [[PrF_UG_queries_run_query|run]] it.)
    it.)
 
   
 
    </p><p> <div>[[Image:PrF_UG_queries_query_select_class.png|queries_query_select_class]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_queries_query_select_class.png|
 +
          queries_query_select_class]]</div>
  
 
   <li><p>
 
   <li><p>
 
     Click <b>OK</b>.
 
     Click <b>OK</b>.
   
 
    </p><p> <div>[[Image:PrF_UG_queries_query_class_filled.png|queries_query_class_filled]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_queries_query_class_filled.png|
 +
          queries_query_class_filled]]</div>
  
 
   <li><p>
 
   <li><p>
     To specify a slot,
+
     To specify a slot, click the <b>Select Slot</b>
    click the <b>Select Slot</b>
+
     [[Image:PrF_UG_all_object.add.gif|all_object.add]] button,
     [[Image:PrF_UG_all_object.add.gif|all_object.add]]
 
    button,
 
 
     above the Slot entry bar.
 
     above the Slot entry bar.
   
 
    </p><p> <div>[[Image:PrF_UG_queries_query_slot_entry.png|queries_query_slot_entry]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_queries_query_slot_entry.png|
 +
          queries_query_slot_entry]]</div>
  
 
   <li><p>
 
   <li><p>
Line 85: Line 85:
 
     If you selected a class,
 
     If you selected a class,
 
     only slots attached to that class will be shown.
 
     only slots attached to that class will be shown.
     If no class is selected,
+
     If no class is selected, all slots are available.
    all slots are available.
 
   
 
    </p><p> <div>[[Image:PrF_UG_queries_query_select_slot.png|queries_query_select_slot]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_queries_query_select_slot.png|
 +
          queries_query_select_slot]]</div>
  
 
   <li><p>
 
   <li><p>
 
     Click <b>OK</b>.
 
     Click <b>OK</b>.
     The slot will be filled in and the criteria menu immediately to the right will be displayed.
+
     The slot will be filled in
   
+
    and the criteria menu immediately to the right will be displayed.
    </p><p> <div>[[Image:PrF_UG_queries_query_slot_filled.png|queries_query_slot_filled]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_queries_query_slot_filled.png|
 +
          queries_query_slot_filled]]</div>
  
 
   <li><p>
 
   <li><p>
Line 102: Line 102:
 
     This menu becomes active after you select a slot;
 
     This menu becomes active after you select a slot;
 
     the choices are based on the slot's Value Type.
 
     the choices are based on the slot's Value Type.
   
 
    </p><p> <div>[[Image:PrF_UG_queries_query_menu_contains.png|queries_query_menu_contains]]</div>
 
 
     </p>
 
     </p>
 +
    <div>[[Image:PrF_UG_queries_query_menu_contains.png|
 +
          queries_query_menu_contains]]</div>
  
 
   <li><p>
 
   <li><p>
Line 113: Line 113:
 
   <ul>
 
   <ul>
 
     <li><p>
 
     <li><p>
       For
+
       For [[PrF_UG_slots_value_type_boolean|Boolean]] value type,
      [[PrF_UG_slots_value_type_boolean|Boolean]]
 
      value type,
 
 
       select whether the slot value is true or false.
 
       select whether the slot value is true or false.
 
       </p>
 
       </p>
 
    
 
    
 
     <li><p>
 
     <li><p>
       For
+
       For [[PrF_UG_slots_value_type_class|Class]] value type,
      [[PrF_UG_slots_value_type_class|Class]]
 
      value type,
 
 
       click the <b>Select Class</b>
 
       click the <b>Select Class</b>
       [[Image:PrF_UG_all_object.add.gif|all_object.add]]
+
       [[Image:PrF_UG_all_object.add.gif|all_object.add]] button
       button and select a class from the dialog.
+
       and select a class from the dialog.
       The query will find all instances where the slot value contains (or does not contain) the selected class.
+
       The query will find all instances where the slot value
 +
      contains (or does not contain) the selected class.
 
       </p>
 
       </p>
 
    
 
    
 
     <li><p>
 
     <li><p>
       For
+
       For [[PrF_UG_slots_value_type_float|Float]]
      [[PrF_UG_slots_value_type_float|Float]]
+
       or [[PrF_UG_slots_value_type_integer|Integer]] value type,
       or
 
      [[PrF_UG_slots_value_type_integer|Integer]]
 
      value type,
 
 
       enter the number to which you want to compare the slot value.
 
       enter the number to which you want to compare the slot value.
 
       </p>
 
       </p>
 
    
 
    
 
     <li><p>
 
     <li><p>
       For
+
       For [[PrF_UG_slots_value_type_instance|Instance]] value type,
      [[PrF_UG_slots_value_type_instance|Instance]]
 
      value type,
 
 
       click the <b>Select Instance</b>
 
       click the <b>Select Instance</b>
 
       [[Image:PrF_UG_all_object.add.gif|all_object.add]]
 
       [[Image:PrF_UG_all_object.add.gif|all_object.add]]
 
       or <b>Select Query</b>
 
       or <b>Select Query</b>
       [[Image:PrF_UG_queries_query.gif|queries_query]]
+
       [[Image:PrF_UG_queries_query.gif|queries_query]] button
       button and select a value from the dialog box.
+
       and select a value from the dialog box.
 
       </p>
 
       </p>
 
    
 
    
 
     <li><p>
 
     <li><p>
       For
+
       For [[PrF_UG_slots_value_type_symbol|Symbol]] value type,
      [[PrF_UG_slots_value_type_symbol|Symbol]]
 
      value type,
 
 
       the possible values are displayed as a drop-down list.
 
       the possible values are displayed as a drop-down list.
       Select a symbol from this list.<b>Note:</b> Sometimes the query buttons or query entry bar will not display correctly.
+
       Select a symbol from this list.
       You can refresh the query entry by clicking on another tab and then returning to the Query Tab.
+
      </p>
 +
      <p>
 +
      <b>Note:</b>
 +
      Sometimes the query buttons or query entry bar will not display correctly.
 +
       You can refresh the query entry by clicking on another tab
 +
      and then returning to the Query Tab.
 
       </p>
 
       </p>
 
   </ul>
 
   </ul>
 
</ol>
 
</ol>
  
To
+
To [[PrF_UG_queries_run_query|run]] the query, click <b>Find</b>
[[PrF_UG_queries_run_query|run]]
 
the query,
 
click <b>Find</b>
 
 
[[Image:PrF_UG_queries_query_find.png|queries_query_find]].
 
[[Image:PrF_UG_queries_query_find.png|queries_query_find]].
  
To
+
To [[PrF_UG_queries_saving_query|save]] the query in the Query Library,
[[PrF_UG_queries_saving_query|save]]
 
the query in the Query Library,
 
 
give it a name and click the <b>Add Query to Library</b>
 
give it a name and click the <b>Add Query to Library</b>
<div>[[Image:PrF_UG_queries_query.library.add.gif|queries_query.library.add]]</div>
+
[[Image:PrF_UG_queries_query.library.add.gif|queries_query.library.add]] button.
button.
 
  
 
</div>
 
</div>

Revision as of 14:58, October 16, 2008

Creating a Single Query


Protege-Frames User's Guide
Queries
The Queries Tab
The Query Editor
The Search Results Pane
The Query Library Pane
Creating a Single Query
Combining Multiple Queries
Chaining Multiple Queries
Running a Query
Saving a Query
Retrieving a Query
Clearing a Query
Exporting Query Results
Glossary, Editing Help

The Queries Tab allows you to query your project and locate all instances that match the criteria you specify. You can create a simple query, or combine multiple criteria to restrict or expand your results.

You can create a simple query based on a class, a slot, or both. When you specify a slot, you also specify the criteria for matching the slot:

  • A query based solely on a class will find all instances of the selected class and all of its subclasses.

  • A query based solely on a slot will find all instances whose value at the slot match the criteria you specify.

  • A query based on a class and a slot will find all instances of the class that match the criteria at the selected slot.

Note: Sometimes the query buttons or query entry bar will not display correctly. You can refresh the query entry by clicking on another tab and then returning to the Query Tab.

The directions below show how to select a class first, then a slot. You can also select the slot first and then the class; this is useful if you remember the slot name, but are not certain of the classes that it is attached to. To do this, select the slot as in Steps 3 and 4, then select the class as in Steps 1 and 2. In this case, the Select Classes dialog box will show only those classes that have the selected slot.

To create a query:

  1. To specify a class, click the Select Class all_object.add button above the Class entry bar. (If you wish to create a query based solely on a slot, start at Step 3.)

    queries_query_class_entry
       </p>
    
  2. Select the class you want from the Select Classes dialog box, then click OK. (If you wish to create a query solely on that class, you are now ready to run it.)

    queries_query_select_class
  3. Click OK.

    queries_query_class_filled
  4. To specify a slot, click the Select Slot all_object.add button, above the Slot entry bar.

    queries_query_slot_entry
  5. Select a slot from the Select Slot dialog box. If you selected a class, only slots attached to that class will be shown. If no class is selected, all slots are available.

    queries_query_select_slot
  6. Click OK. The slot will be filled in and the criteria menu immediately to the right will be displayed.

    queries_query_slot_filled
  7. Make a selection from the pull-down criteria menu. This menu becomes active after you select a slot; the choices are based on the slot's Value Type.

    queries_query_menu_contains
  8. Enter a value for comparison at the entry bar to the right. The entry method for this value depends on the slot value type.

    • For Boolean value type, select whether the slot value is true or false.

    • For Class value type, click the Select Class all_object.add button and select a class from the dialog. The query will find all instances where the slot value contains (or does not contain) the selected class.

    • For Float or Integer value type, enter the number to which you want to compare the slot value.

    • For Instance value type, click the Select Instance all_object.add or Select Query queries_query button and select a value from the dialog box.

    • For Symbol value type, the possible values are displayed as a drop-down list. Select a symbol from this list.

      Note: Sometimes the query buttons or query entry bar will not display correctly. You can refresh the query entry by clicking on another tab and then returning to the Query Tab.

    </ol>

    To run the query, click Find queries_query_find.

    To save the query in the Query Library, give it a name and click the Add Query to Library queries_query.library.add button.

    </div>