Re: Relational/hierarchical data problem

From: Neo555 <member15981_at_dbforums.com>
Date: Wed, 26 Feb 2003 21:40:45 +0000
Message-ID: <2579196.1046295645_at_dbforums.com>


An initial solution using an aidb is posted at www.xdb1.com/Example/Ex075.asp which includes downloadable software. The solution uses the following data structure:

T_Goat
 Name
 Gender
 Weight
 Birthdate

The aidb is currently populated with 200 goats total (40 goats in each generations, a total of 5 generations). The goats are currently named g0 to g199 and can be renamed. Because the data was created programatically, currently all the even goats are male and the odds are female. And g0 and g1 parent g40, g2 and g3 parent g41, etc. The exact relationships can be seen either in the aidb's interface or in Ex075.txt which has the declarations used to create the database.

To view the data, run xdb.exe and open file Ex075.xdb via the File Menu. It is possible to view all descendants and/or ancestors of a goat in the tree simply by expanding nodes and selecting the appropriate relationship type filters from the View Menu. By default a thing's children are displayed in the tree. A gray ball-shaped icon indicates a relationship type to a child. To view the parents of a thing, check Parent in View Menu. A yellow ball-shaped icon indicates a relationship type to a parent. You may initially want to limit viewing either parents or children of goats to avoid confusion. All goat instances and their properties can be viewed in the grid by selecting goat in the tree. Property values in the tree or grid can be edited via the drop-down list. To resize the grid/tree, click in the slim area between the application border and the tree or grid.

To create the Consanguinity Report, select the tree node labeled 'goat' and right-click. Select 'Generate Consanguinity Report'. Verify the dialog box states 'Generate Consanguinity Report for goats' and click OK. The below report is written to a tab-delimited text file named goat.txt in the same directory as the database file. It can be imported in Excel or Access for further maninpulation.

Consanguinity Report for goats
goat goatX CmnAnc Dist
g0 g1 na 0
g0 g2 na 0
g0 g3 na 0 Received on Wed Feb 26 2003 - 22:40:45 CET

Original text of this message