Skip to main content

Wikibase Setup Guide

This guide explains how to set up and configure a local Wikibase instance for FOVEA.

Quick Start

  1. Start Wikibase services:
docker compose -f docker-compose.yml -f docker-compose.wikibase.yml up -d
  1. Configure FOVEA to use local Wikibase:

Create or update your .env file:

WIKIDATA_MODE=offline
WIKIDATA_URL=http://wikibase:8181/w/api.php
  1. Load initial data (optional):
docker compose -f docker-compose.wikibase.yml --profile loader run --rm wikibase-loader

Configuration

Environment Variables

VariableDefaultDescription
WIKIDATA_MODEonlineonline for public Wikidata, offline for local Wikibase
WIKIDATA_URLhttps://www.wikidata.org/w/api.phpWikidata/Wikibase API endpoint
WIKIBASE_ID_MAPPING_PATH/wikibase/id-mapping.jsonPath to ID mapping file (see ID Mapping)

Wikibase Service Configuration

VariableDefaultDescription
WIKIBASE_PORT8181Wikibase web interface port
WIKIBASE_ADMIN_USERadminMediaWiki admin username
WIKIBASE_ADMIN_PASSadminpass123MediaWiki admin password
WIKIBASE_DB_USERwikibaseMySQL username
WIKIBASE_DB_PASSwikibase_passwordMySQL password

Build-time Configuration

For frontend builds, you can bake in the Wikibase URL:

docker build \
--build-arg VITE_WIKIDATA_URL=http://wikibase:8181/w/api.php \
--build-arg VITE_WIKIDATA_MODE=offline \
-t fovea-frontend ./annotation-tool

Service Management

Start Services

# Start FOVEA with Wikibase
docker compose -f docker-compose.yml -f docker-compose.wikibase.yml up -d

# Include SPARQL query service
docker compose -f docker-compose.yml -f docker-compose.wikibase.yml --profile wdqs up -d

Stop Services

docker compose -f docker-compose.yml -f docker-compose.wikibase.yml down

View Logs

docker compose -f docker-compose.wikibase.yml logs -f wikibase

Reset Data

# Stop services and remove volumes
docker compose -f docker-compose.wikibase.yml down -v

Accessing Wikibase

Default Credentials

  • Username: admin
  • Password: adminpass123

Security Note: Change these credentials for production deployments.

Network Configuration

Wikibase services connect to the main fovea-network. Internal service URLs:

ServiceInternal URL
Wikibasehttp://wikibase:80
MySQLwikibase-mysql:3306
Elasticsearchwikibase-elasticsearch:9200

Health Checks

The Wikibase service includes a health check that verifies the API is responding:

curl http://localhost:8181/api.php?action=query&meta=siteinfo&format=json

Next Steps