Page MenuHomePhabricator

Category and subcategory semantics should be configurable
Closed, ResolvedPublic

Description

All MediaWiki categories are currently interpreted like classes, i.e. as named collections of objects that relate to each other based on the objects they contain. In particular, subcategory relationship is interpreted as class containment.

This is not always appropriate: many categories are just "topics" so that subcategories may not be subclasses. It would be useful if one could configure the desired semantics either globally or individually for each category.


Version: unspecified
Severity: enhancement

Details

Reference
bz20039

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:48 PM
bzimport set Reference to bz20039.

This could be realized by simply having an explicit sub-class property as suggested in Bug 21108, and to simply have a global switch that disables automatic subclassing based on MW subcategories. Adding dependency.

It is now possible to use the property "subcategory of" to explicitly define a category to be a subcategory of another one. A configuration option $smwgUseCategoryHierarchy (default: "true") has been added to determine whether or not MediaWiki's subcategory hierarchy (based on [[Category:Foo]] statements on category pages) should still be used as before. If this setting is disabled, then the Factbox will show subcategory annotations explicitly, otherwise they will not be shown there.

Independently, but somewhat related, there is also a new setting $smwgCategoriesAsInstances (default "true") that defines if category pages should be considered as elements of a category Foo if they contain statements of the form [[Category:Foo]]. By default, SMW will thus take MediaWiki's category annotation on category pages to mean bith subcategory and instance of, where both features can be disabled. If disabled, there is no alternative way of making category pages into instances of some other category.

Inline queries with the new internal property will work properly only after doing another setup/data refresh after upgrade (the DB layout has been extended slightly).