Entity | | Knowledge | | Source |
Dwarfciv2 | | Effect of salvia | | Urist bladeleave |
Urist bladeleave | | Knowledge Lib. Iskendira | | Library of iskendria |
Urist bladeleave | | Effect of salvia | | The herbs of Health (scroll) |
The herbs of Health (scroll) | | Effect of salvia | | Leif Sunberry |
.... | | ... | | .... |
each fact would also get a timestamp/date.To get who owns a scripture like the "The herbs of Health (scroll)" you have owner relationship between object and owner. The owner can naturally be a virtual entity like a library.
Document | | Owner |
The herbs of Health (scroll) | | Library of Iskendria |
Please ignore the green parts for a moment.
Ok lets make a example: You are the Apprentice of the local healer. He one day shows you salvia and tells you what effects it has. Upon asking he tells you that he got that info from a scroll. This scroll was, last time, in the library of Iskendira.
What happens internal? The code of the entity goes into the table and looks for its id in the entity collumn and for the Id of the fact in the knowledge column. If it did found a record where both match it looks into the source to get from where the stuff is known. Our scroll is now found.
To get where the scroll is stored it looks into the document/owner table for the document and presto your master can tell you where the scroll is stored.
Ok but what if you are just a wandering Hero who searches knowledge about medicin? What happens if you ask a normal retarded peasent for it? The peasant would just point you to the library.
How? As you can see by a record in the "knownby" table dialing with the library (the green one) itself. The library has a little list of knowledge areas (ranked?) which updates anytime something comes in or something gets destroyed/sorted out. This little list is refferenced by in the table as own fact.
The mainproblem (except for legendmode like "knowledge-base/spread dumbs") of such a system is that it can clutter very fast as functional it is. Especally if you have 200 facts which are know each by 20 persons etc.
To prevent this you create groups and sub-entitys. Say The King gets mildly injured on a hunt. At first only he and the healer and knows. 1 Fact 2 persons knowing it equalks 2 records.
The healer is now gossiping around to 10 people which would equal now 12 records. This ten people + the king and the healer can be collapsed now from 12 individuals to a group moving from 12 records back to 1.
If this group it is as gossipy as the Healer you have very fast the entire capitol know the little story of the kings injury. So you collapse this number of groups respective the entire population in the single "group" representing the city and so on.
If 3/4 of the Population knows this story you can collaps the Multiple city-entitys and groups into a single common knowledge hence a civilation token.
Another not less important way is forgetting with Garbage controll. Little storys like the Kings minor injury are relativly shortlived and can be forgotten over time. This can be done by "expiration dates".
Other stuff like knowledge on a scroll refferencing to another book, person etc. can be the last ring of a very long chain. Normaly you can forget parts of the chain backwards as long the object that have the Knowledge not still exist or the relationship is a knowable "fact" itself.
This applys for example to notes that are taken from somewhere and passed over 10 gens of papers. If this chain didnt branch in between you can delete all parts of the chain except the last 2 if the former documents turned to dust long ago.
edit: OOP makes that stuff much easyer but in terms of databases its easyser to eplain.