Skip to Content.
Sympa Menu

pcplantdb - [pcplantdb] Back at it for a bit

pcplantdb@lists.ibiblio.org

Subject: pcplantdb

List archive

Chronological Thread  
  • From: Bear Kaufmann <bear@ursine-design.com>
  • To: pcplantdb <pcplantdb@lists.ibiblio.org>
  • Subject: [pcplantdb] Back at it for a bit
  • Date: Thu, 22 Dec 2005 17:36:32 -0800

Hello everyone,

Best holiday wishes to all.

Well, I've been out of communication for a while, if you hadn't noticed. Primarily school work and other work leaving me little time to work on the project. But now that that's over, I can spend a little more time on this project.

I've actually been working on some things in the last few days related to the project. And did install the block list, so hopefully we won't be getting wiki updates from spammers.

I was re-inspired to experiment with and learn the RDF structure. I did some work with regexs and parsing to load in data from USDA Plants, PFAF comments, and USDA GRIN (http://www.ars-grin.gov/cgi-bin/npgs/html/taxgenform.pl).
I loaded my parsing work into a table called attributes:
id int(16)
subject int(16)
predicate varchar(100)
object varchar(100)
qualifier varchar(100)
input binary(1)
source varchar(6)

Subject is currently just the id of the plant, predicate is the linking term, and object is the linkee. qualifier further defines the term. And source is the data source. This really isn't a "triple-store", just for hacking and experimentation. But does raise some questions I have about how to represent information fully in RDF. Namely the qualifier issue. I'd like to be able to easily state an amount, or some other "qualification" of the link, for example: prefers very WetSoil. I believe this can mainly be handled by "subClassing" the connectionType and Object. WetSoil is a rdf:subClassOf Soil. prefers is a subClassOf response/'attitude'/some better neutral term.

Here's some output from the table:
Subject: Predicate: hasCommonName Object: Qualifier:
Plant (): Abelmoschus esculentus hasCommonName gumbo () from GRIN
Plant (): Abelmoschus esculentus hasCommonName kacang bendi (Mal.) from GRIN
Plant (): Allium ampeloprasum hasCommonName Sommerlauch (Ger.) from GRIN
Plant (): Allium hookeri hasCommonName kuan ye jiu (Chin.) from GRIN
Plant (): Allium kurrat hasCommonName kurrat (Arab.) from GRIN

Subject: 3 Predicate: Object: Qualifier:
Plant (3): Abelmoschus manihot cultivationComment It grows well in an ornamental vegetable garden () from 200
Plant (3): Abelmoschus manihot ediblityComment Young leaves - raw or cooked () from 183, 2
Plant (3): Abelmoschus manihot growsIn Cultivated Beds () from PFAF
Plant (3): Abelmoschus manihot growsIn Other Habitats () from PFAF
Plant (3): Abelmoschus manihot hasCommonName sunset-hibiscus () from GRIN
Plant (3): Abelmoschus manihot hasEconomicValueAs Pesticide (potential for disease vector control) from GRIN
Plant (3): Abelmoschus manihot hasEconomicValueAs Food (vegetable) from GRIN
Plant (3): Abelmoschus manihot hasEconomicValueAs Environ. (ornamental) from GRIN
Plant (3): Abelmoschus manihot hasEconomicValueAs Food (vegetable) from GRIN
Plant (3): Abelmoschus manihot hasHabit Perennial () from PFAF
Plant (3): Abelmoschus manihot hasHardynessOf 9 () from PFAF
Plant (3): Abelmoschus manihot hasHeightOf 200 (cm) from PFAF
Plant (3): Abelmoschus manihot hasWidthOf 50 (cm) from PFAF
Plant (3): Abelmoschus manihot isDistributedIn widely cult. in tropics () from GRIN
Plant (3): Abelmoschus manihot isDistributedIn Ind. Subcont. () from GRIN
Plant (3): Abelmoschus manihot isDistributedIn China () from GRIN
Plant (3): Abelmoschus manihot isDistributedIn Australia () from GRIN
Plant (3): Abelmoschus manihot isDistributedIn Malesia () from GRIN
Plant (3): Abelmoschus manihot isDistributedIn probably elsewhere in tropical Africa & Asia () from GRIN
Plant (3): Abelmoschus manihot medicinalComment The bark is said to be emmenagogue () from 240
Plant (3): Abelmoschus manihot pollinatedBy Insects () from PFAF
Plant (3): Abelmoschus manihot propagationComment Seed - sow March in a warm greenhouse. The seed should germinate with two weeks, when it is large en () from

This format is a pretty far cry from a real RDF store, but gives me a taste of the possiblities. After experimenting with this, I wanted to explore RDF more fully. One of the RDF query languages I was looking at called RDQL is rather similar to SQL.
SELECT FROM * (namespaces)
WHERE (?x, <subClassOf>, ?z)
AND ?x=condition
FOR namespace=url, piw=url, dc=url....

The WHERE clause is the core of it, and some of the beauty of RDF. If we wanted to find all the outgoing links from a plant we could set WHERE to (<piw:Somethycum_bicolor>,?y,?z). With that query we'd get basicly all we'd need to show a plant.
WHERE (?x,?y,<piw:Somethycum_bicolor>) would tell us what links to it. Perhaps goats consume plant. etc. BTW, there can be more then one part in the where statement which can allow deeper searching, but it seems (at least with the implementation I'm using, which may be handling a good deal of checks within PHP) that complex "deeper" queries require a good deal more computing time (understandably, since it's doing JOINs and UNIONs and such). So I'm inclined to try to define plants and other objects as much as possible going only one level deep with the links. It's a call between semantic richness and computational effiecency.

OK. That's enough for one letter. I'll write more about my thoughts soon. I've been working on moving Rich's XML schema doc towards an RDF Ontology. While this letter is rather technical, I think there should be some interesting discussion on how we could lay out vocabulary (Ontology) that will fit the needs of the DB. I think this avenue is very interesting in terms of the flexiblity it provides in defining the schema of plants and other objects (and interface too me thinks). Sorry if I didn't do any softer leadups to any terms I used. If anything is confusing, let me know.

Once again, hope your all well.

Talk to you soon,
Bear




Archive powered by MHonArc 2.6.24.

Top of Page