Building a botanical tree of wood

Building a botanical tree of wood

am 05.02.2009 16:44:43 von Bill Mudry

--=====================_6898828==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Greetings to all,

I was subscribed a couple years ago to this group and got busy with
other priorities until recently. Since then, I have learned more PHP,
at least to the point that I do get things to work at times but not a
proficient coder yet.

In another strong interest and endeavor, I have spent about 7 years
researching (via books, Internet, etc.) and recording as many woods
and woody plants of the world as I can. I started with a text file
and this has grown to a massive 5.8 meg. plus in size (over 151,000
lines!). My research will not stop so, with such a huge knowledge
base, the longer I wait for a conversion over to a database driven
receptacle for
all this data, the more horrendous will be the job of hand bombing
all that data into the new PHP/MySQL application. There is, therefore,
a certain urgency to finally build this knowledge base repository.
For ease of conversation, I nicknamed the file my TAXA (short for
"Taxonomy") and thereby the name also for the research project.

There are 4 levels of organization with each level in a one to many
set of relationship --- like a large upside down tree structure. The
names of these levels are the same as used in scientific naming of
living things, namely order, family, genus and species. Anyone
who has taken any biology or botany will probably quickly relate to
this. Eventually, I wish to be able to travel up and down this data
tree and be able to display recorded information for each element
stored. For now, I will be content to be able to travel from highest
level (ie. order) all the way down to showing details of individual species.

I had a number of months where priorities took me away from all this
but I am back in earnest determined to get this done.
At each level, one element has its information displayed with all
relevant subservient elements listed below so you can click on one and
proceed down to the next level and show the details on that element
(and on and on right down to the species level that has the most
details for any level -- even photos of what that wood looks like
when available). As we drop down from Order to Species, the number of
elements grows exponentially:
Woody Orders - about 95 --------> Woody Families
Woody Families - about 435 -------> Woody Genera (singular: "Genus" )
Woody Genera - over 3,300 --------> Woody Species
Woody Species - 10,000 and more.

Even at the top Orders level, it makes sense to have the data show in
columns and pretty much mandatory any place below this. In my
prior efforts before I had to break off for a spell (... months ago),
I actually was able to write code that would count the number of elements
in a table and make columns of proper length. I wasn't quite be
successful in populating data properly in those columns from table
---- close but no bananas (or --- err --- should that be woods).

If you got this far reading, much thanks. I know this may seem a bit
long winded but at least you will know just where I am coming from.
With that behind, now I can ask some questions that might help:
1 - Does anyone have code that can read names from a MySQL
table and present it in columns?
2 - Each element displayed is not just static text. Clicking
on one would look up data on it and display it (numerous fields).
3 - Then the format as in #1 displays the elements
subservient below that --- all the way from order to finally full details of a
wood at species level.

Any code suggestions? This all needs to be dynamically reading data
from MySQL tables, displaying it and then letting a user choose
from a list an element in the next lower level (except species ---
end of the line). I am reasonably convinced that the code can be similar
at the different levels and can be largely modularized and semi
repeatable at each level.

Hope I didn't scare everyone away with such a long introduction ;-) .
I look forward to seeing what you have to say.

With thanks in advance,
Bill Mudry
Mississauga, Ontario Canada








--=====================_6898828==.ALT--

Re: Building a botanical tree of wood

am 05.02.2009 17:43:50 von Trevor Gryffyn

First, "in the meantime" while deciding on how to do this in a database
fashion, you should at least be trying to store your data in a
spreadsheet or some other format that can be easily imported into a
database.

In the past, I've done this with Excel or other spreadsheets.. or even in a
text file that's formatted in such a way that you can either write a PHP
script to import or even turn the text file itself into a PHP script that
generates the INSERTs and such.

Using a text editor like Crimson Editor, you can create macros to easily
transform thousands of lines of data into PHP code or something useful.
Just hit RECORD, perform the predictable edits you'd need to do on a few
lines. Stop recording. Then just hold down the macro key that executes
the actions. Take a nap until it's done. Release keys. hah Yeah,
crude, but it's come in very handy a few times.


On to coding... since what you're doing is fundamentally simiar to a
family tree and since that's a more common application, you might look
into some of the apps already made that handle people's family trees.
There's a family tree data format called "GEDCOM" you might look into and
there's at least one free PHP based family tree app called PHPGedView:
http://www.phpgedview.net/


