Skip to Content.
Sympa Menu

pcdb - Re: [pcdb] some ideas for data modelling

pcdb@lists.ibiblio.org

Subject: Permaculture Database

List archive

Chronological Thread  
  • From: Rich Morris <mailinglists@pfaf.org>
  • To: pcdb <pcdb@lists.ibiblio.org>
  • Subject: Re: [pcdb] some ideas for data modelling
  • Date: Thu, 05 Apr 2007 11:54:00 +0100

jedd wrote:
On Thursday 05 April 2007 9:41 am, Paul Cereghino wrote:
This has been repeated by others. I know I am confused and others may
be as well. Is there a specific table and relationship structure that
you db-designers think of when I say hierarchy? Are there basic
alternative models of adding attributes to objects that need to be
selected among?!

for example..... [The Chicken]

what are the different data structure choices... not for describing the
relationship of the chicken to other objects... but of describing the
characteristics of the chicken.... size, longevity, lifeform, breed, etc...

The latter isn't hierarchical - the attributes of the object are
what you're talking about there - average | max life, size ranges,
egg productivity, feed requirements, placidity, etc.

I'm not a db expert, but I can't conceive of creating a schema
that would be inherently hierarchical.

The nature of family/genus/species is hierarchical, f.e., but the way
you'd represent it in a db isn't, at least not to my mind. I'm
intending to write some thoughts up about schema design soon,
anyway, as it happens.

Oh, when you say adding attributes to objects, do you mean the
values of those attributes, or adding new attributes? The problem
with the latter is that although the db can be designed to cope with
this (though it takes a lot of effort to abstract things out to do so)
the application suite that uses that db needs to know the attributes,
so it can start doing sensible things with the data (attributes and
values). Adding attributes typically is a couple of lines of SQL,
but a non-trivial change at the application layer.

It depends how you define your tables. Having an attribute a a column in a table would make things hard to expand. Having a separate table for attributes

plant_id | attribute_name | attribute_value

makes things much easier to expand.

Rich

--
Plants for a Future: 7000 useful plants
Web: http://www.pfaf.org/
Post: 1 Lerryn View, Lerryn, Lostwithiel, Cornwall, PL22 0QJ
Tel: 01208 872 963
Email: webweaver@pfaf.org
PFAF electronic mailing list http://groups.yahoo.com/group/pfaf





Archive powered by MHonArc 2.6.24.

Top of Page