Hello, everybody.
I'm a linguist with practical skills on computers/programming.
We've been working with an ontology at my department, and now I need
to create a GUI viewer for the flat file we have.
I tried to write an Ontology class which manages the data read and
parsed from the flat file, but it takes a relatively long time.
Besides, we have plans to set up a website for online display of said
ontology. So, I have been being pushed towards changing the basic plan
and build a DB so that data access will be faster and easier for both
the desktop GUI and the web app. Right now, I'm trying to work with
sqlite, since it can be used as a separate file for the GUI and as a
DB for Django (which may be the choice for the web interface).
I have been redaing some books on DBs but I kind of get stuck when it
comes to the normalization and the planning of the tables. The problem
is that we have basically four fields that can be arranged in a tree-
like structure. Eg:
Concept
|- Slot
|`-- Facet
| `-- Filler
`- Slot
`-- Facet
`-- Filler
`-- Filler
...
So, for ONE *concept*, we have, usually, MANY *slots*, each *slot* has
ONE *facet*, and each *facet* can have MORE THAN ONE *filler*.
Besides, some *slots* and *fillers* are themselves *concepts*,
creating a sort of recursive reference.
line_no conceptsslots facets fillers
--
0 ABANDON DEFINITION VALUE "to leave or desert something or
someone"
1 ABANDON IS-AVALUE EXIT
2 ABANDON LEXEMAP-LEX "leave behind-V1"
3 ABANDON LEXEMAP-LEX abandon-V1
(...)
97420 ZULUDEFINITION VALUE "a language or dialect spoken in south
africa and others"
97421 ZULUINSTANCE-OF VALUE OTHER-NIGER-KORDOFANIAN-LANGUAGE
97422 ZULULANGUAGE-OF INV LESOTHO
97423 ZULULANGUAGE-OF INV SOUTH-AFRICA
I tried to create index tables for concepts, slots, facets and
fillers, which gave me the following table:
line_no conceptsslots facets fillers
--
0 cn_0sl_00048fc_7fl_07349
1 cn_0cn_02605fc_7cn_01768
2 cn_0sl_00121fc_2fl_04329
3 cn_0sl_00121fc_2fl_15009
(...)
97420 cn_05429sl_00048fc_7fl_01340
97421 cn_05429cn_02493fc_7cn_03526
97422 cn_05429cn_02750fc_1cn_02816
97423 cn_05429cn_02750fc_1cn_04580
(cn_X from concept index, sl_X from slot index,
fc_X from facet index, fl_X from filler index.)
As you can see, only concepts and facets are populated by their own
type of data.
Whereas slots and fillers can be populated by their own types or by
concepts.
What would be a good way to create tables for this situation?
In fact, this is the first time I've ever tried to create a DB, so I'm
completely lost.
I'm looking forward to a reply...
Thank you very much,
Juliano
--
http://mail.python.org/mailman/listinfo/python-list