On Wednesday 22 October 2003 09:36, Andre Engels wrote:
However, probably it is necessary to also give an
option to specify that
certain pages, while members of the same id, are not linked to eachother.
nl: has a page "Adam" and a page "Eva" (Eve), en: has a single page
"Adam
and Eve". It is logical to link both nl:Adam and nl:Eva to en:Adam_and_Eve,
and en:Adam_and_Eve could be linked to either or both Dutch pages, but I
would not want nl:Adam to link to nl:Eva (or to Eve in any other language
that has the two split). Whether in such a case it would be better to have
one id ("Adam and Eve", with extra specification that some links do not
exist), two ids ("Adam" and "Eve", with some pages having two ids) or
three
ids ("Adam", "Eve", "Adam and Eve", with additional
information that the
first two link to the latter and the latter to the first two, but the first
two not to each other), I do not know yet, but I somewhat lean towards the
last solution.
I think that the only right solution for this is the last one. It needs two
separate tables: one with unique ID for each possible concept and one that
would say which concepts encompass two or more sub-concepts:
table t1
ID|Names
1|nl:Adam
2|nl:Eva
3|en:Adam_and_Eve
table t2
ID1|ID2
1|1
2|2
3|1
3|2
3|3
Then, upon each page loading,
SELECT Names FROM t1
WHERE ID=(SELECT ID1 FROM t2
WHERE ID2=(SELECT UNIQUE ID FROM t1
WHERE Names REGEXP "[[:<:]](lang:page_name)[[:>:]]"))
(I've forgotten SQL a bit, but I guess everyone understand what I wanted to
say.) Then, join Names into one line and process as now.
Upon saving a page, nothing happens unless it has an interlanguage link (to
any language), then it is checked does it exists in t1. If it does, and the
page itself is not in Names of that row, the page is added to Names. If it
doesn't, and an interlanguage link to itself is encountered, a new concept is
added to t1 and t2. If there are several interlanguage links (not neccesarily
to the same language), t2 is expanded with IDs of those that exist in t1. I
think that this covers all possibilities.
Of course, it is possible that duplications of concepts would occur and that
someone mistakenly attributes a concept to another etc. This database would
have to be maintained.