Skip to content

A MediaWiki extension for wbstack.com with some wikibase specific wikitext functionality

License

Notifications You must be signed in to change notification settings

wbstack/mediawiki-extensions-WikibaseInWikitext

Repository files navigation

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>

The option list="1" prepends a list of used Property (P-numbers) and Items (Q-numbers) to the presentation of the query.

The option tryit="1" appends a link to execute the query on the local Wikibase based on the global $wgWikibaseInWikitextSparqlDefaultUi

About

A MediaWiki extension for wbstack.com with some wikibase specific wikitext functionality

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages