Topic on Talk:Requests for comment/New sites system

Dantman (talkcontribs)

Since we're replacing interwiki with sites the constraints used by links tables are going to be broken. We're probably going to need code changes and perhaps some schema changes to fit them into the new sites system.

iwlinks has a iwl_prefix column and langlinks has a ll_lang column, both of which point to interwiki.iw_prefix.

Since we're going to be breaking things in this area anyways I think we should take this chance to replace iwlinks and langlinks with a sitelinks table. Besides the schema changes this will also make it possible to have things like project links/sister site links (i.e.: different si_types) without needing new tables.

# prefix
sitelinks {
  sl_from INT UNSIGNED,
  sl_prefix VARBINARY(25), # points to site_identifiers.si_key
  sl_title VARBINARY(255)
}

# site
sitelinks {
  sl_from INT UNSIGNED,
  sl_site ???, # either an INT UNSIGNED pointing to site_id or a VARBINARY pointing to site_global_key, we can discuss that later
  sl_title VARBINARY(255)
}

Both of these options has advantages and disadvantages that we need to sort out.

By using si_prefix the prefix method makes it so that all site links only work when a site has a local prefix. This means that extensions adding interlanguage links to pages from other sources can't add arbitrary interlanguage links to a page.

On the other hand while the site method effectively deals with that issue (and also technically leaves the window open for us to let normal interwiki links be added as language links with something like {{#langlink:Wikipedia:Foo}} or {{#langlink:enwikipedia|Foo}}) by pointing to a site directly when a site_identifiers row for a site is removed all sitelinks pointing to that site have to be refreshed. Even when the prefix used in the page is completely different.

I think we might have to review how the {iw,lang}links system works and is used and figure out how site links will have to work. Especially with cases like modifications to the interwiki table. Thinking about it addition to interwiki/site_identifiers may actually be worse. All of a sudden pagelinks become interwiki links.

93.220.88.78 (talkcontribs)

site_identifiers contains the equivalent information to what was interwiki.iw_prefix. si_type="interwiki" for siter-links and si_type="equivalent" for language links. I don't see how that breaks anything.

Also, I suggest not make this change even more complex by messing with the database some more. Generalizing langlinks and iwlinks is nice, but can be done as an optional follow up. This should not block the deployment of the Sites stuff.

The change as proposed does not even replace the interwiki table, Title will still use that. Sites is supplying an alternative/additional mechanism for maintaining information about external sites. It may *eventually* replace interwiki, but that is what is being discussed here.

So, again: what you propose seems a good idea to me, but it's two steps ahead and should in no way be blocking deployment of the change as proposed.

This post was posted by 93.220.88.78, but signed as Daniel Kinzler (WMDE).

Daniel Kinzler (WMDE) (talkcontribs)

Ooops, forgot to log in.

Dantman (talkcontribs)
site_identifiers contains the equivalent information to what was interwiki.iw_prefix. si_type="interwiki" for siter-links and si_type="equivalent" for language links. I don't see how that breaks anything.

The problem is the case where you have a site link not using a local prefix. eg: Added by Wikidata, some central interwiki extension, etc...

Reply to "Sitelinks"