Difference between revisions of "PrF UG meta metaclass example"
Line 25: | Line 25: | ||
so that it inherits all the structure of a typical class. | so that it inherits all the structure of a typical class. | ||
</p> | </p> | ||
− | <div>[[Image:PrF_UG_meta_metaclass_hierarchy.png| | + | <div>[[Image:PrF_UG_meta_metaclass_hierarchy.png|frame|none| |
− | + | Class Browser, "Wine template" selected]]</div> | |
<li><p> | <li><p> | ||
Line 53: | Line 53: | ||
to <b>Multiple</b> to allow more than one winery on the list for each class. | to <b>Multiple</b> to allow more than one winery on the list for each class. | ||
</p> | </p> | ||
− | <div>[[Image:PrF_UG_meta_best_wineries_slot.png| | + | <div>[[Image:PrF_UG_meta_best_wineries_slot.png|frame|none| |
− | + | Template Slots, configured]]</div> | |
</ul> | </ul> | ||
Line 62: | Line 62: | ||
if you have not already done so. | if you have not already done so. | ||
</p> | </p> | ||
− | <div>[[Image:PrF_UG_meta_wine_template.png| | + | <div>[[Image:PrF_UG_meta_wine_template.png|frame|none| |
− | + | Wine template instance dialog]]</div> | |
</ol> | </ol> | ||
Line 79: | Line 79: | ||
shows up as a new field (located at the lower left) in the Class Editor for your class. | shows up as a new field (located at the lower left) in the Class Editor for your class. | ||
</p> | </p> | ||
− | <div>[[Image:PrF_UG_meta_chardonnay.png| | + | <div>[[Image:PrF_UG_meta_chardonnay.png|frame|none| |
+ | Chardonnay instance dialog]]</div> | ||
<li><p> | <li><p> |
Revision as of 15:48, October 24, 2008
Example: Creating and Using a Metaclass
This example gives an overview of how to create and use a metaclass.
Suppose you are creating a knowledge base of wines and wineries. In this knowledge base, a type of wine, such as Chardonnay, is a class, while a specific label is an instance of that class. Suppose that, for each class of wine, you wanted to be able to enter the wineries that are, in your opinion, the best producers of that type of wine. You could do this using metaclasses, as described below.
Creating a Metaclass
First, set up your metaclass:
Create a metaclass, Wine Template, to use for wines. You create this subordinate to :STANDARD-CLASS, so that it inherits all the structure of a typical class.
Create an additional template slot, best wineries, that allows you to enter a list of wineries.
Configure best wineries as follows:
Set the Value Type to Instance, so that the values of this slot can be instances in the knowledge base.
Set the Allowed Classes to Winery, so that, specifically, these instances are wineries.
Set the Cardinality to Multiple to allow more than one winery on the list for each class.
Attach Best Wineries to Wine template as a template slot, if you have not already done so.
Using the Metaclass
Once you have created the metaclass, you can use it as follows:
Create a class, such as Chardonnay, using Wine template as the metaclass. Or, if you have already created the classes for your wines, change the metaclass to Wine template. When you do this, the best wineries slot that you attached to the template shows up as a new field (located at the lower left) in the Class Editor for your class.
You can now use the Best Wineries field to select one or more wineries from your instances.