Navigation in Object-Relational Database

Feature of relational database, simple and dynamic table views of the massive data, is known. Generalization (structurization considering class inheritance), important distinction of object-oriented approach, is possible now and for database systems. This article illustrates benefit of combination both relational and object-oriented methods for Z database navigation.

1. Basic features of Z tables

Following table is the view of the DS.tab file in the demo/Common example directory. First field is used for the key object, next fields - for it's attributes. The records are separated by new line (\n) symbol, fields by colon (;), field values by comma (,). The URL reference may be specified for the key object by means of the $HRef field. This reference is accessible only from Web browser if Sav ZServer navigator is used (not Sav ZBase navigator).
demo/Common/DS.tab
database system   ; vendor            ; platform            ; query language; price; $HRef
Sav ZBase 2.0     ; Technopoles-M,Anet; Java                ; Zigzag        ; 99
Sav ZServer 1.0   ; Technopoles-M,Anet; Java                ; Zigzag        ; 199  ; "../savzs/demo/Pages/1.html"
SQL Server 6.5-5  ; Microsoft         ; Win 95,Win 98,Win NT; SQL           ; 1200
SQL Plus 8.0 Win95; Oracle            ; Win 95,Win 98,Win NT; SQL           ; None
Key object in first field is properly primary key, it may be coded by number, #1, #2 , . For example:
database system; name      ; version
#1             ; Sav ZBase ; 2.0
If field text has special symbols, particularly one from the $ * # " ' [ { ( ] }] ) . ^ : / | \ ~ = , ; < > , field text should be enclosed in the quotes. Sav Z navigators will generate interface (with following possible views for SavZServer or SavZBase) on the basis of this tabular data imported into Z database.

Note: Other fields (not only key) may be used as URL reference during Web navigation if have value like this: "http://...".

2. Generalization

Client navigates in database by means of selecting the wanted attribute values. Big list of values, for example prices, complicate matters. It needs to split the above table (DS.tab) into a few parts, for example personal DBMSs (DS1.tab) with price '<199', and DBMS servers (DS2.tab) with price '>=199'.
demo/Advanced/DS0.tab
database; price
personal; '<199'
server  ; '>=199'
demo/Advanced/DS1.tab
database:personal; vendor            ; platform; query language; price; $WebPage
Sav ZBase 2.0    ; Technopoles-M,Anet; Java    ; Zigzag        ; 99
demo/Advanced/DS2.tab
database:server   ; vendor            ; platform            ; query language; price; $WebPage
Sav ZServer 1.0   ; Technopoles-M,Anet; Java                ; Zigzag        ; 199  ; "../savzs/data/page1.html"
SQL Server 6.5-5  ; Microsoft         ; Win 95,Win 98,Win NT; SQL           ; 1200
SQL Plus 8.0 Win95; Oracle            ; Win 95,Win 98,Win NT; SQL           ; None
The ':' symbol is used for setting class hierarchy. The objects (key fields) of "database:personal" (DS1.tab)  and "database:server" (DS2.tab) inherit the "price" attribute of the "database" (DS0.tab table).

Note: Better if new generalized values were represented in separate column with another name. For example:
database; relative price
personal; '<199'
server  ; '>=199'
So, in time of navigation, "relative price" may be used as source attribute to make request, but "price" as target requested attribute.

3. Database navigation

As result, after importing previous structured tables, Sav Z navigator generates more constructive dialog making virtual tables. For imaging the "database" objects that featured by the >= 199 price, we need to select in source list only one '>=199' value, not  199, 1200, ... The dialog (navigation) consists of the 4 phases.

1. Chose class of the target objects.
 
database
database:personal
database:server

2. Select names of the source attributes, for imaging its values.
 
database
platform
price
query language
vendor

3. Select values of the source attributes. Simultaneously select target attribute names defining structure of output table. Whole selection below equals SQL query: SELECT database, price FROM database WHERE (platform = 'Java' OR platform = 'Win NT') AND price >= 199. Key attribute (database) is output always.
 
Target attributes Source  values
database
platform
price
query language
vendor
platform:
Java
Win 95
Win 98
Win NT
price:
'<199'
'>=199'
99
199
1200
None

4. If Sav ZServer is working, choose target object and pass via its URL reference (server:Sav ZServer 1.0).
 
database price
server '>=199'
server:SQL Plus 8.0 Win95 None
server:SQL Server 6.5-5 1200
server:Sav ZServer 1.0 199

4. Zigzag expression in tabular data

Zigzag language simplifies making table files. The table field may be expressed by "= ..." request, "$..." variable, and "...*" abbreviation.

We can import the same tabular data that may be showed by distinct ways.
0. Simple table

development tool    ; language; platform                 ; feature
Visual Cafe 3.0 DDE ; Java    ; Win 95,Win 98,Win NT     ; visual components
Borland JBuilder 3.0; Java    ; UNIX,Win 95,Win 98,Win NT; visual components
1. Table with abbreviation
development tool    ; language; platform                 ; feature
Visual Cafe 3.0 DDE ; Java    ; Win 95,Win 98,Win NT     ; visual components
Borland JBuilder 3.0; Java    ; UNIX,Win 95,Win 98,Win NT; vis*
2. Table with variable
development tool    ; language; platform                   ; feature
Visual Cafe 3.0 DDE ; Java    ; $p1=[Win 95,Win 98,Win NT] ; visual components
Borland JBuilder 3.0; Java    ; UNIX,$p1                   ; vis*
3. Table with query
Suppose following table file was imported into database before.
tab/Advanced/DT1.tab
development tool    ; vendor   ; price
Visual Cafe 3.0 DDE ; Symantec ; 540
Borland JBuilder 3.0; Inprise  ; 299
We can use queries with familier attributes.
tab/Advanced/DT2.tab
development tool       ; language            ; platform                   ; feature
=(vendor:Symantec)     ; Java                ; $p1=[Win 95,Win 98,Win NT] ; visual components
=(:Inprise, price:299) ; =((vendor:Symantec)); UNIX, $p1                  ; vis*
Remark that column name defines class context of the field expression. The =(vendor:Symantec) expression of the development tool column will be really =development tool:(vendor:Symantec). The expressions are recognized row by row from left to right.