Script Editor Tutorial

Open the demo Knowledge Base. This Knowledge Base should already have concepts and features, but no scripts.

Open an Object Browser and a Feature Browser. The Object Browser is used to access the scripts associated with concepts and the Feature Browser is used to access the scripts associated with features.

In the Object Browser go to the concept PhD_Student and press the Script button. This opens the Script Editor on that concept.

Press the New button under Controls. This creates a new control with all the fields initially empty.

Enter the question and the variable name. To add the second line of the question press the New button under Question.

Press New under Ontology actions. Start typing the variable name in the first field.

Press Control and Dot. This opens the finder.

Select the variable name from the finder.

Enter the feature name in the second field and the concept name in the third field. Use the finder for each of them. From now on, use the finder each time you have to select one of the existing variables or to enter a concept or a feature.

Press New under Script calls and use the scroll bar to scroll down if necessary.

Check the “in new window” box and enter the instance name and concept name.The folder name optional. In this example, because the folder name is left blank, the folder name will be the instance name. In this case the concept name is also optional, and if it not specified the instance is considered to have the same single direct superconcept throughout the execution of the Scenario Elicitation module. It is a good practice, however, to always specify the concept name.

Press New under this script call and use the scroll bar to scroll down if necessary.

Click on the drop-down-box near “Call the script for” from the newly added script call.

From this drop-down-box select “eliciting instances of a concept”

Check the “in new window” box, enter the folder name, and enter the concept name.

Press the Save button at the bottom of the Script Editor. This saves the changes made to the current script selected from the drop-down box at the top of the Script Editor (“eliciting instances of PhD_Student.”)Without pressing Save, the information entered is lost. Check the “is root” box at the bottom of the Script Editor. This specifies that this script will be the root folder in the Scenario Elicitation.

Click on the drop-down box at the top of the Script Editor. Notice that “eliciting instances of PhD_Student” is in bold. This means that the script is defined, as opposed to the other scripts from the list that are not defined.

From the drop-down box select “eliciting properties of an instance of PhD_Student.”

Press New under Controls. Click on the drop-down box next to “Control type.”

From the drop-down box select label. Click on the New button next to Text to create two lines and enter the text in them. Remember to use the finder for the variable name.

Enter a script call as below and save this script.

In the Feature Browser, go to the feature is_interested_in and press the Script button, to edit the script that you just referred to in the script to elicit properties of an instance of PhD_Student.

Enter the control and the ontology actions as below.

Enter the script call as below and save this script. This combination of a control with a default value, followed by ontology actions of this form, and followed by a script call for the instance created, is typical for features whose range is a list of concepts.

In the Object Browser, go to the concept PhD_research_area. The Script Editor in the right will be updated to reflect the scripts of this concept.

Select, define, and save the script to elicit superconcepts of an instance of PhD_research_area as below. The question “Indicate the <phd-research-area-name>:” makes sense if you think that the value of the variable <phd-research-area-name> will be an instance name of the form “Domain_of_interest_of_Bob.” By selecting the radio button Elementary, you specify that the list of options will contain all the concepts under PhD_research_area (not necessarily directly under it), that do not have any subconcepts.

In the Object Browser, go to the concept Faculty_member and edit the script to elicit instances of Faculty_member. Enter the control and the ontology action as below.

Enter the script calls as below and save this script.

Define and save the script to elicit properties of an instance of Faculty_member as below.

In the Feature Browser, define the script to elicit values for the feature is_expert_in as below. Notice the script is very similar with the script defined for the feature is_interested_in, and it even calls the same script, to elicit superconcepts of an instance of PhD_research_area.

In the Object Browser, edit the script to elicit superconcepts of an instance of Faculty_member and define a control as below.

Also define the ontology action and the script call as below and save the script. Notice the concept name is the value of the variable <answer>. This is a simple way to call different scripts depending on the answer to a question.

Define and save the script to elicit properties of an instance of Tenured_professor as below.

Define and save the script to elicit properties of an instance of Tenure_track_professor as below. You do not need to define the script to elicit properties of an instance of Visiting_professor. From the point of view of the Script Editor/Scenario Elicitation if a script does not exist it is considered empty. Accordingly, if you press Save in the Script Editor on and empty script, it will be deleted.

In the Feature Browser, define and save the script to elicit values of the feature is_close_to_retirement for an instance, as below.

Define and save the script to elicit values of the feature is_likely_to_get_tenure for an instance, as below.

The definition of the scripts for the demo is now complete. Open the Scenario Elicitation module and enter information about the student and the potential advisors.

To see a report of the questions and the answers given in the Scenario Elicitation, use the Reports button from the bottom. The report is in HTML format.

To see a report of the elicitation scripts defined above, use the Elicitation Scripts option from the Reports menu. The generated report contains a list of all the elicitation scripts from the Knowledge Base, ordered by the type of object to which they are attached (concept or feature), by the name of the object, and by the script type. The report is in HTML format.