If you really wanted to roll your own, then you could also research methods
of handling threaded conversations like on message boards, since that's
going to be a similar algorithm.. with parent and child messages/data
which also allows sibling messages (children of same parents).


Good luck, however you plan on executing this. I know I didn' answer your
questions directly, but I think some of these suggestions may indirectly
answer the questions. :)

-TG

----- Original Message -----
From: Bill Mudry
To: PHP Windows Forum
Date: Thu, 05 Feb 2009 10:44:43 -0500
Subject: [PHP-WIN] Building a botanical tree of wood

> Greetings to all,
>
> I was subscribed a couple years ago to this group and got busy with
> other priorities until recently. Since then, I have learned more PHP,
> at least to the point that I do get things to work at times but not a
> proficient coder yet.
>
> In another strong interest and endeavor, I have spent about 7 years
> researching (via books, Internet, etc.) and recording as many woods
> and woody plants of the world as I can. I started with a text file
> and this has grown to a massive 5.8 meg. plus in size (over 151,000
> lines!). My research will not stop so, with such a huge knowledge
> base, the longer I wait for a conversion over to a database driven
> receptacle for
> all this data, the more horrendous will be the job of hand bombing
> all that data into the new PHP/MySQL application. There is, therefore,
> a certain urgency to finally build this knowledge base repository.
> For ease of conversation, I nicknamed the file my TAXA (short for
> "Taxonomy") and thereby the name also for the research project.
>
> There are 4 levels of organization with each level in a one to many
> set of relationship --- like a large upside down tree structure. The
> names of these levels are the same as used in scientific naming of
> living things, namely order, family, genus and species. Anyone
> who has taken any biology or botany will probably quickly relate to
> this. Eventually, I wish to be able to travel up and down this data
> tree and be able to display recorded information for each element
> stored. For now, I will be content to be able to travel from highest
> level (ie. order) all the way down to showing details of individual
species.
>
> I had a number of months where priorities took me away from all this
> but I am back in earnest determined to get this done.
> At each level, one element has its information displayed with all
> relevant subservient elements listed below so you can click on one and
> proceed down to the next level and show the details on that element
> (and on and on right down to the species level that has the most
> details for any level -- even photos of what that wood looks like
> when available). As we drop down from Order to Species, the number of
> elements grows exponentially:
> Woody Orders - about 95 --------> Woody Families
> Woody Families - about 435 -------> Woody Genera (singular:
"Genus" )
> Woody Genera - over 3,300 --------> Woody Species
> Woody Species - 10,000 and more.
>
> Even at the top Orders level, it makes sense to have the data show in
> columns and pretty much mandatory any place below this. In my
> prior efforts before I had to break off for a spell (... months ago),
> I actually was able to write code that would count the number of elements
> in a table and make columns of proper length. I wasn't quite be
> successful in populating data properly in those columns from table
> ---- close but no bananas (or --- err --- should that be woods).
>
> If you got this far reading, much thanks. I know this may seem a bit
> long winded but at least you will know just where I am coming from.
> With that behind, now I can ask some questions that might help:
> 1 - Does anyone have code that can read names from a MySQL
> table and present it in columns?
> 2 - Each element displayed is not just static text. Clicking
> on one would look up data on it and display it (numerous fields).
> 3 - Then the format as in #1 displays the elements
> subservient below that --- all the way from order to finally full details
of a
> wood at species level.
>
> Any code suggestions? This all needs to be dynamically reading data
> from MySQL tables, displaying it and then letting a user choose
> from a list an element in the next lower level (except species ---
> end of the line). I am reasonably convinced that the code can be similar
> at the different levels and can be largely modularized and semi
> repeatable at each level.
>
> Hope I didn't scare everyone away with such a long introduction ;-) .
> I look forward to seeing what you have to say.
>
> With thanks in advance,
> Bill Mudry
> Mississauga, Ontario Canada


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Building a botanical tree of wood

am 05.02.2009 19:52:39 von Bill Mudry

--=====================_18371062==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Thanks for writing :-) .

At 11:43 AM 2/5/2009, you wrote:
>First, "in the meantime" while deciding on how to do this in a database
>fashion, you should at least be trying to store your data in a
>spreadsheet or some other format that can be easily imported into a
>database.

