Skip to Content.
Sympa Menu

pcplantdb - [pcplantdb] README for version 0.1 of pcplantdb

pcplantdb@lists.ibiblio.org

Subject: pcplantdb

List archive

Chronological Thread  
  • From: Richard Morris <webmaster@pfaf.org>
  • To: pcplantdb <pcplantdb@lists.ibiblio.org>
  • Subject: [pcplantdb] README for version 0.1 of pcplantdb
  • Date: Mon, 07 Oct 2002 13:59:14 +0100

Folks,
See attached for html version.

Rich

Notes on version 0.1 of pcplantdb

By PFAFRich

This is a very early version of the pcplantdb intended more as a first
working model rather than anything
concrete. Nothing at all is set in stone, everything will need to be
changed!

Discussion about the database should be kept to the pcplantdb mailing
list at ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/pcplantdb.

Overview

The general aim of the project is to provide a system for recording and
finding information about plant.
Especially information of relavence to permaculture.

Constructing a system where others can contribute is central to the
project. To this end most an open
source framework should be uses.

The system should be easy for people to add their own data, and correct
existing data.

The system should make it easy for data from other sources to be
incorperated.

As well as providing data people should be able to modify the interface.

Licensing

Licensing has not been discussed as yet, for the meantime consider that
all scripts, code, documentation
and data is covered by the GNU GENERAL PUBLIC LICENSE latest version.
One exception to this is
the data provided by Plants For A Future (pfaf) which is currently
covered by its copyright document
http://www.comp.leeds.ac.uk/pfaf/copyright.html. The people at Plants
For A Future are currently
discussing licensing isues which may see the data released under some
type of open source license. This
exception only covers the data, scripts used to import pfaf data and
access the data from pfaf/mySQL are
covered by the GPL.

Basic Setup

The database consists of two major components:

A set of MySQL databases (pcplantdb,pfaf) tested using MySQL
version 3.23.47-max-debug.
A set of php scripts using PHP Version 4.1.1

A set of sql scripts has been used to compile the data, which for the
most part has been taken the the
Plants For A Future species database.

phpMyAdmin 2.2.2 has been used to help administer the database on my
home computer.

Database Structure

There are several elements to the database structure:

Administratine information (details on users etc)
Datasets from various sources (each my be an individual mySQL
database).
Refinements and extensions of above datasets
Data contributed to the project (probably another mySQL database).
Edited versions of above data
Cross referencing information

Currently there are two databases pcplantdb and pfaf:

pcplantdb
Contains general administration data. The tables are:
Users contains contact details for contributors to the
database.
botanical name xref used to cross reference the latin names of
the different datasets.
It also contains some other tables by pfafrich which refine the
pfaf data and use some third part
sources. It is envisaged that these tables will be moved into a
separate database (pfafrich).
systematics data from the UDSA Plants Database giving higher
oerder clasification of the
plants.
habitats Details of habitats of plants, compiled from free
text search of pfaf data.
edibleparts Details of which bits of a plant are edible.
edibleuses Details of particular edible uses of the plant.
There will also be a set of tables to contain contributed
information. A fourth set of tables might
contain an editted version of the contributed information.
pfaf
This contains the data from the Plants For A Future species
database. It is the data used in house
by pfaf rather than the modified data used on the website. The
Tables are
species database The main table contining most of the details
about the plant.
booklist reference books
composition Vitamins and Minerals
cultivars Specific cultivars
edible use details Types of the edible uses of a plant
edible uses Descriptions of terms in above table
medicinal use details Types of the medicinal uses of a plant
medicinal uses Descriptions of terms in above table
other use details Types of the other uses of a plant
other uses Descriptions of terms in above table
plantlocations where plants can grow
range Geographical regions where plant is found in wild
scentedplants details of scented plants
synonyms other Botanical names for the plant
In theory you should not need to know about the above tables, the
exact structure of a particular
dataset should only be of interest to the maintainer of that
dataset.

Interface Structure

The interface has been written in php.

Classes have been used throughout. In general there is one class per
table. An object of that class will
contain information on one row in the table. The classes contain a
constructor which builds the object
given the results of an SQL query. Most classes also contain a display()
function which does a very basic
display of the info in each object.

There is also a Pfaf class. This is used to contain all the information
about a plant from the pfaf database.
As well as holding information from Species Database it also contains
(arrays) of objects to matching
records in the other tables in the pfaf database. These objects are
automatically created when the class is
constructed. The class contains several display functions for broad
catogries of information. These allow
an easy method for display a combined plant report using data from
diferent datasets.

