Template:Wdquery
Jump to navigation
Jump to search
This template generates a link to perform a SPARQL query in the Wikidata:SPARQL query service.
Usage
[edit]Parameter 1 is the SPARQL query (you can also use the |query=
parameter for this), and parameter 2 is the text to display.
Wikicode:
{{wdquery|query=
SELECT ?property ?alias ?occurences WHERE {
hint:Query hint:optimizer "None" .
{
SELECT ?alias (COUNT (?alias) as ?occurences) WHERE {
?tmp a wikibase:Property .
?tmp skos:altLabel ?alias FILTER (LANG (?alias) = "en")
} GROUP BY ?alias
}
?property a wikibase:Property .
?property skos:altLabel ?alias FILTER (?occurences > 1) .
} ORDER BY ?alias|an example query}}
Result: an example query
See also
[edit]{{SPARQL Inline}}
— same as this template, but the primary link is to the query results page (with a secondary link to the non-executed query)
Inline link to a Wikidata Query Service SPARQL query
Parameter | Description | Type | Status | |
---|---|---|---|---|
1 | 1 | The link text
| Line | suggested |
query | query | The SPARQL query to use | String | required |
The above documentation is transcluded from Template:Wdquery/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |