Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1021 Bytes

File metadata and controls

38 lines (26 loc) · 1021 Bytes

mediawiki-extensions-WikibaseInWikitext

Adds the "sparql" tag for rendering SPARQL with some helpful things around it such as list of entities referenced and a link to try it in a sparql UI.

Also hooks in with syntaxhighlight if provided to make it look pretty.

This is currently intended for use on https://wbstack.com and might change without release notes etc.

Settings:

Installation

Download the extension into your MediaWiki extensions directory.

In your LocalSettings.php

wfLoadExtension('WikibaseInWikitext');
$wgWikibaseInWikitextSparqlDefaultUi = 'URL TO YOUR QUERY UI HERE';

Usage

This extensions functionality can be used in wikitext

<sparql list="1" tryit="1">
#Cats
SELECT ?item ?itemLabel 
WHERE 
{
  ?item wdt:P31 wd:Q146.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
</sparql>