The PfafRich class extends the Pfaf class. Its purpose is to provide a
couple of extra display functions. If
you want to change how data is presented it might be a better idea to
create a subclass with diferent
display methods rather than alter the base class. For example you will
not generally want to edit the pfaf
class except for bug fixes.

The diferent php scripts are currently:

search.php Simple Front page allowing search for latin names.
findlat.php script which displays matching plants from the above
search.
plantreport.php displays the finfomation about a plant.
userinfo.php displays info about users of the system.
pfafclass.php classes for accessing the pfaf data.
pfafrich.php classes for rich's extensions to pfaf data.

Questions we need to address

1.Nameing system. Use of Case, spaces in names, underscores.
Applicable to Database, Table,
Column names, names of php scripts, Classes, variables and
functions and names of various
scripts.
2.Overall database structure. How to organise all the diferent types
of data. Cross refenrencing,
recording who did what when.
3.Fields for the main contributers data. What sort of info do we want
about each plant?
4.Structure for php interface.
5.Class hierarachy. Should there be a base class?
6.functions. What functions do we want to search and display the
plant info?
7.Abstraction. It might be posible to provide a general display
function which is easy to alter.

Source Code

Various files are used to set up the SQL databases, and the php
interface:

index.php the start page
findlat.php lists the plants matching a latin name
plantreport.php lists the plants matching a latin name
glossary.php displays the glossary of terms
userinfo.php: lists the users of the database
pfafclass.php classes to access data from pfaf database
pfafrichclass.php classes to access data from rich's extensions to
pfaf database
glossaryclass.php classes to access glossary data

Currently the sql databases are constructed from a set of scripts:

setuppfaf.sql Table definitions for pfaf database
importpfaf.sql Import data into pfaf database
setuppfafrich.sql Create tables and import data for rich's
extensions of pfaf database
setupcontrib.sqlc create table defs for general admin and main
contribution data
setupcontrib.sqlr pre processed version of above.

To set the database up the first four need to be run in order. You might
need to edit the second and third
to alter locations of data files.

The setupcontrib files illustrate a couple of points. Its a nice feature
if the sql code is self documenting. A
Table `database notes` is used to contain the notes for
readers,contributors and developers of the
database. A special comment structure is used to contain these notes in
the setupcontrib.sqlr and a perl
script documenttables.pl is used to interprete these comments and create
INSERT statments to fill
`database notes` with these comments. To use this do something like

perl documenttables.pl < setupcontrib.sqlr > setupcontrib.sqlc
mysql < setupcontrib.sqlc

The other feature of the script is that it automatically adds
information about the contributers to the
database.

Tables in the database

Database
Name
Table Name
Readers Notes
Contributors notes
Developers
notes
pcplantdb
Database
Notes


A Table to hold
documentation
about a table
pcplantdb



The database
containing
administrative
info, main
contributed
information
pcplantdb
Master Index

The main table to
index contributions to
the database
Alter with
care!
pcplantdb
Record Types

The different types of
records which can be
submitted
May want to
extend the
types
pcplantdb
Users
The users of the
database

Will want to
integrate this
with mySQL
users
pcplantdb
Scores

The scores for each
contribution
We might want
to have
some sort of
voting system,
a-la slashdot,
this table
contains such
info. Created
by pfafrich
18/6/02
pcplantdb
Glossary
The glossary of
terms used in the
database


pcplantdb
Systematics
Systematic Info
from Kingdom to
Families


pcplantdb
References
Details of paper and
electronic
references.
Column names and
type of publication
taken from those used
for bibtex

pcplantdb
Publication
Types
Different types of
publication
Mirrors those used for
bibtex
Some types
might have
special
formating rules
pcplantdb
Plant Specific
References
A table used to
cross reference our
database with other
databases




--
Plants for a Future: 7000 useful plants
Web: http://www.pfaf.org/ := http://www.comp.leeds.ac.uk/pfaf/
Snail: Blagdon Cross, Ashwater, Beaworthy, Devon, EX21 5DF
Tel: 01208 872 963 / 0845 458 4719
Email: webmaster@pfaf.org
PFAF electronic mailing list http://groups.yahoo.com/group/pfaf
<<< text/html; charset=iso-8859-1; name="README.html": Unrecognized >>>



Archive powered by MHonArc 2.6.24.

Top of Page