Wikibase/Creating and deleting data/fr

Présentation
Ce guide donne un aperçu des outils et des techniques disponibles pour ajouter et supprimer des données dans Wikibase.



Créer des données


Quel outil utiliser ?


Importer une plus grande quantité de données

 * OpenRefine
 * WikibaseIntegrator



Réconcilier Wikibase avec des données importées d'un autre format et venant d'un autre dépôt

 * OpenRefine



Entrer différents types de données manuellement en s'assurant que tous les champs nécessaires sont présents

 * Cradle



Importer des données automatiquement avec Python

 * WikibaseIntegrator



Structurer les données à importer à partir d'un fichier texte à plat

 * QuickStatements

OpenRefine
OpenRefine is a data-wrangling tool that can be connected to a Wikibase as well as a wide variety of other data stores. Users of OpenRefine can transform and map their data to make it suitable for import into and reconciliation with Wikibase.

For information on using OpenRefine with Wikibase, see their documentation overview.

WikibaseIntegrator
Pour les utilisateurs familiers du langage de programmation Python, WikibaseIntegrator peut s'avérer être un outil très puissant pour ajouter des données dans Wikibase.

La documentation du dépôt de code contient des exemples utiles que vous pouvez réutiliser pour créer un robot ou un programme à exécution longue, pour importer vos données. Once authenticated and customized, your bot can import data with minimal intervention on your part.

Nous vous recommandons de lire soigneusement la documentation.

https://github.com/LeMyst/WikibaseIntegrator

QuickStatements
QuickStatements is a tool developed by one of the community's most prolific toolmakers, Magnus Manske, QuickStatements is the original tool for adding data into Wikibase.

QuickStatements accepts two forms of commands for batches: QuickStatements v1 and QuickStatements v2 (CSV).

As an example, we’ll present commands in both v1 and CSV format that perform the same action: creating a new item. For simplicity’s sake we’ll use items and properties from Wikidata, but of course these commands will look different when applied to your own Wikibase.

We’ll provide QuickStatements with:


 * a command to create a new item with a new QID (an item’s unique identifier number)
 * a Label in english (language code: English): “Doctor Worm”
 * a Description in english (language code: English): “1998 song performed by They Might Be Giants”
 * la propriété 
 * l'élément 

v1
QuickStatements v1 syntax is command-based, with one tab-separated line per command.

Voici à quoi ressemble notre exemple dans la syntaxe v1 :

CREATE LAST	Len	Doctor Worm LAST	Den	1998 song performed by They Might Be Giants LAST	P2650	Q128309

CSV
QuickStatements comprend aussi les commandes au format CSV. The first line is a header that defines the contents of each column; the lines that follow supply information to be applied to Wikibase according to the contents of each column's header.

Voici à quoi ressemble notre exemple dans la syntaxe CSV :

qid,Len,Den,P2650 ,Doctor Worm,1998 song performed by They Might Be Giants,Q128309



Entrées
Allez sur votre interface QuickStatements. For users of Wikibase Suite on Docker, QuickStatements comes preinstalled and is available at http://localhost:8840/. For users of Wikibase Cloud, QuickStatements is available in the left sidebar:

Click “New batch”. Paste your commands into the window and press the corresponding “Import” button for the format you’ve chosen.



On the next screen you’ll see a summary of what QuickStatements plans to do with your commands. If everything looks right, click “Run”.



Résultats
We've now created an item ("Doctor Worm", QID newly created) and a statement ("Doctor Worm is interested in drum kits"). You’ll see a regular item page much like the one in the screenshot.

For much, much more detailed information on QuickStatements, check outits help page.

Cradle
Another tool by Magnus Manske, Cradle allows the reliable manual creation of new Wikibase items using web forms or ShapeExpressions. Cradle is useful for Wikibase administrators who wish to allow creation of lots of items manually, all of which need to conform to a particular schema.

