.. _section-Editing an Individual Property: Editing an Individual Property ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To edit an individual property such as **birthDate**, click the **Edit row** button next to the **birthDate** row. The **Edit row** button turns into a **red forbidden** sign and the **Delete** button turns into a **green check mark**, as seen in :numref:`figure-KB-Editor-edit-birthdate-buttons.png`. The **birthDate** row in the table now becomes editable. Edited values are saved when the **green check mark** button is clicked again. .. _figure-KB-Editor-edit-birthdate-buttons.png: .. figure:: ../../../../figs/KB-Editor-edit-birthdate-buttons.png :alt: Enabling editing of **Eric**’s **birthDate** in **KB Editor** editing window Enabling editing of **Eric**’s **birthDate** in **KB Editor** editing window When the property being edited has a range restriction, a list of existing individuals of that class in the KB is made available. To access the list, click the down arrow to the right of the property field. For example, after enabling editing of the property **spouse** for individual **Eric**, click the down arrow of the field to see a list of individuals available in the KB, as shown in :numref:`figure-KB-Editor-edit-eric-spouse.png`. To change **Eric**’s spouse, either choose one of the individuals from the list, or use the menu option **Create Fresh Individual in Namespace** to type in the name of a new individual. .. _figure-KB-Editor-edit-eric-spouse.png: .. figure:: ../../../../figs/KB-Editor-edit-eric-spouse.png :alt: Range restrictions shown for updating property spouse Range restrictions shown for updating property spouse After a property is modified in the editing window and corresponding changes which appear in the ontology file are saved in the **Text Editor**, queries can be rerun to obtain new results. The example below describes modifying the property **birthDate** of individual **Mark** and obtaining different results for query ’Who is how old?’. First run the query ’Who is how old?’. Click the **Queries** tab to launch the **Queries** plugin. Scroll down in the **Queries** window to find ’Who is how old?’. Click to highlight this query, as shown in :numref:`figure-KB-Editor-Who-is-how-old.png` and press **Execute**. .. _figure-KB-Editor-Who-is-how-old.png: .. figure:: ../../../../figs/KB-Editor-Who-is-how-old.png :alt: Who is how old Who is how old When the query execution is done, the **Query Results** plugin is automatically launched to display the query results. Scroll down the list in the **Query Results** window to find one particular result: Mark is 10 years old. This result is shown in :numref:`figure-KB-Editor-Mark-is-10.png`. .. _figure-KB-Editor-Mark-is-10.png: .. figure:: ../../../../figs/KB-Editor-Mark-is-10.png :alt: Mark is 10 years old Mark is 10 years old Now change **Mark**’s **birthDate** property to conclude a different result. To do this, activate the **KB Editor** plugin by clicking the **KB Editor** tab. Expand class **Person** and subclass **Man**. Click to highlight individual **Mark** to display the **Individual Properties** table in the **KB Editor** editing window. Click the **Edit row** button to the left of **Mark**’s **birthDate** row to enable editing, as shown in :numref:`figure-KB-Editor-activate-edit-birthdate.png`. .. _figure-KB-Editor-activate-edit-birthdate.png: .. figure:: ../../../../figs/KB-Editor-activate-edit-birthdate.png :alt: Enable editing of **Mark**’s **birthDate** property Enable editing of **Mark**’s **birthDate** property Click in the **Value** field and change **Mark**’s birthDate to **2004-12-27**. Click the **green check mark** button to save the changes, as seen in :numref:`figure-KB-Editor-change-2006-to-2004.png`. .. _figure-KB-Editor-change-2006-to-2004.png: .. figure:: ../../../../figs/KB-Editor-change-2006-to-2004.png :alt: Change **Mark**’s birthDate from 2006 to 2004 Change **Mark**’s birthDate from 2006 to 2004 After the new property value is saved in the **KB Editor**, the corresponding **Mark** statement in family.flr should also be updated to have the new **birthDate** property value, as shown in :numref:`figure-KB-Editor-birthDate-updated.png`. Similarly, editing can be done directly to family.flr in the **Text Editor**. When the file is saved, modifications will be reflected in the taxonomy and editing windows of the **KB Editor**. .. _figure-KB-Editor-birthDate-updated.png: .. figure:: ../../../../figs/KB-Editor-birthDate-updated.png :alt: **Mark**’s birthDate is also updated in family.flr **Mark**’s birthDate is also updated in family.flr Note that changes made in the **KB Editor** are not visible in other plugins such as the **Queries** or **KB Search** until the corresponding .flr file opened in the **Text Editor** is also saved. Now save family.flr in the **Text Editor**. Then click the **Queries** tab to activate the **Queries** plugin. Execute query ’Who is how old?’ again. The new query results should now show Mark is 12 years old, as shown in :numref:`figure-KB-Editor-Mark-is-12.png`. .. _figure-KB-Editor-Mark-is-12.png: .. figure:: ../../../../figs/KB-Editor-Mark-is-12.png :alt: Mark is 12 years old with updated **birthDate** property Mark is 12 years old with updated **birthDate** property **Syntax Error Flagging** The **KB Editor** detects and flags syntax errors while a property is being edited. To see an example of this, we will edit the height property of individual **Benjamin**. In the KB Editor, click the pencil icon next to **Benjamin**'s height property. This enables the height value to be edited, as shown in :numref:`figure-KB-Editor-Benjamin-height-1.png`. .. _figure-KB-Editor-Benjamin-height-1.png: .. figure:: ../../../../figs/KB-Editor-Benjamin-height-1.png :alt: **Benjamin**'s height property in edit mode **Benjamin**'s height property in edit-mode Click to place the cursor inside the field. Use the delete key to delete the height value **72**. The background color of the field turns red. At the same time, a pop up message reports a syntax error in the field, as seen in :numref:`figure-KB-Editor-Benjamin-height-2.png`. The error is caused by the fact that the quantity predicate requires 2 arguments, a number and a type. The **KB Editor** detects the missing argument and flags it as a syntax error. The edited value cannot be saved when there is an uncorrected syntax error. .. _figure-KB-Editor-Benjamin-height-2.png: .. figure:: ../../../../figs/KB-Editor-Benjamin-height-2.png :alt: **KB Editor** reports a syntax error when **72** is deleted from the height value **KB Editor** reports a syntax error when **72** is deleted from the height value To correct the error, type **71** in to replace the previous **72**. The background color of the field returns to normal and the pop up error goes away, as shown in :numref:`figure-KB-Editor-Benjamin-height-3.png`. The **KB Editor** no longer flags any syntax error because both required arguments are there for the height quantity. Now the changed height value can be saved. .. _figure-KB-Editor-Benjamin-height-3.png: .. figure:: ../../../../figs/KB-Editor-Benjamin-height-3.png :alt: Typing in **71** corrects the flagged syntax error Typing in **71** corrects the flagged syntax error