Special:Categories lists each category together with the number of members.
This page discusses some approaches towards modeling with categories. It is not part of the official documentation for SMW, and may or may not be accurate/correct/objective.
norton software, <a href="http://esspinosa.isuisse.com/quotes-about-wanting-what-you-cant-have.html">Quotes About Wanting What You Cant Have</a>, [url="http://esspinosa.isuisse.com/quotes-about-wanting-what-you-cant-have.html"]Quotes About Wanting What You Cant Have[/url], http://esspinosa.isuisse.com/quotes-about-wanting-what-you-cant-have.html Quotes About Wanting What You Cant Have, omdf, <a href="http://idalinna.isuisse.com/one-two-three-what-are-we-fighting-for-lyrics.html">One Two Three What Are We Fighting For Lyrics</a>, [url="http://idalinna.isuisse.com/one-two-three-what-are-we-fighting-for-lyrics.html"]One Two Three What Are We Fighting For Lyrics[/url], http://idalinna.isuisse.com/one-two-three-what-are-we-fighting-for-lyrics.html One Two Three What Are We Fighting For Lyrics, 8(, <a href="http://nominanda.isuisse.com/running-2mb-broadband-what-modem.html">Running 2mb Broadband What Modem</a>, [url="http://nominanda.isuisse.com/running-2mb-broadband-what-modem.html"]Running 2mb Broadband What Modem[/url], http://nominanda.isuisse.com/running-2mb-broadband-what-modem.html Running 2mb Broadband What Modem, =-]], <a href="http://narranjo.isuisse.com/pay-what-you-can-seattle.html">Pay What You Can Seattle</a>, [url="http://narranjo.isuisse.com/pay-what-you-can-seattle.html"]Pay What You Can Seattle[/url], http://narranjo.isuisse.com/pay-what-you-can-seattle.html Pay What You Can Seattle, scb, <a href="http://idalinna.isuisse.com/pez-whatley-dies.html">Pez Whatley Dies</a>, [url="http://idalinna.isuisse.com/pez-whatley-dies.html"]Pez Whatley Dies[/url], http://idalinna.isuisse.com/pez-whatley-dies.html Pez Whatley Dies, 8-DD, <a href="http://vazzquez.isuisse.com/reg-sz-what-is.html">Reg Sz What Is</a>, [url="http://vazzquez.isuisse.com/reg-sz-what-is.html"]Reg Sz What Is[/url], http://vazzquez.isuisse.com/reg-sz-what-is.html Reg Sz What Is, >:PPP, <a href="http://serrato.isuisse.com/oh-what-a-night-frankie.html">Oh What A Night Frankie</a>, [url="http://serrato.isuisse.com/oh-what-a-night-frankie.html"]Oh What A Night Frankie[/url], http://serrato.isuisse.com/oh-what-a-night-frankie.html Oh What A Night Frankie, >:-], <a href="http://esspinosa.isuisse.com/ray-charles-what-kind-of-man-are-you-lyrics.html">Ray Charles What Kind Of Man Are You Lyrics</a>, [url="http://esspinosa.isuisse.com/ray-charles-what-kind-of-man-are-you-lyrics.html"]Ray Charles What Kind Of Man Are You Lyrics[/url], http://esspinosa.isuisse.com/ray-charles-what-kind-of-man-are-you-lyrics.html Ray Charles What Kind Of Man Are You Lyrics, >:-OO, <a href="http://vieenttos.isuisse.com/now-thats-what-i-call-music-quiz.html">Now Thats What I Call Music Quiz</a>, [url="http://vieenttos.isuisse.com/now-thats-what-i-call-music-quiz.html"]Now Thats What I Call Music Quiz[/url], http://vieenttos.isuisse.com/now-thats-what-i-call-music-quiz.html Now Thats What I Call Music Quiz, 8[[[, <a href="http://nominanda.isuisse.com/now-thats-what-i-call-christmas-2.html">Now Thats What I Call Christmas 2</a>, [url="http://nominanda.isuisse.com/now-thats-what-i-call-christmas-2.html"]Now Thats What I Call Christmas 2[/url], http://nominanda.isuisse.com/now-thats-what-i-call-christmas-2.html Now Thats What I Call Christmas 2, yaq, <a href="http://narranjo.isuisse.com/oasis-whatever.html">Oasis Whatever</a>, [url="http://narranjo.isuisse.com/oasis-whatever.html"]Oasis Whatever[/url], http://narranjo.isuisse.com/oasis-whatever.html Oasis Whatever, xfc, <a href="http://vieenttos.isuisse.com/pulp-fiction-whats-in-the-case.html">Pulp Fiction Whats In The Case</a>, [url="http://vieenttos.isuisse.com/pulp-fiction-whats-in-the-case.html"]Pulp Fiction Whats In The Case[/url], http://vieenttos.isuisse.com/pulp-fiction-whats-in-the-case.html Pulp Fiction Whats In The Case, piecl, <a href="http://serrato.isuisse.com/our-lives-are-not-determined-by-what.html">Our Lives Are Not Determined By What</a>, [url="http://serrato.isuisse.com/our-lives-are-not-determined-by-what.html"]Our Lives Are Not Determined By What[/url], http://serrato.isuisse.com/our-lives-are-not-determined-by-what.html Our Lives Are Not Determined By What, :DD, <a href="http://narranjo.isuisse.com/sa-isa-what-is.html">Sa Isa What Is</a>, [url="http://narranjo.isuisse.com/sa-isa-what-is.html"]Sa Isa What Is[/url], http://narranjo.isuisse.com/sa-isa-what-is.html Sa Isa What Is, fhaw, <a href="http://serrato.isuisse.com/not-what-you-know-but-who-you-know.html">Not What You Know But Who You Know</a>, [url="http://serrato.isuisse.com/not-what-you-know-but-who-you-know.html"]Not What You Know But Who You Know[/url], http://serrato.isuisse.com/not-what-you-know-but-who-you-know.html Not What You Know But Who You Know, gxxndt, <a href="http://narranjo.isuisse.com/powhatan-school-clarke-county.html">Powhatan School Clarke County</a>, [url="http://narranjo.isuisse.com/powhatan-school-clarke-county.html"]Powhatan School Clarke County[/url], http://narranjo.isuisse.com/powhatan-school-clarke-county.html Powhatan School Clarke County, 95899, <a href="http://serrato.isuisse.com/perpetual-license-what-is.html">Perpetual License What Is</a>, [url="http://serrato.isuisse.com/perpetual-license-what-is.html"]Perpetual License What Is[/url], http://serrato.isuisse.com/perpetual-license-what-is.html Perpetual License What Is, zqhuq, <a href="http://idalinna.isuisse.com/oasis-whatever.html">Oasis Whatever</a>, [url="http://idalinna.isuisse.com/oasis-whatever.html"]Oasis Whatever[/url], http://idalinna.isuisse.com/oasis-whatever.html Oasis Whatever, imjkl, <a href="http://serrato.isuisse.com/reba-mcentire-what-do-you-say-lyrics.html">Reba Mcentire What Do You Say Lyrics</a>, [url="http://serrato.isuisse.com/reba-mcentire-what-do-you-say-lyrics.html"]Reba Mcentire What Do You Say Lyrics[/url], http://serrato.isuisse.com/reba-mcentire-what-do-you-say-lyrics.html Reba Mcentire What Do You Say Lyrics, 16592, <a href="http://barbbate.isuisse.com/pez-whatley-death.html">Pez Whatley Death</a>, [url="http://barbbate.isuisse.com/pez-whatley-death.html"]Pez Whatley Death[/url], http://barbbate.isuisse.com/pez-whatley-death.html Pez Whatley Death, =-(, <a href="http://narranjo.isuisse.com/quotes-from-what-dreams-may-come.html">Quotes From What Dreams May Come</a>, [url="http://narranjo.isuisse.com/quotes-from-what-dreams-may-come.html"]Quotes From What Dreams May Come[/url], http://narranjo.isuisse.com/quotes-from-what-dreams-may-come.html Quotes From What Dreams May Come, 8D, <a href="http://nominanda.isuisse.com/powhatan-indian-life.html">Powhatan Indian Life</a>, [url="http://nominanda.isuisse.com/powhatan-indian-life.html"]Powhatan Indian Life[/url], http://nominanda.isuisse.com/powhatan-indian-life.html Powhatan Indian Life, :P, <a href="http://carbbajal.isuisse.com/owhata-school.html">Owhata School</a>, [url="http://carbbajal.isuisse.com/owhata-school.html"]Owhata School[/url], http://carbbajal.isuisse.com/owhata-school.html Owhata School, =((, <a href="http://esspinosa.isuisse.com/now-thats-what-i-call-music-28.html">Now Thats What I Call Music 28</a>, [url="http://esspinosa.isuisse.com/now-thats-what-i-call-music-28.html"]Now Thats What I Call Music 28[/url], http://esspinosa.isuisse.com/now-thats-what-i-call-music-28.html Now Thats What I Call Music 28, %P, <a href="http://barbbate.isuisse.com/pulp-fiction-whats-in-the-suitcase.html">Pulp Fiction Whats In The Suitcase</a>, [url="http://barbbate.isuisse.com/pulp-fiction-whats-in-the-suitcase.html"]Pulp Fiction Whats In The Suitcase[/url], http://barbbate.isuisse.com/pulp-fiction-whats-in-the-suitcase.html Pulp Fiction Whats In The Suitcase, 540505, <a href="http://idalinna.isuisse.com/not-what-you-see-kutless-lyrics.html">Not What You See Kutless Lyrics</a>, [url="http://idalinna.isuisse.com/not-what-you-see-kutless-lyrics.html"]Not What You See Kutless Lyrics[/url], http://idalinna.isuisse.com/not-what-you-see-kutless-lyrics.html Not What You See Kutless Lyrics, 462, <a href="http://vieenttos.isuisse.com/sally-mann-what-remains.html">Sally Mann What Remains</a>, [url="http://vieenttos.isuisse.com/sally-mann-what-remains.html"]Sally Mann What Remains[/url], http://vieenttos.isuisse.com/sally-mann-what-remains.html Sally Mann What Remains, 8((, <a href="http://idalinna.isuisse.com/pulp-fiction-whats-in-the-briefcase.html">Pulp Fiction Whats In The Briefcase</a>, [url="http://idalinna.isuisse.com/pulp-fiction-whats-in-the-briefcase.html"]Pulp Fiction Whats In The Briefcase[/url], http://idalinna.isuisse.com/pulp-fiction-whats-in-the-briefcase.html Pulp Fiction Whats In The Briefcase, 8-PP, <a href="http://idalinna.isuisse.com/powhatan-longhouses.html">Powhatan Longhouses</a>, [url="http://idalinna.isuisse.com/powhatan-longhouses.html"]Powhatan Longhouses[/url], http://idalinna.isuisse.com/powhatan-longhouses.html Powhatan Longhouses, uyxqre, <a href="http://vieenttos.isuisse.com/philology-what-is.html">Philology What Is</a>, [url="http://vieenttos.isuisse.com/philology-what-is.html"]Philology What Is[/url], http://vieenttos.isuisse.com/philology-what-is.html Philology What Is, 021532, <a href="http://idalinna.isuisse.com/praise-is-what-i-do-lyrics-shekinah-glory-ministry.html">Praise Is What I Do Lyrics Shekinah Glory Ministry</a>, [url="http://idalinna.isuisse.com/praise-is-what-i-do-lyrics-shekinah-glory-ministry.html"]Praise Is What I Do Lyrics Shekinah Glory Ministry[/url], http://idalinna.isuisse.com/praise-is-what-i-do-lyrics-shekinah-glory-ministry.html Praise Is What I Do Lyrics Shekinah Glory Ministry, elwax,
Comparison with relations and attributes
The whole category system is comparable with a single property: the subject is called "category member", the object "category". Let us call the direction from member to category "up". In the selection part of a query, the category feature finds related pages on the downward side, with automatic "transitivity": if page P is in category Q and Q is a subcategory of category R, selecting category R also gives P. In view of that the feature is intended for some transitive relation.
In a query, we can use [[Category:*]] to show for each selected page the categories it is in (i.e., go up one step), similar to using e.g. [[Instance of::*]] to see for each selected page, of what it is an instance.
Thus selecting Category:Country in European Union also gives countries in Category:Country in Eurozone, but in a query that selects countries, Category:=* gives for Netherlands the latter (and other categories), but not "Category:Country in European Union", in which it is indirectly.
Both for selection and for display, it is not obvious whether including instances of subclasses is an advantage or disadvantage, it depends on the case and on one's wishes.
Regardless of the method, if one wants to include instances of subclasses while these are not provided automatically, of course one can annotate them directly.
Category as class
On Ontoworld a page representing a class is always put in the category namespace, even if instances are not notable enough for a page, e.g. electron. As a result there are empty categories such as Category:Electron.
Property:Instance of and Property:Subclass of are in principle deprecated, use a standard MediaWiki category tag instead. However, the inverses Property:Has instance and Property:Has subclass are still useful. On the category page itself instances and subclasses are shown as articles and subcategories in the category, but on other pages the category feature does not provide this info. "Has instance" tags at the lowest class level may even be more useful than the corresponding category tags at the instance pages (the category is then shown as query result).
For several of these classes there is also a category, see Property:Category about.
Although an attribute can have many values, we can also use an attribute for the answer to a yes/no question, e.g. of type string with value "yes", or undefined for "no". There may be additional possible values such as "partly", in which case we can use "fully" instead of "yes". With this method, in a query result table the column focuses on the required property, and does not also show other properties. This can be an advantage or a disadvantage. Examples (they use "v" as a simplification of checkmark "✓", but that is not recommended):
- value "v": the page represents a fictional person, animal, or thing, or a class of them
- undefined: all other cases
- Property:Located in Europe:
- value "v": country, city, class of one of these, etc. is fully in Europe
- value "partly": country, city, object, class of one of these, etc. is partly in Europe
- undefined: all other cases (i.e., not applicable or fully outside Europe)
- Property:Query results link to properties (for pages within Category:Semantic MediaWiki wiki)
- v = yes
- - = no
- undefined = not checked yet
Whether an annotation for "no" is useful and practical varies.
- An attribute that's strictly yes or no would be better supported by the proposed Boolean datatype. An attribute that can be, for example, undefined-no-partly-yes-fully would be better supported by the proposed Enumerated datatype. -- Skierpage 13:22, 30 November 2006 (CET)
Advantages of a category
A category page provides sections by first letter.
Multiple categories, as compared with one relation, have the advantage that Special:Categories shows the number of members of each while Special:Relations only gives the total for the relation. Of course we can also replace each category by a separate relation.
In a query we can use a selection like "Category:Located in Europe||Overlaps Europe". Compare this with the fact that with relations, although we can take a union of objects, as in located in::Europe||Asia, we cannot take a union of selections involving two relations, such as located in::Europe and overlaps::Europe.
Suppose there are n disjoint categories, then for each of the 2^n - 1 non-empty subsets of the set of categories, the selection in a query can be the union of the pages in that subset of categories. Compare this with using a single attribute with n values: with := , equalities and inequalities, we have 3n - 3 possible selections (n>1), which for n>2 is less.
Advantages of a relation
In the case of a relation, we can also relate to a page in the main namespace. This avoids the duplication of having e.g. pages Continent and Category:Continent, or Fictional person and Property:Fictional. The query table directly links to this page in the main namespace, while in the other cases it links to the category page or attribute page only.
- Note: Directly relating content pages can also be achieved with the category system by not using the main namespace, but putting all content in the category namespace. However, this somewhat clutters the titles of the pages and makes linking more cumbersome.
All instances of e.g. Property:Instance of can be produced by one query, either alphabetically, or sorted by the object of the relation. Thus we can ask an open question "Of what is this an instance?" instead of a yes/no question "Is this an instance of ...?".
Advantages of an attribute with simple values
In a query result table the table column only needs a small width if we use a short header (if needed with a legend before or after the table).
In addition to info representing "yes" and "no" we can have "partly", etc. See the queries in the Europe page.
In the case of two values, e.g. "v" and "partly" (in addition to undefined) we can use the attribute for any selection, with := , :=v, and :=partly. In the case of more than two values we can choose the values such that the most desired selections can be done, if not with an equality, with an inequality. For example, if there are three values, 6 of the 7 selections are possible with :=*, an equality, or an inequality; if there are four values, 9 of the 15.
- <ask>[[Category:continent]]</ask> gives <ask></ask>
- <ask>[[instance of::continent]]</ask> gives <ask>continent</ask>
- <ask>[[Category:continent||country]]</ask> gives <ask></ask>
- <ask>[[instance of::continent||country]]</ask> gives <ask></ask>
- <ask sort="instance of">[[instance of::continent||country]]</ask> gives <ask sort="instance of"></ask>
A union of a category and a set of subjects relating to a given object is not possible. Actually, in SMW 1.0RC2 the behavior of these queries seems different. Therefore, if one wants the possibility to take a union one has to use two categories, or two objects with the "instance of" relation, not one of each.
Advice on Annotation | Ask | Attribute name | Browsing and searching | Category | Chains of relations and attributes | Custom units | Namespace | Relation name | Selection | SearchTriple | Sorting | Templates in SMW