Voici comment commencer avec Cradle :


 * If you’re using Wikibase Suite, install the Cradle software. Wikibase Cloud offers Cradle already installed.
 * Write definitions for the input forms you want to use to perform your data entry. Vous pouvez faire l'une, l'autre, ou les deux choses suivantes :
 * Create form definitions on a special page in your Wikibase(Project:Cradle).
 * Install the EntitySchema extension (on Suite; the extension is installed on Cloud but not currently working). Then define some ShapeExpressions in the EntitySchema namespace on your Wikibase.

Formulaires
Using Cradle’s specification format, you can create a form in Cradle that prompts the user for the fields you specify. You define these forms on a special page in your wikibase: &lt;your_wikibase_url>/wiki/Project:Cradle (Suite and Cloud alike).

Voici un exemple de création de formulaire pour Cradle.

On Wikidata’s Cradle page there’s an “actor” form defined. La définition est similaire à :

actor

 * P21:hardselect:Q6581097,Q6581072|mandatory
 * P31:hardselect:Q5|mandatory
 * P106:hardselect:Q33999,Q2526255,Q28389,Q2059704|mandatory



This creates a form titled “actor” that prompts the user to fill in fields toward creating a new item.

In addition to the “Labels”, “Also known as” and “Descriptions” fields which appear in every form, this form prompts the user with the following three fields defined in the example above:


 * sex or gender (P21) - “hardselect” creates a chooser, offering two options, “male” (Q6581097) or “female” (Q6581072). This field is “mandatory”, meaning the user must make a choice in order to submit the form.
 * instance of (P31) - This “hardselect” creates a chooser with only one option, “human” (Q5), ensuring that every item created is an instance of a human being, which is of course the case for all possible entries in this form.
 * occupation (P106) - This chooser offers four options, of which the user must choose one: “actor” (Q33999), “film director” (Q2526255), “screenwriter” (Q28389) or “television director” (Q2059704).

Dans Cradle, le formulaire ressemble à ce que vous voyez à droite.

See this Wikidata page for more implementation examples.

ShapeExpressions
If you have the MediaWiki extension EntitySchema installed, you can also create forms like the example above in a different way: by defining schemas in your Wikibase’s EntitySchema namespace. (This feature doesn’t currently work on Wikibase Cloud.)

The syntax for these schemas is known as ShapeExpressions, a data modeling language. Once you’ve created a valid EntitySchema, you can enter its number in Cradle (“E12345”) to create forms with fields defined in that EntitySchema. Users then fill out those forms to create items, just as in the example above.



Here’s an example of creating an EntitySchema used by Cradle.

Wikidata has an EntitySchema for “newspaper clippings archives”:



That ShapeExpression definition produces a form in Cradle that appears as you see it on the right.

Pour des informations beaucoup plus complètes, voir :


 * https://github.com/magnusmanske/cradle
 * https://www.wikidata.org/wiki/Wikidata:Cradle
 * https://www.w3.org/2013/ShEx/Primer
 * https://shexspec.github.io/talks/2017/10-28-wikidatacon/#(1)

Deleting data
If you’ve imported data you didn’t intend to, or when you need to delete data for any other reason, and you’re a member of the Administrator’s group, you can delete the data on a given page. Simply follow these steps:


 * 1) Allez sur la page de l'élément que vous voulez supprimer.
 * 2) On the top right of the page, click “More” and select “Delete” from the drop-down.
 * 3) On the deletion page, select the reason and provide context as needed, then click the “Delete page” button.

If you’re a member of the Bureaucrats user group, you can use the Special:DeleteBatch page enabled by the DeleteBatch extension:


 * 1) Click on “Special pages” in the left sidebar.
 * 2) Find and select “Delete batch of pages”.
 * 3) Choisissez un nom d'utilisateur (probablement le votre) à afficher dans les journaux.
 * 4) Choisissez un motif de suppression.
 * 5) Donnez une liste de pages à supprimer, soit dans le champ textuel, ou chargées à partir d'un fichier texte.
 * 6) Click “Delete”.

If you wish to delete page revisions, read the corresponding section of the MediaWiki manual.