PrF UG inst copy instance

From Protege Wiki
Jump to: navigation, search

Copying an Instance


Protege-Frames User's Guide
Instances
Instances Tab
Class Browser at Instances Tab
Instance Browser
Instances Window
Instance Buttons
Instance Menu
Types Pane
Instance Editor
Standard Field Types
Fields with Multiple Cardinality
Boolean Fields
Class Fields
Float Fields
Instance Fields
Integer Fields
String Fields
Symbol Fields
Creating an Instance
Creating Multiple Instances
Displaying the Instance Editor
Setting the Display Slot
Showing Subclass Instances
Editing an Instance
Copying an Instance
Deleting an Instance
Finding an Instance
Changing an Instance's Class
Working with Instance Types
Instance Icons
Glossary, Editing Help

You can copy an existing instance, using the Copy Instance (instances_instance.copy) button. Copying an instance is useful when you want to create multiple instances that share some field values. You can create the first instance, fill out the shared values, then copy the instance and fill out or change the remaining values.

Unless you select Deep Copy, copying an instance duplicates the instance with identical field values. Only the internal name stored by Protege is changed. If you are working with deep copies, you may want to temporarily clear the display slot, so that it displays the internal name.

Making Copies

  1. At the Instances tab, select the instance that you want to copy.

  2. Click the Copy Instance (instances_instance.copy) button.

  3. In the Copy Frames dialog box, enter the number of copies that you want to make.

    Copy Frames dialog
  4. To have Protege-Frames perform a "deep copy", select the deep copy option. This is described more fully below. Otherwise, the instance is duplicated with identical field values; only the instance name is changed.

What is a Deep Copy?

You can select to "deep copy" an instance. A deep copy is a recursive copy that creates a copy of:

  • the selected instance

  • any instance that appears as a value for an Instance entry field in any copied instance

Note the following:

  • The copy is recursive. As long as a new instance appears as a value for a copied instance, a copy of it is created.

  • It is possible for an instance to appear more than once in the chain. If this happens, only one copy is created.

  • Other referenced instances do not get copied.

For example, if you deep copy the instance M137 for the class Personals_Ad, then all of the following are copied:

  • the instance M137 (class = Personals_Ad)

  • all the instances which appear as instance values for M137, specifically:

    • the instance 08/19/97 (class = Newspaper), which appears as the value for the Published In field of M137

  • all the uncopied instances which appear as values for 08/19/97, specifically:

    • Tuesday (class = Prototype_Newspaper), which appears as the value for the Prototype field

  • all the instances which appear as values for Tuesday:

    • Weekday Ads (class = Billing_Chart) in the Prototype Billing Chart field

    • Lifestyle, Local News, Magazine, Science, Sports, and World News (class = Section) in the Sections field

None of these instances have any instance fields, so the copy stops here.

  • M137 appears again as an instance of 08/19/97. However, as it has already been copied, no additional copy is created.

  • M137 appears as a value for San Jose Mercury News (class = Library). This is not copied.