In this section, we present how to connect MediaWiki to MindsDB.

MediaWiki is a free and open-source wiki software platform that is designed to enable the creation and management of wikis. It was originally developed for and continues to power Wikipedia. MediaWiki is highly customizable and can be used to create a wide range of collaborative websites and knowledge bases.

Data from MediaWiki can be utilized within MindsDB to train AI models and chatbots using the wide range of available information.

Prerequisites

Before proceeding, ensure the following prerequisites are met:

  1. Install MindsDB locally via Docker or Docker Desktop.
  2. To connect MediaWiki to MindsDB, install the required dependencies following this instruction.
  3. Install or ensure access to MediaWiki.

Connection

This handler was implemented using MediaWikiAPI, the Python wrapper for the MediaWiki API.

There are no connection arguments required to initialize the handler.

To connect the MediaWiki API to MindsDB, the following CREATE DATABASE statement can be used:

CREATE DATABASE mediawiki_datasource
WITH ENGINE = 'mediawiki'

Usage

Now, you can query the MediaWiki API as follows:

SELECT * FROM mediawiki_datasource.pages

You can run more advanced queries to fetch specific pages in a defined order:

SELECT *
FROM mediawiki_datasource.pages
WHERE title = 'Barack'
ORDER BY pageid
LIMIT 5