User:Lucas Werkmeister/Ranker

From Wikidata
Jump to navigation Jump to search

Ranker is a tool to edit the rank of multiple Wikidata statements at once. (Test Wikidata, Wikimedia Commons and Test Wikimedia Commons are also supported.)

Usage[edit]

To start using the tool, go to its index page, enter the wiki you want to edit, the ID of the entity you want to edit (usually an item ID like Q42, but can also be some other kind of entity), and the ID of the property selecting the statement group you want to edit, then click the Select statements button. (Alternatively, you can use the user script to directly go to the tool from a page on Wikidata, see below.) The tool will then load and show you all the statements using that property on the given entity. If the statements have qualifiers, or a rank other than normal rank, those will be shown as well. You can select the statements that you want to edit using the checkboxes on the left, optionally add an edit summary to explain your change, then click one of the buttons at the bottom: Set to preferred rank, Set to normal rank, or Set to deprecated rank to set all selected statements to the given rank, or Increment rank to change deprecated-rank statements to normal and normal-rank ones to preferred.

If the tool is used with a MediaInfo entity (i.e. on Wikimedia Commons), then the two available buttons are instead labeled Mark as prominent and Mark as not prominent, to reflect the different usage of ranks in Structured Data on Commons. (Increment rank is not available in this mode, since it would be no different from Mark as prominent.)

Batch mode[edit]

The tool also features several batch modes. All of them let you edit the rank of many statements across different edits; they differ by whether statements are provided as a list or via a SPARQL query, and whether they perform the same action (set or increment rank) for all statements or specify a target rank for each individual statement.

Batch edits are made as soon as you submit the web form with the statements to edit, and the page will keep “loading” until the edits are done. This can take a while if you listed a lot of statements – it’s probably best not to close the tab, even if it appears “stuck”. (Closing the tab won’t affect how the batch runs, but then you won’t see the results at the end.) Once a batch has been submitted, it can’t be aborted.

List statements, same action for all[edit]

This batch mode (Wikidata link) specifies the statements as a plain-text list, and performs the same action for all of them, selected with one of the buttons at the bottom: set to preferred/normal/deprecated rank, or increment rank. (These are the same buttons as in non-batch mode, see above for details.) Statements are identified by their statement ID, which looks like an entity ID, a dollar sign, and then a GUID; the list contains one statement ID per line. (Note that, depending on when the statement was created, both the entity ID and the GUID part may be in upper- or lowercase; specify each statement’s ID exactly as it appears in the entity, even if the case looks inconsistent between different statements.)

List statements, individual rank per statement[edit]

This batch mode (Wikidata link) specifies both statements and ranks as a plain-text list. In each line, statement and rank are separated either by a pipe character (|) or by a tab; the pipe is more convenient for manual input, while the tab allows you to prepare the statement IDs and ranks in a spreadsheet or table, and then copy them into rank mode. (This is similar to QuickStatements.) The rank should be one of the words deprecated, normal, or preferred.

Query statements, same action for all[edit]

This batch mode (Wikidata link) selects the statements via a SPARQL query, and performs the same action for all of them, as in the list version. The SPARQL query should select a variable named ?statement (other variables can also be included, and will simply be ignored), which should select statement nodes, such as wds:Q474472-dcf39f47-4275-6529-96f5-94808c2a81ac.

This mode is only available for wikis that have a query service (i.e. Wikidata and Wikimedia Commons, but not their test versions).

Query statements, individual rank per statement[edit]

This batch mode (Wikidata link) selects the statements and ranks via a SPARQL query. The query should select variables named ?statement and ?rank (other variables are ignored); ?statement should be a statement node as in the other query mode, while ?rank should be one of the constants wikibase:DeprecatedRank, wikibase:NormalRank, or wikibase:PreferredRank.

This mode is also only available for wikis with a query service.

User script[edit]

The user script User:Nikki/Ranker.js adds links to go to Ranker directly from an entity page on Wikidata. To use it, add the following line to your common.js:

mw.loader.load( '//www.wikidata.org/w/index.php?title=User:Nikki/Ranker.js&action=raw&ctype=text/javascript' );

Then, you can look for the links which the script adds to each statement group (at the end of the property name), and click them to start editing that statement group using Ranker.

Monitoring[edit]

You can see edits made using this tool on the recent changes list.