DATABASE RELATIONS

Databases can be related to each other in various ways, allowing to construct hierarchical multidimensional database systems. It is often quite convenient to store information in several files from which it can be easily retrieved when needed.

STARLING provides following mechanisms of interrelating database files.

  1. You can use the Update option in the Assist menu (see UPDATE) to transfer the contents of some field from one database into another.
  2. You can have reference fields in your database, relating it as a whole to some other database.
        By default, if the database has a field whose name coincides with the name of another database present in the current directory, this field serves as a reference field to that database. E. g., a field GERM in germanic.dbf will refer to a file germ.dbf (if it exists). When you press F7 while positioned within GERM, you will be transferred to a record within germ.dbf containing the value of the field GERM in germanic.dbf. This is a very rough method of relating files: you might not always retrieve the information you need, because only exact matches between files are in this way accounted for. A more precise and recommended method is using numeric references.
        If the field GERM in germanic.dbf is numeric, it can contain direct references to record numbers in germ.dbf. These references can be either inserted manually or obtained by using the Update command (UPDATING using some common field and replacing the field GERM by RecNo()).
        You can also keep the field GERM in germanic.dbf as character or variable, but still be able to interlink the files precisely. To do that you have to introduce an additional numeric field with the extension REC, in this case GERMREC. Its contents will also be directly linked to record numbers in the germ.dbf file.
        Other examples of database relationships:
        If you have, e.g., a germ.dbf file you may relate it to the subordinate file eng.dbf by introducing a field called ENG within the germ.dbf. If you place the cursor on the contents of the field ENG and press F7, the file eng.dbf will be automatically searched for the identical string value; if found, the respective record will be dis- played in a special screen window. You may then press F4 to search for the next similar entry. You may use Alt F7 instead of F7, to search not for the whole field contents, but only for the word under the cursor. E.g., if you have a file germ.dbf with a field ENG and a record "water" in it, pressing F7 will activate the search for "water" in the subordinate file eng.dbf. There may be several occurrences of that word in the file eng.dbf, but F7 will bring you to the first one (to move to the next one you will have to press F4, as usual). If you, however, introduce a numeric field ENGREC in the file germ.dbf, you may place there the precise record number you need in eng.dbf; pressing F7 in the field ENGREC will instantly activate the record you need in the file eng.dbf.
        This is the default mechanism of relating database files. For etymological databases a special sophisticated system of file relations is designed in STARLING - see the sections on COMPARATIVE STUDIES, ENTERING GLOTTOCHRONOLOGICAL DATA, CREATING SPECIAL FILES.
        Related files do not necessarily have to have names coinciding with field names in linked files. You can link files with different names and in different directories, overriding standard conventions for both regular files and etymological files. To do that you must edit the contents of the .inf files. Again, if you have a germ.dbf with a field ENG, but your English file is called english.dbf, you may edit germ.inf and insert the line: ENG = ENGLISH
        If the english.dbf is located in a different directory, e.g. F:\ANGLAIS, the line should look like: ENG = F:\ANGLAIS\ENGLISH.
  3. You can use dynamic cross-reference hyperlinks between databases. This is a feature available starting with Star4Win 1.99.
        Hyperlinks are especially useful when you commit your files to the Web server, and wish to explicitly point out relations between databases. Any text sequence within any character or variable length field can be enclosed into the sequence \X....\x and be turned into a hyperlink. So far there are two types of hyperlinks:
         a) Global hyperlinks referring to databases listed in the main configuration file, config.str. The list of referrable databases should be contained in config.str, with the following syntax:
    LOOKUP = database1 [, field]; database2 [, field];...;database9 [, field]
          Links to these databases are configured as: \X1....\x (a link to database1), \X8...\x (a link to database8) etc., and are accessible from any database file.
         b) Local hyperlinks referring to databases listed in a particular .inf file, with the syntax:
    LOOKUP[n] = database
          Links to these databases are configured as: \Xn....\x. A link can refer to a database generally, in which case a dynamic search of the referred database is performed; or as a link to a particular database record. In the latter case the link should be configured as \Xn1.n2...\x, where n1 is the number of the database referred, and n2 is the number of the record within the referred database.
    Note that \X0...\x is always a link to the current database.
          The list of lookup databases can be manually entered into the general configuration file (config.str) and into individual .inf files. An interface for doing it is, however, also provided through the Configuration option of the Assist menu and through the File configuration option of the File menu.
          Links can be entered manually in text mode, but there is also an interface for entering them. Any text sequence can be selected, and the Hyperlink option chosen from the Format menu (keyboard shortcut is Ctrl [; or press Shift Ctrl [ to automatically select the current word for hyperlinking). In the resulting menu dialog, check the Apply link formatting box - after which you will be able to choose from a list of either global or local referrable databases.
          The hyperlinked text sequence will be highlighted and the link will be activated by pointing the mouse on it in the edit window and clicking the left mouse button. Clicking the right mouse button will activate the menu dialog once more. You can then either change the reference parameters or remove the link by unchecking the Apply link formatting box.