Jump to content

Extension:SemanticRESTAPI

From mediawiki.org
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 1 (Ranked 140th)
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

[edit]
  • Install Extension:SemanticMediaWiki
  • Download and move the extracted SemanticRESTAPI folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticRESTAPI
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'SemanticRESTAPI' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

[edit]

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

[edit]