I started with text because you do not have the limitations of having to have
exact places for everything like you do with set fields. At first, I
wasn't even
sure what I needed. That is a long time ago now and I am now much more
set on what fields I need and in what order. Surprisingly, there are still
times when it comes in handy to be able to place something wherever I
want. I realize this has have stricter rules for a database driven system.

I have files in Excel and MySQL already (ie. back end files)
but not the code that ties it all together (front end) into a nice seamless
application that makes it easy to actually travel up and down the tree.
At one point, I had a friend who liked programming in File Maker and I
started coding with that ---- until I found the unreasonable and expensive
costs of hosting many files with this language.

The MySQL files are not small and are *certainly* large enough to use for
the system development. The TAXA file is still, by far, the most complete
knowledge base. I recently used a text search tool to extract out the
most recent list of Orders, Families and pretty much Genera. The
species level is just too large to bother cleaning up any list of species
right now. I would just as well care to spend that time in coding the
permanent storage and viewing application instead, ready to add in
all species once and for all.

For general viewing and maintenance of my MySQL files, I love using
phpMySQL. I foresee it being even more useful for generating SQL
statements and a shortcut to PHP code for this, too. So, I hope this
helps show that I can already view a lot of this data but only file by
file (level by level), I have decided that I should shift my emphasis
largely to:

- Get the botanical wood tree working first including easy travel
between levels for viewing data only. That alone is quite a
bit of work.

- With that done, work on an administrative panel to add, delete
and change data. Only then can I start the huge job of updating
all the data in the TAXA file into the MySQL files.


>In the past, I've done this with Excel or other spreadsheets.. or even in a
>text file that's formatted in such a way that you can either write a PHP
>script to import or even turn the text file itself into a PHP script that
>generates the INSERTs and such.

I have managed to get some data out from the TAXA file but it just is NOT
structured strict enough to be effective to use most scripts to extract a
high percentage of content and definitely not organized so orderly as to
be able to use any script imaginable to port the whole works over into
Excel, MySQL or any other format. I can and have done a lot to extract
out Orders, Families and Genera and, with more time to clean up the
Species extraction, update all these for names only, not attenuating
data for each.

The change over from still using text to being totally database driven could
not happen till I have a versatile user interface for managing all present and
future data.


>Using a text editor like Crimson Editor, you can create macros to easily

I use Crimson Editor sometimes, too. Every try NoteTab? Its got a lot of
good qualities and capabilities

>transform thousands of lines of data into PHP code or something useful.
>Just hit RECORD, perform the predictable edits you'd need to do on a few
>lines. Stop recording. Then just hold down the macro key that executes
>the actions. Take a nap until it's done. Release keys. hah Yeah,
>crude, but it's come in very handy a few times.

(Partial merit but it could introduce too much data error.)

Back to my original present request. I need the working wood tree first
before it is worth trying to change over all that data in TAXA.

>On to coding... since what you're doing is fundamentally simiar to a
>family tree and since that's a more common application, you might look
>into some of the apps already made that handle people's family trees.
>There's a family tree data format called "GEDCOM" you might look into and
>there's at least one free PHP based family tree app called PHPGedView:
>http://www.phpgedview.net/
>
>
>If you really wanted to roll your own, then you could also research methods
>of handling threaded conversations like on message boards, since that's
>going to be a similar algorithm.. with parent and child messages/data
>which also allows sibling messages (children of same parents).

Interesting thoughts --- although the parallel exists only to a point. Also,
I might muse ...... which is faster, studying a lot of code for what are other
applications or working on coding for the real need. I actually do have some
past code of a botanical tree that I am studying, too.

I had a complete system crash (not even a visible Windows directory!) last
month. I am finally back up but with all kinds of havoc to my old files.
This work is not for a paying client and I am looking for work, far from being
retired, so time can be limited and spotty on when I can work on my TAXA
project. My presence could be of necessity spotty at times. I will be
concentrating especially when I do have time on my original requirements of:
- Listings at any one level allowing to choose one
- Displaying data on that item
- Down the page, listing the next level elements that map to
that parent
item
- Each of these being active to go down to repeat this process at the
next lower level.

Once I get that far, I will be a long ways closer to actually getting
that tree made
and operational.

Best regards to all,

Bill






>Good luck, however you plan on executing this. I know I didn' answer your
>questions directly, but I think some of these suggestions may indirectly
>answer the questions. :)
>
>-TG


--=====================_18371062==.ALT--