Page MenuHomePhabricator

introduce sub-category-of property for subclassing
Closed, ResolvedPublic

Description

Author: zaltenbach

Description:
In SMW the annotation for assigning a category to a super-category is the same as for assigning an instance to a category.

E.g. on the page Category:User you write [[Category:Person]] for making 'User' a sub-category of 'Person'. Likewise, if you have a page 'Denny' you write [[Category:Person]] in order to assert 'Denny' to the category 'Person'.

This annotation style has however the sideeffect, that when you query
{{#ask: [[Category:Person]] }} you get instances (e.g. 'Denny') as well as sub-categories (e.g. 'User') of the category 'Person'.

I would therefore recommend to implement and use a distinct annotation for sub-categories, e.g. [[subcategory of::Category:Person]]. This would be consistent with the annotation for sub-properties (e.g. [[subproperty of::SomeProperty]]) as well as with the OWL/RDF annotation owl:subClassOf.

However, one have to think about downward compatibility with existing annotations...


Version: unspecified
Severity: enhancement

Details

Reference
bz21108

Event Timeline

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

A "subcategory of" property has now been introduced, and configuration options have been added to decide whether or not category statements should lead to subcategory or instance of relationships (or to both or to neither), see Bug 20039. To completely separate subcategory and instance of relations, one would thus need to set both $smwgCategoriesAsInstances = false and $smwgUseCategoryHierarchy = false.

In inline queries, [[Category:Foo]] statements always refer to instance of relationships, and only the setting $smwgCategoriesAsInstances determines which results will be included in this case. Querying for the new property subcategory_of also works now, but existing installations must run setup (update) again and refresh all data (e.g. via the Special:SMWAdmin page) since the DB layout has changed.