Difference between revisions of "Modeler:Tutorial/Editing Information Grammar"
m |
|||
Line 28: | Line 28: | ||
= Changing the properties of an object/fact type = | = Changing the properties of an object/fact type = | ||
1. Classify and qualify the fact expression: ''4 students live in New York'' as shown below: | 1. Classify and qualify the fact expression: ''4 students live in New York'' as shown below: |
Revision as of 15:17, 23 March 2021
In this lesson you will learn how to change information grammars. (Using the information grammar you have created in the previous lessons).
Renaming an object/fact type
1. Click on Student in the Repository window.
2. Open Students' popup-menu and select Rename (or press F2).
3. Overwrite Student with Apprentice and press Enter.
4. Open the Edit menu and select Undo Rename Student (or press Ctrl+Z).
Removing an object/fact type
1. Click on Apprenticeship in a Diagram.
2. Select Task\Delete from it's popup-menu (do not press OK after that!):
The fact types Apprenticeship Description, Apprenticeship City, Assigned Apprenticeship and Apprenticeship Preference contain roles played by Apprenticeship. By deleting Apprenticeship these roles would become obsolete. Therefor these fact types will be removed along with Apprenticeship. By removing these fact types the label type description becomes useless... etc. Nearly the complete information grammar would be removed.
3. Click Cancel to prevent the deletion of Apprenticeship!
A similar Delete from the IG Repository would prompt a different and more fine grained popup-menu. It'll allow you to delete a single expression either locally or the entire expression grammar, or the entire Object/Fact-Type.
Changing the properties of an object/fact type
1. Classify and qualify the fact expression: 4 students live in New York as shown below:
2. Select the fact type Number of students in city in the IG Repository.
3. Select Edit from its popup-menu and click Derivable: You could supply the derivation rule in the comment.
4. Click Roles:
5. Select role 17.
6. Type in city in the Column Fix field.
7. Select Columnfix Type Postfix and close both windows by clicking Apply and OK.
8. Drag Number of students in city from the Repository window onto the diagram.
Note: The fact type is marked derivable with an * behind the fact type name. Role 17 has a postfix.
9. Open the Edit menu and select Undo twice. The Number of students in city should now have disappeared. If not, delete the Fact Type manually.
Changing the properties of a label type
1. Doubleclick on Preference number in the Diagram. This will select it in the Repository window. Use the context menu to edit it.
2. Select Edit from it's popup-menu:
You can adjust the datatype and value constraint in this window.
3. Click VC and enter the value constraint displayed below:
Note: Once you have a proper population the examples from this can be automatically inserted as value constraints using the populate button.
4. Click OK. The diagram should reflect the changes. If not, refresh the diagram by pressing Refresh (F5).
Reducing an object type
1. Click on City in the Repository window.
2. Select Reduce Object Type from it's popup-menu.
Note: Roles 4 and 8 are now played by city name and City has been removed.
3. Click on city name in the diagram.
4. Select Task >> Transform to Object Type from city names popup-menu:
5. Enter 'City' as the new object type name:
6. If not visible, drag the OT City into the diagram. The result looks like this:
Note: A totality constraint has been placed on roles 4 and 8 (black dot). A uniqueness constraint has been placed on the role of City (double arrow).
The Transform to Nominalized Fact Type option is also available from the Repository window popup-menu. If you would have chosen this option, the object 'City' would not have been placed automatically on the diagram.
Changing an object/fact type expression
1. Make sure the right section of the Repository window is visible and the OTL tab is activated.
2. Click on City in the IG Repository.
3. Click on object type expression O4 (in the right section).
4. Select Edit from the popup-menu of O4.
5. Change O4 als shown below:
Note: All fact type expressions in which O4 is substituted will change when regenerated.
E.g.: the Fact Type City Of Residence:
Replacing an object type expression
1. Open the Repository menu and select New Expression.
2. Make sure Create OTE is enabled.
3. Enter the object expression student Johnson, Peter and qualify this expression as Student. Click No Match!
4. Classify and qualify firstname and lastname:
5. Click on Student in the Repository window. Click on object type expression O1 in the right section of the Repository (the Object Type Level).
7. Select Replace from the popup-menu of O1. Select O5 from the appearing window:
Verify the replacement of O1 by examining the expressions of 'Apprenticeship Preference' at the LL level.
8. Open the Edit menu and select 'Undo Replace O1'.
9. Repeat this for 'Undo New Expression: student Johnson, Peter'.
Adding population to a fact type (expression)
Step 13
1. Make sure the LL tab is activated in the Repository window.
2. Click on 'Assigned Apprenticeship' in the IG Viewer, then click on fact type expression F7.
3. Select Edit Population from the popup-menu:
4. Click Add and add the tuple shown below:
5. Click Ok.
Note: Population has been added to 'Student', 'Apprenticeship' and 'Assigned Apprenticeship'.
Using expression files
Step 14
1. Open the File menu and select Open, then open the file '...\CASETALK\LESSONS\STEPS\LESSON.EXP'.
2. Open the File menu and select Save Expression File as. Save the file as '...\APPRREG\APPRREG.EXP'
The structure of expression files
An expression file is an ASCII or ANSI file. The first line of an expression file contains the text [EXPFILE, WIN] for ANSI files or [EXPFILE, DOS] for ASCII file. After this line the name of the first object type or fact type is placed between []. Below this line you will find the expressions for this object type or fact type. These lines are followed by the second object type or fact type etc. Comment lines can be added by starting the line with a ';'.
It is possible to select multiple lines of an expression file at the same time (for classification and qualification by the casetool). CaseTalk will try to classify and qualify the expressions using automatic matching if possible. As a result the user interaction will be minimized.
3. Click on the first line of the expression file. Hold the shift-key and press the end-key.
4. Click Qualify.
The casetool will start to classify and qualify the selected expressions. The automatic classification and qualification will stop at the fact expression 'There is a student Jan de Groot' (Which is a Dutch student).
5. Click Match:
The casetool has stopped automatic classification and qualification because it cannot determine whether the 'first name' is 'Jan' or 'Jan de'. It suggest the fact expression matches with 'Student ':
6. Click Next.
As a result the 'first name' would become 'Jan de'.
7. Click Next again.
Now the 'first name' will be 'Jan'.
8. Click Accept, then click Ok.
The automatic classification and qualification will continue. It will stop again for the fact expressions of Apprenticeship Preference. You can just match these expressions and continue. (This confirmation is the result of a very subtile limitation in the current match engine).
The diagram will now list multiple tupels for each object type / fact type. To configure the displayed number of tupels, select Properties from the Diagram Designer's popup-menu.
9. Select the expressions for Apprenticeship Description and press Qualify.
This will add the population into the model without any questions.
10. Close the Expression File window. (It is ok to save the changes).
Changing the population of a fact type (expression)
Step 15
1. Click on 'Apprenticeship Description' in the IG Viewer, then click on fact type expression F5.
2. Select Edit Population from the popup-menu of F5.
3. Click on the tupel with apprenticeship 'S200'.
4. Press the tab-key, then correct the word 'develoment':
5. Click Ok.
This typist's error should also corrected in the expression file. You can edit the expression file by selecting it in the Project Manager and select Text Edit from it's popup-menu.
Regenerating fact (type) expressions
Step 16
1. Open the Project menu and select Generate Expressions:
2. Make sure all options are set as displayed above, then click Save.
3. Enter '...\APPRREG\APPRREG.TXT' as the filename.
4. The regenerated file will be opened directly in the Windows registered text file editor and is automatically added to the project.
5. Open the File menu and select Save Project.
Note that the selected expressions may be limited if you use the 'selection' drop down box.
Back: Information Grammar Diagram
Next: Constraints