Querying for queries
This help page describes how to query for information about inline queries. This is possible since Semantic MediaWiki 1.8.0 which introduced a mechanism to the parser functions #ask
, #show
followed by #concept
1 in Semantic MediaWiki 2.5.0 that automatically stores information for the page they are used on as a subobject. This information includes the depth, the format, the size and the string of the respective query. Starting with with Semantic MediaWiki 1.9.0 the duration2 was added and Semantic MediaWiki 2.5.0 brought information about it's parameters3.
This data can be queried as usual, e.g., to find out how many queries on the wiki use a particular format, or what are the largest queries.
Examples[edit]
- The total number of queries
{{#ask: [[Query size::+]] |format=count }}
Result: 14881
- The total number of pages containing queries
{{#ask: [[Has query::+]] |format=count }}
Result: 4602
- The number of queries that use the format "count"
{{#ask: [[Query format::count]] |format=count }}
Result: 1753
- The number of pages that use queries that use the format "list"
{{#ask: [[Has query.Query format::list]] |format=count }}
Result: 791
- Pages that have a query with format "ul" and one with format "table"
{{#ask: [[Has query.Query format::ul]] [[Has query.Query format::table]] |format=ul |limit=10 }}
Result:
- Abfragen abfragen
- Eingebettete Abfrage
- Eingebettete Abfrage 1.5.0 - 1.6.2
- Examples/Queries/Aggregating numbers
- Examples/Queries/Uri type regex query
- Help:Datatype "External identifier"
- Google pie format/zh-hans
- Google bar format/zh-hans
- Inline queries
- Inline queries
- The 10 largest queries used on the wiki with their size and duration
{{#ask: [[Has query::+]] |?Query size |?Query duration |sort=Query duration |order=desc |limit=10 }}
Result:
Querying for the query duration is not enabled for this wiki.
- The 10 largest queries used on the wiki with their size and query string
{{#ask: [[Query string::+]] |?Query size |?Query string |sort=Query size |order=desc |limit=10 }}
Result:
Query size"Query size" is a predefined property that collects the number of conditions used in a query and is provided by Semantic MediaWiki. | Query string"Query string" is a predefined property that describes the conditions of the query as a string and is provided by Semantic MediaWiki. | |
---|---|---|
SpecialPropertiesQueryProfiling | 18 | <q>[[Category:Special properties]] [[Has maximum version::still in use]] [[Has special property focus::query information]] [[Document status::effective]] [[Document language::en]] OR [[Category:Special properties]] [[Has maximum version::still in use]] [[Has special property focus::query information]] [[Docinfo status::effective]] [[Docinfo language::en]]</q> |
Chart related result formats | 16 | <q>[[Category:Result formats]] [[Has maximum version::still supported]] [[Has category::charts]] [[Docinfo status::effective]] [[Docinfo language::en]] OR [[Category:Result formats]] [[Has maximum version::still supported]] [[Has category::charts]] [[Document language::en]]</q> |
Google pie format | 14 | <q>[[Concept:ResultFormats]] [[Has category::charts]] [[Docinfo status::effective]] [[Docinfo language::en]] OR [[Concept:ResultFormats]] [[Has category::charts]] [[Document status::effective]] [[Document language::en]]</q> |
Google bar format | 14 | <q>[[Concept:ResultFormats]] [[Has category::charts]] [[Docinfo status::effective]] [[Docinfo language::en]] OR [[Concept:ResultFormats]] [[Has category::charts]] [[Document status::effective]] [[Document language::en]]</q> |
Jqplotpie format 1.5.1 - 1.6.2 | 14 | <q>[[Concept:ResultFormats]] [[Has category::charts]] [[Docinfo status::effective]] [[Docinfo language::en]] OR [[Concept:ResultFormats]] [[Has category::charts]] [[Document status::effective]] [[Document language::en]]</q> |
SpecialPages | 14 | <q>[[Category:Special pages]] [[Has maximum version::still available]] [[Document status::effective]] [[Document language::en]] OR [[Category:Special pages]] [[Has maximum version::still available]] [[Docinfo status::effective]] [[Docinfo language::en]]</q> |
Jqplotbar format | 14 | <q>[[Concept:ResultFormats]] [[Has category::charts]] [[Docinfo status::effective]] [[Docinfo language::en]] OR [[Concept:ResultFormats]] [[Has category::charts]] [[Document status::effective]] [[Document language::en]]</q> |
Jqplotbar format 1.5.1 - 1.6.2 | 14 | <q>[[Concept:ResultFormats]] [[Has category::charts]] [[Docinfo status::effective]] [[Docinfo language::en]] OR [[Concept:ResultFormats]] [[Has category::charts]] [[Document status::effective]] [[Document language::en]]</q> |
MaintenanceScripts | 14 | <q>[[Category:Maintenance scripts]] [[Has maximum version::still in use]] [[Document status::effective]] [[Document language::en]] OR [[Category:Maintenance scripts]] [[Has maximum version::still in use]] [[Docinfo status::effective]] [[Docinfo language::en]]</q> |
SpecialPagesObsolete | 14 | <q>[[Category:Special pages]] [[Has maximum version::!still available]] [[Document status::effective]] [[Document language::en]] OR [[Category:Special pages]] [[Has maximum version::!still available]] [[Docinfo status::effective]] [[Docinfo language::en]]</q> |
... further results |
References
- ^ Semantic MediaWiki: GitHub pull request gh:smw:1719
- ^ Semantic MediaWiki: GitHub pull request gh:smw:30
- ^ Semantic MediaWiki: GitHub pull request gh:smw:2270