KB Editor for Content Browsing¶
The KB Editor plugin allows users to browse classes, subclasses and individual instances of the ontology base or KB. It also allows classes, individual instances and instance properties in the KB to be edited, added and removed. This section describes the browing capabilities of the KB Editor. For its editing capabilities, please refer to Section KB Editor for Content Editing.
Launching the KB Editor
Double click a .flr ontology file in the Sunflower project navigation window. This loads the ontology file into the Text Editor. Activate the KB Editor plugin by selecting Window -> Show View -> KB Editor from the main navigation toolbar, or by directly clicking the KB Editor tab across the middle of the right window, as illustrated in Fig. 28 and Fig. 29.
Taxonomy Window in KB Editor
The KB Editor displays the KB in a taxonomy tree which includes 4 main categories of information: Classes, Latent Queries, Queries and Rules. There is also an uncategorized category to catch identifiers which fall outside of the known categories. Subclass and individual identifiers are displayed hierarchically under the category Classes.
In the KB Editor taxonomy window, identifiers in bold black are individual instances or classes local to the current file. Identifiers in gray are identifiers which are non-local or imported. Identifiers in bold gray are non-local identifiers which have a local subclass or a local instance, e.g., Test. Fig. 30 shows the taxonomy window when it is first launched with family.flr loaded in the Text Editor.
By default, the KB Editor taxonomy tree includes all local and non-local identifiers in the import closure. Local identifiers appear in bold black while non-local identifiers appear in gray. The tab across the top to the right of the taxonomy window shows the default option All. Click this tab and a drop-down menu with one other option should appear, as shown in Fig. 31. The other option Relevant retricts the taxonomy tree to show only local identifiers from the current file.
The Tree Expansion setting sets the expansion level of the entire taxonomy tree. Only the top level of the taxonomy tree is shown when this setting is 1. The top and 2nd levels are shown when the setting is 2, and so on. In Fig. 32, the top 3 levels of family.flr are shown after Tree Expansion is set to 3.
Editing Window of KB Editor
To the right of the taxonomy window is the editing window of the KB Editor. Detail information of the currently selected identifier in the taxonomy window is shown here in 4 tables: Superclasses, Class Properties, Types and Individual Properties. Depending on the type of identifier selected, some of the tables may be empty. Fig. 33 shows this editing window with detail information about the selected identifier Person. The following describes how to use the KB Editor to inspect or browse the KB. To use the KB Editor for editing the KB, see section KB Editor for Content Editing for more details.
To launch the editing window, simply click to highlight an identifier in the taxonomy window. For example, click to select class identifier Person. As illustrated in Fig. 34, an empty Superclass table is shown because Person has no superclass. The Types and Individual Properties tables are also empty because Person has no individual content. The Class Properties table, on the other hand, shows a list of properties for Person. Each property is displayed with columns including Property name, Value, Kind, Min, Max, Asserted In, and File. The Value column is the property’s data type or default class, Kind is the type of value such as range or value, Min and Max are the minimum cardinality required and maximum cardinality allowed respectively, Asserted In is the class or individual instance where the property value or range is asserted, and File is the name of the file where the property is asserted.
Browsing a Class Identifier in the Editing Window
A class identifier such as Person is an identifier with class content. For a class identifier, a property in black indicates that it is directly asserted in that class, while a property in gray indicates that it is inherited from a parent class. Note that Fig. 34 shows all properties of class identifier Person in black. This is because all these properties are directly asserted in the Person class. Click the > or expand button next to Person in the taxonomy window to see the subclasses Man, MotherInLaw and Woman. Then click class identifier Man to see all its properties shown in gray, as shown in Fig. 35, which indicates they are all inherited from Man’s parent class Person. Also note that because Man is a subclass of Person, its Superclasses table contains the entry Person.
Browsing an Individual Identifier in the Editing Window
An individual identifier has individual content such as types or individual properties. In the taxonomy window, click the > or expand button next to Man to show a list of individuals of this class. Then click individual Eric to see the Individual Properties table in the editing window, as shown in Fig. 36. Among the properties shown are Eric’s birthDate, Eric’s spouse, etc. Also shown in the editing window is the Types table containing direct and indirect superclasses which Eric is an individual instance of.
Browsing with Hyperlinks in the Editing Window
Blue color links in the editing window, e.g. Person in Fig. 36, are hyperlinks. When clicked, the hyperlink is put into focus. It becomes highlighted in the taxonomy window, and the editing windows shows the details of the hyperlink.
After clicking a hyperlink, the backward button located at the top of the taxonomy window, as shown in Fig. 37, can be used to return to the previous view. The KB Editor keeps a history of current identifiers, and the backward and forward buttons are convenient tools to re-establish previous browsing context. There is also a Refresh button to clear browsing history. Since this button automatically recomputes and redraws the taxonomy tree, it is handy to have for refreshing the taxonomy view.
Browsing with and without Inferred Properties
The Inferred option in the KB Editor, when checked, shows properties in the editing window whether or not they are editable. On the other hand, when this option is unchecked, only properties which are editable are shown.
An inherited class property is editable only when the class it is asserted in is selected, and the assertion is in the current file. For example, with Man selected in the taxonomy window and Inferred unchecked, as in the case shown in Fig. 38, the KB Editor editing window shows an empty Class Property table for Man. This is because all of Man’s class properties are inherited from class Person. Class Person must be selected in order for these properties to be editable.
For another example, with family.flr loaded, expand class Person and subclass Man to show all the individual instances of Man. Click to select individual Peter. An uneditable birthDate property is shown in Peter’s Individual Properties table, as shown in Fig. 39. This is because Peter’s birthDate property is not asserted in the current file family.flr.
Uncheck the Inferred option and the birthDate property disappears from the editing window, as seen in Fig. 40. Since Peter‘s birthDate is not asserted in the current file family.flr, it is not editable and therefore not shown when Inferred is disabled.
To edit Peter’s birthDate, either follow the hyperlink Peter.flr in the editing window, or double click Peter.flr in the navigation tree to make it the current file. Expand Man and select Peter in the taxonomy window. Then Peter’s birthDate property will be shown as an editable property in the editing window, as shown in Fig. 41.
Browsing with and without Missing Properties
By default, the Missing option is enabled in the KB Editor to show properties which are considered missing. Missing properties include properties not yet assigned values, and properties which have assigned values but not yet reached their maximum cardinalities. We will give examples of both types below.
When the Missing option is enabled, as shown in Fig. 42, the Individual Properties table for Eric includes a few properties with ? in the Value column. These are the missing properties for Eric. Address, height and hobby are considered missing because Eric has not yet been assigned an address or a height or a hobby. Now consider the property child with a ? in its Value column. It is a missing property for the reason that the child property has a cardinality of any positive number. Although Eric already has one child Isobel, his child property has not reached its maximum cardinality. Therefore we see an extra child entry in the table to allow more children to be added to Eric. The property spouse, on the other hand, has cardinality one. We don’t see an extra spouse entry in the table because this property has already reached its maximum cardinality with the one assigned value, namely Emma.
Uncheck the Missing option to disable missing properties from being shown in the KB Editor. All missing properties mentioned above for Eric are now removed from the Individual Properties table, as shown in Fig. 43.
Performing Search in the Taxonomy Window
Search for selected identifier makes use of the KB Search plugin to search for all occurrences of the selected identifier. Expand class Person and subclass Man. Click identifier Chris, and then click the Search selected identifier icon as shown in Fig. 44. Search results are returned automatically via the KB Search window, as shown in Fig. 45.
Browsing Queries and Rules
In the KB Editor taxonomy window, click the expand button to the left of Latent Queries, as shown in Fig. 46, to reveal the list of latent queries defined in family.flr.
In the expanded list of latent queries, click one of the queries, e.g. ’What is Otavios birthdate?’. The editing window will display the file in which the query is defined. The same query will also be automatically highlighted in the Text Editor, as illustrated in Fig. 47.
Click the > or expand button next to Rules to reveal the list of rules defined in family.flr. Click one of the rules, e.g. olderThan(?Age1,?Age2). The editing window will display the rule definition and the file in which the rule is defined. The same rule will also be automatically highlighted in the Text Editor, as illustrated in Fig. 48.