Difference between revisions of "Template:SPARQL2"

From DiSSCo Modelling Framework
Jump to navigation Jump to search
m (1 revision imported: Import of useful Templates and Modules from Wikidata)
(adjusted Query Service URL)
 
Line 30: Line 30:
 
min-width: 20em;"}}
 
min-width: 20em;"}}
 
<!--
 
<!--
--><div class="displayonly">[//query.wikidata.org/#{{urlencode: {{SPARQLText|query={{{query}}}|extraprefix={{{extraprefix|}}} }} | PATH }} {{Int try it}}]</div>{{Clear}}</onlyinclude><noinclude>
+
--><div class="displayonly">[{{MediaWiki:QueryServiceURL}}#{{urlencode: {{SPARQLText|query={{{query}}}|extraprefix={{{extraprefix|}}} }} | PATH }} {{Int try it}}]</div>{{Clear}}</onlyinclude><noinclude>
 
<templatedata>
 
<templatedata>
 
{
 
{

Latest revision as of 08:31, 14 March 2022

{{SPARQL2|start=3|highlight=1|query=3}}

The following query uses these:

33

{{SPARQL2|highlight=2|query=1 2}}

The following query uses these:

11
22

{{SPARQL2|nohints=test|query=...}}

1SELECT ?pop WHERE {
2   wd:Q2807 wdt:P1082 ?pop
3}

{{SPARQL2|query=...}}

The following query uses these:

  • Properties: P1082
    1SELECT ?pop WHERE {
    2   wd:Q2807 wdt:P1082 ?pop
    3}
    

The following query uses these:

1{{{query}}}

This template displays SPARQL query with syntax highlighting, used items and link to WDQS query site to run the query. TODO: used items labels are not localized

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
queryquery sparql

SPARQL query

Example
SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1
Stringrequired
Extraprefixextraprefix

Extra prefixes to be added

Example
PREFIX wikibase: <http://wikiba.se/ontology#>
Stringoptional