Search Postgresql Archives

How best to represent relationships in a database generically?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Sorry, this really isn't postgresql specific, but I figure there are lots of smarter people around here.

Say I have lots of different objects (thousands or even millions?). Example: cow, grass, tiger, goat, fish, penguin.

BUT I'm not so interested in defining things by linking them to categories or giving them names, I'm trying to figure out a way to define things by their relationships with other things, and more importantly do searches and other processing by those relationships.

So, what would be the best way to store them so that a search for the relationship like "grass is to cow", will also turn up cow is to tiger, and goat is to tiger, and fish is to penguin (and penguin is to bigger fish ;) ), and electricity is to computer. And a search for cow is to goat, could turn up tiger is to lion, and goat is to cow.

Is the only way to store all the links explicitly? e.g. have a huge link table storing stuff like obj => cow, subj => grass, type => consumes, probability=90% ( => means points/links to). Or even just have one table (links are objects too).

Or is it possible to somehow put the objects in a multidimensional space (1000 dimensions?) and keep trying to arrange the objects so that their relationships/vectors with/from each other are fairly consistent/reasonable based on "current knowledge"? Trouble is in some cases the grass eventually eats the cow, so maybe that doesn't work at all ;).

Or even do both? Maybe use the first as a cache, and the second for "deeper" stuff ("flash of insight" or "got the punchline" = figure out better arrangement/ joining of disparate maps).

My worry about the first approach is that the number of links might go up very much faster as you add more objects. But perhaps this won't be true in practice. The worry about the second approach is that it might get "stuck", or run out of dimensions.

Is there a better way to do this? There must be right?

Wait for huge quantum computers and use qubits for each multidimensional coordinate? ;).

Regards,
Link.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux