Extension:SemanticRESTAPI

From Linux Web Expert

MediaWiki extensions manual
SemanticRESTAPI
Release status: stable
Implementation API
Description Get data from Semantic MediaWiki through the REST API
Author(s) Sophivorustalk
Latest version 2.0 (2023-11-01)
MediaWiki 1.39+
PHP 7+
Database changes No
License GNU General Public License 3.0 or later
Download
Example [1]
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the SemanticRESTAPI extension if it is available at translatewiki.net

The Semantic REST API extension adds an endpoint to the MediaWiki REST API that gives access to semantic data from Semantic MediaWiki.

Installation

  • Install Extension:SemanticMediaWiki
  • <translate> [[<tvar name=2>Special:ExtensionDistributor/SemanticRESTAPI</tvar>|Download]] and move the extracted <tvar name=name>SemanticRESTAPI</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticRESTAPI
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'SemanticRESTAPI' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Usage

Once installed, simply browse to the following URL pattern to get a JSON with all the semantic data of a given page:

https://www.example.com/w/rest.php/v1/page/Title_of_the_page/semantic

For example, compare this and this.

See also