Thread:User talk:Tpt/RFC/Another storage proposal

I like the general idea, as we should avoid any duplication of metadata. I would like to point out that MediaWiki has already page_props table, which can be used to store properties associated with the page. Those properties are already available through API (action=query&titles=Index:Title&prop=pageprops). I have prepared today a proof of concept patch - it is available at http://tools.wikimedia.pl/~beau/tmp/proofread-metadata-props.diff. It is only a demonstration - it is very hacky and has many rough edges.

It uses ParserBeforeStrip hook (which is not the best solution, but I did not managed to find anything more useful) to parse the page content (using MediaWiki preprocessor) and inject page properties. Each property is named 'property-Arg', where 'Arg' is name of MediaWiki:Proofreadpage_index_template template argument. Current version does not handle wiki-syntax well as tags are visible as parser markers right now, but this can be fixed.

The metadata can be accessed using. Currently this magic word cannot be used in index namespace to avoid loops. The page containing this magic word is added to templatelinks table, so if 'index-name' is modified all pages using metadata will be rebuilt.

Example page: Indeks:1

Example api output:

Output from mysql: mysql> SELECT * FROM page_props where pp_page = 1; +-+--+--+ +-+--+--+ +-+--+--+ 8 rows in set (0.00 sec)
 * pp_page | pp_propname         | pp_value                                                 |
 * 1 | proofread-Autor     | Jan Kowalski                                             |
 * 1 | proofread-Ilustracja |                                                         |
 * 1 | proofread-Rok       | 1998                                                     |
 * 1 | proofread-Strony    | 1 2 3 |
 * 1 | proofread-Tytuł     | Friends                                                  |
 * 1 | proofread-Uwagi     |                                                          |
 * 1 | proofread-Wydawca   | WMF                                                      |
 * 1 | proofread-Źródło    | Brak                                                     |