db for a simple ontology
Posted: Fri Apr 07, 2006 10:33 am
Hi,
Im in the process of making a simple ontology like system using php and js.
it works like this: a user can select a root topic >> sub-topic1 >> sub=topic2 >> interest.
For example Computing / IT >> Web Dev >> mark up >> CSS
So all I would need is four tables for each of the elements above, i can therefore code where to search for the child of a parent element? is that right?
The problem I am having is that the structure is not as static as this, ie there can be a variable amount of sub-topics. So I am having problems getting my head around how to design the db for this. is it just a case of making a db with a root topic, a number of sub topics and an interest table and then linking each child to its parent. How would I make the parent 'aware' of whether it has any children and how many?
would a suitable solution be to create a static number of sub-topics, so when a user has selected a root topic and starts moving through the 'sub-topic' tables as soon as there is a sub topic table with no results the 'interests' table is searched?
What I am after is something that resembles a feature vector for a r-tree, so that when a user has chosen a topic a vector is generated and can then be used as an index
As you can probably see i'm getting into a bit of a mess over this - any pointers would be a massive help.
thanks
rj
Im in the process of making a simple ontology like system using php and js.
it works like this: a user can select a root topic >> sub-topic1 >> sub=topic2 >> interest.
For example Computing / IT >> Web Dev >> mark up >> CSS
So all I would need is four tables for each of the elements above, i can therefore code where to search for the child of a parent element? is that right?
The problem I am having is that the structure is not as static as this, ie there can be a variable amount of sub-topics. So I am having problems getting my head around how to design the db for this. is it just a case of making a db with a root topic, a number of sub topics and an interest table and then linking each child to its parent. How would I make the parent 'aware' of whether it has any children and how many?
would a suitable solution be to create a static number of sub-topics, so when a user has selected a root topic and starts moving through the 'sub-topic' tables as soon as there is a sub topic table with no results the 'interests' table is searched?
What I am after is something that resembles a feature vector for a r-tree, so that when a user has chosen a topic a vector is generated and can then be used as an index
As you can probably see i'm getting into a bit of a mess over this - any pointers would be a massive help.
thanks
rj