OpenStreetMap Wiki template equivalent to Wikidata Template:SPARQL2

Would be possible to have the Template equivalent to https://www.wikidata.org/wiki/Template:SPARQL2 on the OpenStreetMap wiki?

The https://wiki.openstreetmap.org/wiki/Template:SPARQL does exist, but uses https://sophox.org/, not https://query.wikidata.org/.

What I’m using now

At the moment I’m using as something like this (which requires both edit the code and the URL encoded link manually


# SPARQL here


[https://query.wikidata.org/#very-long-query-here Try it]

It works, but is a bit more verbose.

What I would like (if relevant to OSM Wiki)

The following code

{{SPARQL2|query=
SELECT ?item ?itemLabel
WHERE{
  ?item wdt:P31/wdt:P279* wd:Q1968122 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}}

would render similar to https://www.wikidata.org/wiki/Wikidata:WikiProject_IFRC/Queries

(However, the SPARQL2 could be different to explicitly hint that is to Wikidata, not Sophox)

5 posts - 3 participants

Read full topic


Ce sujet de discussion accompagne la publication sur https://community.openstreetmap.org/t/openstreetmap-wiki-template-equivalent-to-wikidata-template-sparql2/4762