Template:SPARQL Inline/doc
Jump to navigation
Jump to search
This is a documentation subpage for Template:SPARQL Inline. It contains usage information, categories, and other content that is not part of the original template page. |
Template:SPARQL Inline is a Wikidata template which aim is to have an inline version of {{SPARQL}}
with direct link to the results of the query. The code use {{SPARQLText}}
.
{{SPARQL Inline}}
is used by other templates such as {{Item documentation}}
, {{Item classification}}
, {{TP organization}}
, {{TP administrative area}}
, etc. {{Item documentation}}
is included in talk page header for all items in Wikidata.
Warnings :
- If you use the pipe character ("|") in your query, you need to replace it with {{!}}.
Usage[edit]
{{SPARQL Inline
|label = Number of items with {{Label|P735}} {{Label|Q346047}}
|query = SELECT ?nature ?natureLabel (COUNT(?item) AS ?count) WHERE {
?item wdt:P735 wd:Q346047;
wdt:P31 ?nature.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?nature ?natureLabel
ORDER BY DESC (?count)
}}
Number of items with given name Ada (query)
See also[edit]
{{Wdquery}}
— same as this template, but links (only) to the non-executed query, rather than to the results page{{SPARQL}}
— block version of this template (shows the code of the query in the page){{SPARQL2}}
{{SPARQLText}}
{{SPARQL Box}}
inline link to Wikidata Query Service SPARQL, with direct link to the results of the query
Parameter | Description | Type | Status | |
---|---|---|---|---|
query | query | The SPARQL query | String | required |
label | label | The link label | Line | suggested |
title | title | Copies the label into the query as its title | String | suggested |
p | p | no description | Unknown | optional |
q | q | no description | Unknown | optional |
v | v | no description | Unknown | optional |
extraprefix | extraprefix | no description | Unknown | optional |