/dicare-tools-1

Tools to contribute to and gather statistics about Wikimedia projects.

Primary LanguagePHPGNU Affero General Public License v3.0AGPL-3.0

Description

Dicare Tools are a set of tools to contribute to and to gather statistics about Wikimedia projects.

dicare-tools is a web project.

Installation

This documentation covers the installation of Dicare Tools under a Linux system, at the URL https://tools.dicare.org/.

Requirements

  • a web server (seems OK with Apache and nginx)
  • PHP 7+, with curl, intl (only for Lexemes Party and Lexemes Challenge), and mysqli
  • MySQL 5.7+ (seems OK with MariaDB)
  • Java 8+ (only for Related Properties and Related Projects)

Web server

Copy all files from the project dicare-tools into /var/www/tools.dicare.org.

Configure a new site on your web server, with /var/www/tools.dicare.org/www as the root directory.

An example of nginx site configuration is available in doc/nginx.example.conf.

MySQL

Dicare Tools require a MySQL database.

You can install the MySQL server using the official repositories.

Create a new database on your MySQL server:

CREATE DATABASE `dicare` DEFAULT CHARACTER SET 'utf8mb4';

Create a user (change the password):

CREATE USER 'dicare'@'localhost' IDENTIFIED BY 'xxxxxxx';

Grant to the user all rights on the database:

GRANT ALL ON `dicare`.* TO 'dicare'@'localhost';

Grant to the user the right to access files:

GRANT FILE on *.* to 'dicare'@'localhost';

Initialize the schema with the script doc/schema.sql.

Dependency

Related Properties and Related Projects require the project dicare-tools-import.

Copy the file wdtk-import.jar (generated by the project dicare-tools-import) into the scripts directory.

By default, Wikidata JSON dumps are stored in /home/wikidata/dumpfiles (see the project dicare-tools-import to change that). This directory must be readable and writable by the user who starts the imports.

Configuration

Main configuration

Create the file conf/conf.inc.php, using the example conf/conf.example.php.

Most important variables are:

  • DB_HOST: host of the MySQL server
  • DB_USER: MySQL user
  • DB_PASSWORD: password of the MySQL user
  • DB_NAME: name of the MySQL schema
  • SITE_DIR: URL of Dicare Tools
  • SITE_STATIC_DIR: URL of the directory with static web resources of Dicare Tools

Crontab

Example on Wikimedia Toolforge:

4 4 * * * jsub -N maintenance -once bash /data/project/dicare/dicare-tools/scripts/maintenance.cron.sh
1 * * * * jsub -N lexemes-challenge -once bash /data/project/dicare/dicare-tools/scripts/lexemes-challenge.cron.sh

Imports

Names statistics

To force an update, go into the scripts directory and use the following command:

bash name.cron.sh

Related Properties and Related Projects

To start an import, go into the scripts directory and use the following command:

bash import.sh

By default, the import use the last JSON dump, downloading it if it is not already present on the server.

You can import another dump by specifying the date of the dump as a parameter:

bash import.sh 20180604

In that case, the JSON dump must be already present on the server.

Copyright

This project is under AGPLv3 license. See LICENSE, NOTICE, and CONTRIBUTORS files for complete credits.

See also