Jump to content

Template:UKB criterion/doc

From Wikipedia, the free encyclopedia

This template is not used on the English Wikipedia, but it has been kept as a convenience for the operation of a bot on other Wikipedias.


{{UKB criterion}} is used to define what pages should count in a contest checked by User:UKBot. Each criterion acts as a page filter that some of the pages the participants have contributed to will pass and others not. In addition to being readable for the bot, the template also produces a human readable form of the criterion.

Each contest must have at least one {{UKB criterion}} template, but can have multiple.

Usage[edit]

The first parameter defines which criterion type to use, and has to be one of the types the bot supports.

new
the page must have been created within the contest period:
{{UKB criterion | new }}created during the contest
Redirects are excluded by default, to include them:
{{UKB criterion | new | redirects=yes }}created during the contest (including redirects)
existing
the page must have been created before the contest started
Example: {{UKB criterion | existing }}created before the contest started (existing pages)
sparql
the article must be linked to a Wikidata item ?item matching a SPARQL query
{{UKB criterion | sparql | query= { ?item wdt:P31/wdt:P279* wd:Q13276 . } UNION { ?item wdt:P279* wd:Q13276 . } }}have a Wikidata item matching this SPARQL query
It might be a good idea to add a |description=, which is shown before the link to the query:
{{UKB criterion | sparql | description=about cakes | query= { ?item wdt:P31/wdt:P279* wd:Q13276 . } UNION { ?item wdt:P279* wd:Q13276 . } }}about cakes (Wikidata query)
categories
the page must be member of a given categories or any of its subcategories:
{{UKB criterion | categories | Cakes}}in the category Cakes
Multiple categories can be specified. In that case, a page will pass if it's included in at least one of them.
{{UKB criterion | categories | Cakes | Cookies }}in at least one of the categories Cakes or Cookies
To include categories at other language projects, use language prefix and colon (but no leading colon). The bot must also be configured to check the given projects.
{{UKB criterion | categories | Members of the Storting | no:Stortingsrepresentanter | nn:Stortingsrepresentantar | se:Stuorradiggeáirasat | commons:Members of Stortinget }}in at least one of the categories Members of the Storting, Stortingsrepresentanter, Stortingsrepresentantar or Stuorradiggeáirasat
By default, the bot checks 5 levels of subcategories (defined in ukfilters.py ukfilters.py). This can be adjusted, but given the nature of the Wikipedia category tree, you can get very surprising results by including too many levels. Category contests generally works best for quite shallow, well-defined categories. Setting |maxdepth=0 means that pages must be direct members of the category, while |maxdepth=1 means a page can also be a member of one of the subcategories. Example:
{{UKB criterion | categories | Cakes | maxdepth=1 }}in the category Cakes
To exclude certain categories (and their subcategories), use |exclude=. Multiple categories can be separated by comma. Example:
{{UKB criterion | categories | Apes | exclude=Humans,Hominidaes in fiction }}in the category Apes
templates
the page must include a certain template. More specifically, the page must have included the given template in the parent revision of the first revision made by a participant. This means that the article is counted also if the participant removes the template, making this criterion suitable for maintenance contests where maintenance templates are removed as articles are improved.
{{UKB criterion | templates |Copy edit}}having the template {{Copy edit}}
Multiple templates can be specified. In that case, it's sufficient that at least one of them is included.
{{UKB criterion | templates |Citation needed|Unreferenced}}having at least one of the templates {{Citation needed}} or {{Unreferenced}}
Language prefix can be used, without leading colon:
{{UKB criterion | templates |Citation needed|no:Trenger referanse}}having at least one of the templates {{Citation needed}} or {{Trenger referanse}}
bytes
the page must be expanded with at least this number of bytes
{{UKB criterion | bytes | 1000 }}expanded with at least 1000 bytes
backlinks
the page must be linked from at least one of the specified articles (this can be an existing page or a list created just for the contest). Redirects are followd. Example:
{{UKB criterion | backlinks | List of people on the postage stamps of Gabon }}
linked to from List of people on the postage stamps of Gabon
forwardlinks
the page must link to at least one of the specified articles. Redirects are followed. Example:
{{UKB criterion | forwardlinks | United Nations | no:Forente nasjoner | nn:Dei sameinte nasjonane }}
that links to United Nations, Forente nasjoner or Dei sameinte nasjonane
namespace
the page must be part of one of the specified namespaces. Example:
{{UKB criterion | namespaces | 0 | 10 }}is a/an article or template
To limit to one site (the site must be a site supported by UKBot):
{{UKB criterion | namespaces | 0 | 10 | site=www.wikidata.org }}is a/an article or template at www.wikidata.org
pages
specific pages that count in the contest. Can be use when no other criteria are suitable. Example:
{{UKB criterion | pages | Arabian Peninsula | no:Den arabiske halvøy | nn:Den arabiske halvøya }}
Arabian Peninsula, Den arabiske halvøy or Den arabiske halvøya

Override the generated text[edit]

If the generated text is not suitable, it can be overriden using the parameter |description=. Example:

{{UKB criterion | namespaces | 0 | description=the main namespace }}

the main namespace

Combining multiple criteria[edit]

When combining multiple criteria, the following applies:

  • The criteria namespaces, new and existing must always be satisfied for a contribution to count. They relate to other criteria by logical conjunction.
  • For other types of criteria, at least one of them must be satisfied for a contribution to count. They relate to other criteria by logical disjunction.

For example, if you include criteria new, categories and sparql, the criteria are combined as new AND (categories OR sparql), so a contribution will count if it's to a new article that either is part of a given category tree or matches a given sparql query.

In the future, the bot will support arbitrary combinations of criteria. Syntax suggestions are welcome!

See also[edit]