envlh / dicare-tools

Tools to contribute to and gather statistics about Wikimedia projects.
https://tools.dicare.org/
GNU Affero General Public License v3.0
3 stars 4 forks source link
wikidata

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

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:

Crontab

Jobs are described in the file conf/jobs.yaml.

On Wikimedia Toolforge, run the following command to load them:

toolforge-jobs load conf/jobs.yaml

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