MANIPULATING KNOWLEDGE BASES

This chapter describes how to manipulate whole knowledge bases in Istar. It also describes the Preferences that can be read in. Some of the information is found also e.g. in sections on Panels.

OBTAINING A KB

There are at present two ways in which a KB can be obtained: create a new one or get (load) one from disk. Both these facilities are available on the Initial Control Panel, via the New and GetKB buttons respectively. For every KB you obtain a KB panel will appear, showing its name, and an Easel will be created.

To get (load, open) an existing KB, click the GetKB button. You will be asked to specify the name of the file holding the KB, normally by a normal ASL requester. When you start up, this requester will show a drawer assigned to 'KBTools:' if available, or whatever is your current drawer if not. Normally the KBTools drawer has within it a drawer called 'KBs' (knowledge bases) and normally your KBs are in this. Click it, and you should obtain a list of KBs. Double click on one of these, and it will be loaded and its easel opened. A panel will appear for this KB.

To create a new KB, click the New button. A new KB and easel will be created according to parameters available in the Prefs panel. If you do not want the default parameters, then you should bring up the Prefs panel (by clicking the Prefs button) before clicking the New button. The parameters you can change include:

Warning: Do not bring up more than two KBs with standard size Easel (30 by 24 inches) since three such Easels use up all your Chip memory, to the extent that you cannot even quit - because there is not enough Chip memory for the panel that asks you whether to quit or not!

CHANGING YOUR KB

Once you have a KB up and active, with a KB panel, you can:

To SaveAs, click the SaveAs button on the KB panel. You will be asked for a file name, usually with the ASL requester. If the file exists you will be asked whether to override it or not. If your KB has never been saved before, you will be asked whether to make this file the DiskVersion.

The DiskVersion of a KB is the disk file to which it is saved and from which it is loaded. It is the file to which the KB will be saved when you click the Save button. If the KB was loaded from an existing file then that file is the DiskVersion, but if it was created from New, it will have no DiskVersion. If you try to Save a KB with no DiskVersion it will tell you so: use SaveAs and make that file the new DiskVersion.

You can have previous versions of your KB kept if you wish. To do this, bring up the KB Area panel (click the 'KB Info' button) and click the gadget on the right hand side labelled 'Backup each save' so it shows a tick. From then on, any simple Save will rename the original file by appending date and time (yymmdd-hhmm) to its name, before saving the file. Note: with large KBs this is an excellent way of filling up your hard disk!

The KB Area Panel allows you to do other things and get detailed information on the KB. (See Panels for details of what information is available.) You use this panel for the following operations.

To rename a KB, bring up the KB Area Panel; its name is on the top row. Simply alter it and hit OK. Note: this alters only the internal name of the KB, not its DiskVersion file.

To resize a KB ... you should seldom need to do this since the KB grows automatically, and you should understand the concept of size of a KB. You can only resize from version 1.04 onwards. There are two parameters you can set and another that shows its actual size, worked out from those two. The main one you would need to set is the Expansion Percentage, which is the size of the main free space in the data structure area, e.g. 30%. The Min DSA is the minimum size when the KB is relatively young; the size is in longwords (1 LW = 4 bytes), e.g. 50,000. The actual size (in bytes) is shown below Min DSA on the KB Area Panel. To resize, simply alter Expansion Percentage and/or Min DSA, and hit the OK button.

WARNING: This facility can be a bit fragile and can cause a crash in version 1.04. This is because if the KB increases in size it moves in memory and therefore all the pointers into it must all be changed. If you have several panels up that relate to a KB, e.g. attribute details, relationship instance details, item types, etc. and increase the KB size while they are up, then the panel does not realise the KB has moved and when you click its OK button it stores information where the KB used to be. For this reason, before you attempt to resize you should close down all panels except that for the KB itself.

To resize the Easel of a KB, hit the Easel button on the KB panel, alter the figures as needed, and hit OK. The sizes are in 1/256ths of an inch (ca. tenths of a millimetre) for an unzoomed easel. Depth is the number of bit planes: 3 gives 8 colours, 4 gives 16.

To get rid of a KB, hit the Rid button on the KB panel. You will be asked whether you are sure.

PREFERENCES

When creating a new KB its size, the size of its main easel, and other parameters are set by Preferences, which can be accessed via the Prefs panel before hitting the 'New' button. But you can also set up an IstarPrefs file in the IstarSys: drawer, which will be read in when Istar starts up. This section tells you how to set up such a file; it is relevant only to version 1.04 onwards.

The IstarPrefs file contains a number of lines of text, each holding a number of CLI-type arguments. Normally (unless you are nesting these files; see below) the arguments can be supplied in any order and each that is given will override its previous value. If an argument is not given at all, the standard value is used.

The format is a list of keywords, most with an equals sign and a value after them, e.g. "W=640 NewKBName=MyKB". The keywords, most of which have an abbreviation, are:

  • NKB=NewKBName/k, - Name given to brand new KBs
  • KX=KBExpansion/k/n, - Percentage eXpansion for DSA
  • KZ=MinDSA/k/n, - Min DSA siZe in Longwords
  • MRL=MaxRingLength/k/n, - Maximum ring length in KBs

  • W=EaselWidth/k/n, - Width in pixels of main Easel
  • H=EaselHeight/k/n, - Height ditto
  • D=EaselDepth/k/n, - Depth as number of bit planes

  • BAFont/k, - Name of font to be used for labels on main easel
  • FHBA=BAFontHeight/k/n, - Its height in pixels
  • QnFont/k, - Name of font to be used for user question panels
  • FHQ=QnFontHeight/k/n, - Its height in pixels
  • DocFont/k, - Name of font to be used in documents
  • FHD=DocFontHeight/k/n, - Its height in pixels

  • PF=PrefsFile/k, - If this is given then this file is read

  • t_u/s, - Trace user action routines
  • t_m/s, - Trace module activity
  • t_e/s, - Trace easel routines
  • other/m, - A catch-all; ignore

    (/k means it expects to be followed by an equals sign and value, /n means that that value should be a number. /s means it is a switch.)

    The PF or PrefsFile argument supplies the name of a preferences file to be read. The arguments read from this file override any set prior to reading the file and are in turn overridden by any set after reading. Normally it will be on a line by itself. But if there are several other arguments in the same line then they are all applied after the file has been read, perhaps overriding any that were read in this file.


    Copyright (c) Andrew Basden 1997.