Template:Ask
From HackerspaceWiki
This template was once used to query for everything related to certain pages, the rational being that queries that do not apply would not return results and not affect the page. However, even non-applicable queries need to be computed, and the resulting unnecessary performance impact is the reason why this template now is strongly deprecated.
Please remove this template whenever it occurs on some page.
Query templates still are a good idea, but they should be topic-specific. Examples are the templates Template:Institution data and Template:Event series. Often, such topic specific templates may also be combined with suitable annotations (e.g. categories for that topic).
Standard queries and links: <ask link=all mainlabel=object>|:Category:+||Relation:+||Attribute:+||Template:+part of::Template:Ask*</ask><ask link=all mainlabel=whole>|:Category:+||Relation:+||Attribute:+||Template:+has part::Template:Ask*</ask><ask link=all mainlabel=subevent>|:Category:+||Relation:+||Attribute:+||Template:+subevent of::Template:Askevent</ask><ask link=all mainlabel=subtopic>|:Category:+||Relation:+||Attribute:+||Template:+subtopic of::Template:Asktopic</ask><ask link=all mainlabel="extended object">|:Category:+||Relation:+||Attribute:+||Template:+extends::Template:Ask**</ask><ask link=all mainlabel="software/extension">|:Category:+||Relation:+||Attribute:+||Template:+operational on::Template:Ask*</ask><ask link=all mainlabel=event>|:Category:+||Relation:+||Attribute:+||Template:+Template:Ask From To City Country</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+Template:Ask**</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+Template:Ask***</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+Template:Ask**</ask><ask link=all mainlabel=object>|:Category:+||Relation:+||Attribute:+||Template:+in street::Template:Ask***</ask><ask link=all mainlabel=city>|:Category:+||Relation:+||Attribute:+||Template:+capital of::Template:Ask*</ask><ask link=all mainlabel=area>|:Category:+||Relation:+||Attribute:+||Template:+has capital::Template:Ask*</ask><ask link=all mainlabel=area>|:Category:+||Relation:+||Attribute:+||Template:+borders::Template:Ask*</ask><ask link=all mainlabel=object>|:Category:+||Relation:+||Attribute:+||Template:+member of::Template:Ask*</ask><ask link=all mainlabel=object>|:Category:+||Relation:+||Attribute:+||Template:+has member::Template:Ask*</ask><ask link=all mainlabel=object>|:Category:+||Relation:+||Attribute:+||Template:+instance of::Template:Ask*</ask><ask link=all mainlabel=subject>|:Category:+||Relation:+||Attribute:+||Template:+has category::Template:Ask*</ask><ask link=all mainlabel=category>|:Category:+||Relation:+||Attribute:+||Template:+category about::Template:Askabout</ask><ask link=all mainlabel=country>|:Category:+||Relation:+||Attribute:+||Template:+uses currency::Template:Ask*</ask><ask link=all mainlabel=country>|:Category:+||Relation:+||Attribute:+||Template:+uses currency::instance of::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+presented at::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+accepted by::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+coded in::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+made of::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+inverse::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+related::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+about::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+has attribute::Template:Ask*</ask><ask link=all>|:Category:+||Relation:+||Attribute:+||Template:+similar::Template:Ask*</ask><ask link=all mainlabel=relation>|:Category:+||Relation:+||Attribute:+||Template:+relation equal to attribute::Template:Askequal attribute</ask>
This template is called from many pages of all kinds and executes many queries to find various info related to the page, including info related to an attribute value equal to the pagename. For server efficiency it is being replaced by templates specific to a page category; they also add the category tag, see Relation:Category added by template; from each of these templates queries which cannot be applicable to pages in that category have been removed. See its discussion page for criticism of this approach. This template requires the MetaWikiPedia:ParserFunctions extension. To substitute the template, use {{subst:ask|subst=subst:}}. If the page concerned is a relation, attribute or category page it generates a table of all instances of this property, unless the template is called with parameter "list=no". The latter is useful if an adapted version of the table is made separately, to avoid duplication. In general it shows various directly and indirectly related pages and values. For this purpose the template contains many queries regarding specific relations and attributes. In the case of an attribute of other than string type, a pagename which is not a valid value would produce all instances of the attribute concerned. Therefore such attributes have not been used in selection parts of the queries. Use is made of the fact that if the set of pages selected in a query is empty, no header row or blank line, not even any blank space, is produced, so that queries which are not applicable do not clutter the output. Some query results have CSS class "indirectlyrelevant". They are hidden by default but can be seen with the CSS code: .indirectlyrelevant {display: block !important } The template provides links for searching the Web, and searching all Wikipedias. Parameter st is the search phrase, with as default the pagename (with spaces, not underscores). This part has CSS class "searchlinks". It is also hidden by default, but enabled with the CSS code: .searchlinks {display: block !important }