Template:SPARQL Inline

Sparql output (query)

Documentation icon Template documentation[view · edit · history · purge ]

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

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
queryquery

The SPARQL query

Stringrequired
labellabel

The link label

Linesuggested
titletitle

Copies the label into the query as its title

Stringsuggested
pp

no description

Unknownoptional
qq

no description

Unknownoptional
vv

no description

Unknownoptional
extraprefixextraprefix

no description

Unknownoptional