User:أحمد/mediawiki-extensions-SemanticCategoriesIntersection

This is a proposal for an extension to facilitate the model of atomic categories paired with basic category set-operations; mainly the intersection of two categories.

This could simplify the organisation of several types of wikis. For example:

could be replaced with the intersection of the two atomic categories  and

Many proposals are being considered for category math implementations and UI. See for example wikipedia:Wikipedia:Category intersection and Category math

None of these have yet been incorporated in the core MW code, and it is unknown when/if any will be.

There are also extensions that implement similar functionality: and hacks such as http://smw.referata.com/wiki/Replace_list_of_pages_in_a_Category_by_a_semantic_query which depends on Extension:CSS and Extension:SMW
 * Extension:DynamicPageList (Wikimedia)
 * Extension:DynamicPageList3
 * Extension:Multi-Category Search

However, neither of the above implemented methods integrate seamlessly with the current category system and UI. They require the transclusion of page lists in regular pages, or the creation of category pages which content has been muted from display, or in the case of SMW Concepts, a concept that is separate from the category system.

The approach described here depends on SMW and aims to be almost seamless with how categories are perceived by the user.

Approach
By semantically marking certain categories, their names could be joined together when they are present on a page, in a way that results in the name of a compound/intersected category under which the page is also categorised.

This gives the user a visual aid on the existence of the intersected category in the same manner other categories are displayed on the page, and allows users to immediately navigate to the intersected category and browse its contents.

Example
assume:
 * is assigned the semantic property
 * is categorised under

Now for every page categorised under both  and   (such as Andreas Eschbach for example) an automatic category is added, i.e. the page is categorised under it, which name is derived from the other two categories. So that the result would be:

The automatically added category, i.e  should be visually distinguishable, probably by being grouped under a label such as "automatic categories:", or by being surrounded by parentheses.

Optionally, an atomic category could be marked as to not be displayed when intersecting with certain other categories, probably by assigning them - or their meta-categories - a semantic property such as