Shortcut: Help:QS

Help:QuickStatements/ru

From Wikidata
Jump to navigation Jump to search

Значок, используемый шаблонами Викисклада, которые могут пополнять Викиданные с помощью QuickStatements
QuickStatements
2019 Coolest Tool Award Winner
in the category
Editor

QuickStatements (QS) — это инструмент для редактирования элементов Викиданных с помощью простого набора команд. Инструмент позволяет добавлять и удалять утверждения (statements), метки (labels), описания (descriptions) и синонимы (aliases), а также добавлять утверждения с необязательными квалификаторами и источниками. Последовательность команд вводится либо прямо в окне импорта, либо предварительно создаётся в электронной таблице или текстовом редакторе, затем копируется в буфер и вставляется в это окно. Можно также создавать всё это с помощью внешнего программного кода, например на Lua, вызываемого из шаблона и передаваемого в виде URL. Данные, отредактированные в OpenRefine, также пригодны для экспорта в формат QuickStatements.

Инструменты[edit]

Инструмент QuickStatements был несколько раз изменен и переписан. По возможности необходимо всегда использовать текущую версию инструмента. Доступны следующие версии QuickStatements:

  • QuickStatements версия 2 (V2) переписано или новый интерфейс (текущая версия)
  • История версий
    • QuickStatements версия 2 (V2) исходный или старый интерфейс (перестала работать с момента переезда на quickstatements.toolforge.org)
    • QuickStatements версия 1 (V1) (работает но больше не поддерживается)

Синтаксис между версиями может слегка отличаться. Дальнейший текст на этой странице описывает синтаксис текущей версии, но при этом помечены части, которые не поддерживаются в прошлых версиях.

Синтаксис последовательностей команд[edit]

В данном разделе описывается синтаксис, используемый после версии V1 инструмента, которую иногда называют команды V1[1].

Добавление утверждений[edit]

Вы можете указывать утверждения вручную или вводя/вставляя их в текстовое поле. Разделять части утверждений нужно символом TAB или "|"[2]. Каждая команда должна находиться на новой строке либо можно использовать разделитель "||"[2].

Совет: вы можете использовать электронные таблицы вроде Microsoft Excel или LibreOffice Calc; при копировании ячеек в буфер обмена и их последующей вставке в текстовое поле символы табуляции TAB добавятся автоматически. Некоторые текстовые редакторы, такие как Notepad++, также позволяют заменить любой символ на TAB (\t).

Каждое утверждение должно состоять из сущности, a свойства и значения свойства. Сущность может быть элементом, свойством, лексемой[2], формой[2] или смыслом[2]. Значение в зависимости от типа данных свойства может быть другим элементом, строкой, временем, координатами или численным значением, или же специальным значением somevalue или novalue (см. Unknown or no values).

Формат каждого блока:

  • Элементы Викиданных всегда указываются в формате Qxx. На Викискладе они всегда в формате Mxx. В QuickStatements версии 1 можно было использовать название статьи вместо q-кода, если заполнить значение xxwiki в поле ввода над текстовой областью; в этом случае номер элемента (при его наличии) определялся автоматически.
    Пример: Q4115189 TAB P31 TAB Q1
    Смысл: добавить в элемент Wikidata Sandbox (Q4115189)instance of (P31)Universe (Q1)
  • Свойства в формате Pxx.
  • Лексемы в формате Lxxx.
  • Формы в формате Lxxx-Fyy.
  • Значения в формате Lxxx-Syy.
  • Строки (включая адреса сайтов, а также числовые значения текстовых полей, например, значения внешних ID свойств) должны находиться в "двойных кавычках". Значения многих утверждений имеют строковый формат, включая внешние идентификаторы (например, VIAF ID (P214)), имена файлов (например, image (P18)) или названия других страниц (например, Commons category (P373)).
    Пример: Q41576278 TAB P373 TAB """Antoni Ignacy Mietelski"""
    Смысл: добавить в элемент Antoni Ignacy Mietelski (Q41576278)Commons category (P373)Antoni Ignacy Mietelski
    Внимание! Некоторые символы в строке могут неправильно восприниматься инструментом. Такие символы включают:: "_" (нижнее подчеркивание), " (двойную кавычку), " " (пробел), "=" и, возможно, другие. Добавление адресов сайтов, включающих такие символы, например такого или такого может быть неуспешным. Добавление строк и адресов сайтов с такими символами может быть успешным при работе с инструментом при помощи интерфейса, но неуспешным при работе через URL.
  • Моноязычный текст представляет собой код языка, двоеточие и текст в "двойных кавычках", например, en:"Some text"
    Пример: Q1214098 TAB P1476 TAB pl:"Krzyżacy"
    Смысл: добавить в элемент The Knights of the Cross (Q1214098)title (P1476)"Krzyżacy" (Polish)
  • Временные значения должны быть в формате, например, +1967-01-17T00:00:00Z/11, где /11 обозначает точность. Точность может быть: 0 - миллиард лет, 1 - сто миллионов лет, ..., 6 - тысячелетие, 7 - век, 8 - декада, 9 - год (по умолчанию), 10 - месяц, 11 - день, 12 - час, 13 - минута, 14 - секунда.
    Пример: Q41576483 TAB P569 TAB +1839-00-00T00:00:00Z/9
    Смысл: добавить в элемент Bronisław Podbielski (Q41576483)date of birth (P569)+1839
    Используйте «-» для дат до нашей эры и задавайте не меньше 4 цифр.
    Set an additional "/J" if you want to set the date in Julian Calendar (see this list to understand where this should be done).
    Если вводить значения через API, требуется использовать символы %09 вместо TAB, %2B вместо +, %3A вместо : и %2F вместо /.
  • Координаты надо указывать в формате @LAT/LON при этом LAT и LON должны быть десятичными числами.
    Пример: Q3669835 TAB P625 TAB @43.26193/10.92708
    Смысл: добавить координаты для San Dalmazio (Q3669835)
  • Численные значения в формате amount~toleranceUxx[2], где amount и tolerance – рациональные числа, а Uxx – номер элемента единицы изменения (Qxx). Значения Unit и tolerance являются необязательными. Не оставляйте пробелы в определении численного значения.
    В QuickStatements версии 1 использовался другой синтаксис для численных значений: amount[lower,upper]Uxx, где amount, lower и upper – рациональные числа.
    lower, upper являются необязательными и должны либо одновременно присутствовать, либо одновременно отсутствовать. Если оба значения присутствуют, они должны быть указаны в квадратных скобках и разделены ,
    amount, lower and upper must use . as decimal separator, must not use any thousands separator and may be prefixed by "+" or "-".
    10, 10U11573, -10[-12.5,-7.5], 0[-5,5]U11573 are all valid quantities (where U11573 indicates metre (Q11573))
    Quantities with tolerance may be entered as 1.2~0.3 in QuickStatements version 2, which is the same as 1.2[0.9,1.5] in QuickStatements version 1 and means 1.2±0.3. [3]
  • somevalue for unknown value Help
  • novalue for no value Help. Both novalue and somevalue should be used without double quotes around it. Both of those statements do work as part of item creation statements using CREATE and LAST keywords.


Добавление утверждения с квалификаторами[edit]

Каждый «триплет» утверждений может сопровождаться неограниченных числом «квалификаторных пар» property TAB value.

Пример: Q41577083 TAB P570 TAB +1586-00-00T00:00:00Z/7 TAB P1319 TAB +1586-00-00T00:00:00Z/9
Смысл: добавить к Gian Federigo Bonzagna (Q41577083)date of death (P570)16. centuryearliest date (P1319)+1586

Добавление утверждения с источниками[edit]

Каждое утверждение может иметь неограниченное количество источников source property TAB value. Источник как свойство аналогичен «обычным» свойствам, но называется в формате Sxx, а не Pxx.

Пример: Q22124656 TAB P21 TAB Q6581097 TAB S143 TAB Q24731821 TAB S813 TAB +2017-10-04T00:00:00Z/11
Смысл: добавить для Gotō Ichijō (Q22124656)sex or gender (P21)male (Q6581097) источник imported from Wikimedia project (P143)Commons Creator page (Q24731821)retrieved (P813)

By default, all sources will go into the same "reference group" (a block of property/value pairs). If you want to create more than one reference group in a single command row, simply prefix the first source property of the new group with an exclamation mark: "!Sxx" instead of "Sxx". (In the first reference group, the "!" is optional and will not influence the outcome.)

На заметку:

  • Existing statements with an exact match (property and value) will not be added again; however additional references might be added to the statement.
  • You can mix qualifiers and references in the same statement. Just use Sxx instead of Pxx when using sources.
  • In QuickStatements version 1 each source claim represented an individual reference, i.e. they were not grouped within one reference; it works properly now in QuickStatements version 2.


Добавление меток, псевдонимов, описаний и интервики[edit]

Как и при добавлении простых текстовых утверждений каждая команда должна состоять из элемента, команды и строки string в двойных кавычках.

  • Чтобы добавить элементу метку на определённом языке, используйте «Lxx» вместо свойства (где «xx» — код языка).
    Пример: Q340122 TAB Lpl TAB "Cyprian Kamil Norwid"
    Смысл: добавить метку на польском «Cyprian Kamil Norwid» для Cyprian Norwid (Q340122)
  • Чтобы добавить элементу синоним на определённом языке, используйте «Axx» вместо свойства (где «xx» — код языка).
    Пример: Q340122 TAB Aen TAB "Cyprjan Kamil Norwid"
    Смысл: добавить синоним на польском «Cyprjan Kamil Norwid» для Cyprian Norwid (Q340122)
    Совет: Возможно добавлять сразу по несколько синонимов, разделяя их вертикальной линией («|»).
    Пример: Q340122 TAB Aen TAB "Cyprian Kamil Norwid|Cypryan Kamil Norvid"
  • Чтобы добавить элементу описание на определённом языке, используйте «Dxx» вместо свойства (где «xx» — код языка).
    Пример: Q340122 TAB Dde TAB "polnischer Dichter"
    Смысл: добавить описание на немецком «polnischer Dichter» для Cyprian Norwid (Q340122)
  • Чтобы добавить элементу интервики на определённую страницу проекта Викимедиа, используйте «Sxxx» вместо свойства (где «xxx» — код проекта: например, ruwiki, commonswiki).
    Пример: Q340122 TAB Szhwiki TAB "塞浦路斯·諾爾維特"
    Смысл: добавить интервики на китайскую Википедию (塞浦路斯·諾爾維特) для Cyprian Norwid (Q340122)

Если вы хотите удалить метку/описание/интервики, используются те же команды с пустой строкой в качестве значения.

Создание элементов[edit]

Вы можете создать новые элементы, просто добавляя строки, которые содержат одно ключевое слово "CREATE". Для добавления statements для последнего созданного элемента, используйте ключевое слово "LAST" или Q number, and the statement will be added to the last created item.

Пример создания нового элемента, добавления интервики и установки метки:

CREATE
LAST TAB Sfrwiki TAB "Le croissant magnifique!"
LAST TAB Lfr TAB "Le croissant magnifique!"
Смысл: создание нового элемента со ссылкой на французскую Википедию w:fr:Le croissant magnifique! и с меткой французского языка "Le croissant magnifique!"

Properties may be created in the same way with "CREATE_PROPERTY" followed by a TAB or | and the entity type, e.g. one of:

commonsMedia, globe-coordinate, wikibase-item, wikibase-property, string, monolingualtext, external-id, quantity, time, url, math, geo-shape, musical-notation, tabular-data, wikibase-lexeme, wikibase-form, wikibase-sense.

This is mostly of use on third-party Wikibase instances, as property creation is restricted on Wikidata.

Объединение элементов[edit]

Вы можете слить (смержить) два элемента. Первый элемент мержится и (при успехе) перенаправляется на второй.

MERGE TAB Qsource TAB Qdestination

Удаление утверждений[edit]

Вы можете удалить определённые утверждения, добавив в начало строки «-»[2].

Пример: -Q4115189 TAB P31 TAB Q1
Смысл: удалить из Wikidata Sandbox (Q4115189)instance of (P31)Universe (Q1)

Dates with precision>9 can be removed via their specific date:

-Q98426308	P585	+1988-05-11T00:00:00Z/11

Dates with precision≤9 may use either 00-00 or 01-01 as their month-date value, so it may be necessary to attempt to remove both:

-Q98426308	P585	+1988-01-01T00:00:00Z/9
-Q98426308	P585	+1988-00-00T00:00:00Z/9

In addition you may remove statements with a specific statement ID using the following syntax:

-STATEMENT TAB Q1$00000000-0000-0000-0000-000000000000

The statement ID can be received by:

  • The source code of any entity page, where the ID may be found in the <div> elements with "wikibase-statementview" class
  • API
  • name of statement node in RDF which may be queried by query service (you need to replace the - after entity ID with $)

Комментарии[edit]

Каждая команда в конце может включать комментарий, который будет помещён в описание правки[2]. Используйте синтаксис /* ... */. Перед этим может стоять TAB. Пробелы вокруг комментария автоматически удаляются перед обработкой. Инструмент разделяет на две правки добавление заявления и источника. При импортировании «формата версии 1», по-видимому, невозможно задать комментарий к правке, добавляющей источник. Он помещается в описание правки, добавляющей утверждение (если оно на тот момент не существовало и в принципе добавляется).

Пример: Q4115189 TAB P31 TAB Q1 /* Это комментарий. */
Meaning: add to Wikidata Sandbox (Q4115189)instance of (P31)Universe (Q1), with "This is a comment." in the edit summary.


Синтаксис CSV-файлов[edit]

Команды[edit]

In QuickStatements version 2, one can also cut and paste a properly structured CSV file as an alternative to the syntax introduced in QuickStatements version 1. The CSV file will specify commands to execute. The first row is a header describing how the columns are interpreted.

qid
Всегда в первой колонке: редактируемый элемент или сущность. Если не указано, создаётся новый элемент. См. пример создания элемента ниже.

В других колонках могут находиться такие команды:

P1234
A property ID (uppercase) begins a new statement. The column value specifies the main value of the statement, in QuickStatements version 1 syntax.
qal1234
A lowercase "qal" followed by a property number (without "P") adds a qualifier to the current statement. The column value specifies the value of the qualifier, in QuickStatements version 1 syntax. There must be some "P" column before a "qal" column to specify which statement the qualifier is added to.
S1234
An uppercase "S" followed by a property number (without "P") begins a new source for the current statement. The column value specifies the value of the source, in QuickStatements version 1 syntax. There must be some "P" column before an "S" column to specify which statement the source is added to.
s1234
A lowercase "s" followed by a property number (without "P") adds another property-value pair to the current source. The column value specifies the value of the source, in QuickStatements version 1 syntax. There must be some "S" column before an "s" column to specify which source the property-value pair is added to.
Len
An uppercase "L" followed by a language code sets the label in that language.
Dfr
An uppercase "D" followed by a language code sets the description in that language.
Ade
An uppercase "A" followed by a language code adds an alias in that language.
Senwiki
An uppercase "S" followed by a site ID adds a sitelink to that site.
#

A number sign character sets the edit summary (comment) of the preceding command. The tool splits adding of a claim and its reference in two edits. A comment can be added to the edit summary of each of them. For the claim by putting a "#" column between the columns for the claim and its reference, for the reference by putting a "#" column behind its columns. For example:

qid,P21,#,S143,s813,#
Q22124656,Q6581097,comment to claim adding edit,Q24731821,+2017-10-04T00:00:00Z/11,comment to reference adding edit

Создание элементов[edit]

To create a new item, the first element of the row needs to be empty, so the line starts with a ,.

For example
qid,Len,Den,P31
,Regina Phalange,fictional character,Q95074


For example

creates a new item. Suitable for LibreOffice (paste in cell A1)

filenamelabeldescriptionqid,P31,Len,Den,P18
Mona Lisa - the Louvre.jpgMona Lisaoil painting by Leonardo da Vinci=",Q3305213,"""&B2&""","""&C2&""","""""""&A2&""""""""
Mona Lisa - the Louvre.jpgMona Lisaoil painting by Leonardo da Vinci,Q3305213,"Mona Lisa","oil painting by Leonardo da Vinci","""Mona Lisa - the Louvre.jpg"""

Statement removal commands[edit]

Statement column headers may also begin with "-" to remove the statement. (Note that this is only valid in the header for the whole column, not in individual values.) Removing other column types is not yet supported and will result in an error when the command is run; however, sitelinks and labels can be removed by setting them to the empty string (without "-" in the column header).

qid,P31,-P31
Q4115189,Q5,Q5

Adds to the sandbox item a P31 value of human (Q5) and then removes that same statement again.

Commas and double quotes[edit]

Labels, descriptions, aliases and sitelinks do not need to be in double quotes unless they themselves contain commas (,) or double quotes (").

In this case, replace all double quotes with two double quotes (e.g. Toys "R" UsToys ""R"" Us) and then wrap the string in a pair of double quotes (e.g. "Toys ""R"" Us").

qid,Len
Q4115189,"Toys ""R"" Us"
Q4115189,"Patterns, Predictors, and Outcome"

To add a string value containing double quotes ("), replace all double quotes with two double quotes ("").

As any string value, then wrap it in three double quotes ("""), e.g. """Toys ""R"" Us""".

Samples for Q4115189#P370, notably Toys "R" Us

qid,P370
Q4115189,"""Toys ""R"" Us"""
Q4115189,"""Patterns, Predictors, and Outcome"""
Q4115189,"""Wikidata sandbox item 1"""

Combined sample[edit]

qid,Len,Den,Aen,P31,-P31,P21,P735,qal1545,S248,s214,S143,Senwiki
Q4115189,Douglas Adams,author,Douglas Noël Adams,Q5,Q36180,Q6581097,Q463035,"""1""",Q54919,"""113230702""",Q328,Douglas Adams
Q4115189,"Toys ""R"" Us",testin sample,Toys R Us,Q5,Q36180,Q6581097,Q463035,"""1""",Q54919,"""113230702""",Q328,"Toys ""R"" Us"

Samples by value type[edit]

Samples use the sandbox item (Q4115189) and can be pasted directly into QuickStatements for testing. Should be risk-free.

Метка
qid,Len
Q4115189,Sandbox
Q4115189,"Patterns, Predictors, and Outcome"
Q4115189,"Toys ""R"" Us"
Описание
qid,Den
Q4115189,Wikidata item for tests
Q4115189,"sample for Patterns, Predictors, and Outcome"
Q4115189,"description sample for Toys ""R"" Us"
Alias
qid,Aen
Q4115189,Wikidata sandbox
Q4115189,"Predictors, Patterns, and Outcome"
Q4115189,"Toys ""4"" You"
Элемент
qid,P369
Q4115189,Q5
Q4115189,somevalue
Q4115189,novalue
L123,Q5
L123-S1,Q5
L123-F1,Q5

somevalue is for unknown value Help, novalue for no value Help. F1 and S1 on Lexeme:L123 would have to exist for it to work.

String or external identifiers (external-id)
qid,P370
Q4115189,"""Sandbox"""
Q4115189,"""Patterns, Predictors, and Outcome"""
Q4115189,"""Toys ""R"" Us"""

Одноязычный текст
qid,P1450
Q4115189,en:"Sandbox"
Q4115189,en:"Toys "R" Us"
Q4115189,"en:""Toys ""R"" Us"""
Q4115189,"en:""Patterns, Predictors, and Outcome"""

en для английского языка

Дата/время
qid,P577
Q4115189,+1856-01-01T00:00:00Z/9
Q4115189,+1856-01-01T00:00:00Z/10
Q4115189,+1856-01-01T00:00:00Z/11

Precisions are 9=year, 10=month, 11=day, so the dates are 1856, January 1856 and 1 January 1856.

Image/Commons media file
qid,P18
Q4115189,"""Frans Breydel - A merry company.jpg"""
Q4115189,"""'Girl Reading' by Mary Colman Wheeler, El Paso Museum of Art.JPG"""
Q4115189,"""Kaubalaeva ""E. Russ"" vrakk.jpg"""
Q4115189,"""''L'empereur Napoleon III'' de Franz-Xaver Winterhalter.jpg"""
URL
qid,P856
Q4115189,"""https://example.com/"""
Q4115189,"""https://example.com/equalsign=test"""
Q4115189,"""https://example.com/underscore_test"""
Количество
qid,P1114
Q4115189,10
Q4115189,+20
Q4115189,+3.1415926
Q4115189,-40
Q4115189,5.5U11574
Q4115189,+60U11573
Q4115189,+7.5U11574
Q4115189,-80~1.5
Q4115189,2.2~0.3
Q4115189,+1.2~0.3

U11573 is for metre (Q11573), U11574 for second (Q11574). Note the odd result of 1.2~0.3.

Полный пример[edit]

Full examples can be found at Help:QuickStatements/examples.

Запуск QuickStatements[edit]

Использование второй версии (QuickStatements version 2)[edit]

QuickStatements V2 intro screen

Here is how to use QuickStatements (version 2) in basic mode:

  1. Go to https://quickstatements.toolforge.org
  2. Make sure you are logged into OAuth and your name is visible in the upper-right corner. If not, then log in.
  3. Click "New batch".
  4. For working with Wikimedia Commons Structured Data:
    1. Look for the pull-down menu Create new command batch for ... and change project from Wikidata to Commons [Batch mode only!]
    2. You need "M" ids to work on instead of "Q" numbers. Look up the media identifiers for Commons files with the Minefield tool
    3. Use statements in the form of "MXXXX|PXX|QXXX" or use the CSV format option
    4. Initiate the query with the "Run" or "Run in the background" button to run it in the batch mode
  5. Cut and paste your commands. See the syntax in the section above.
  6. When you are done, click "Import V1 commands" or "Import CSV commands".
  7. The tool will convert your commands into human-readable form. Inspect them and click "Run" or "Run in the background" to execute
  8. As your commands are being processed, double-check the results, and press "STOP" if you detect a problem.
  9. The user interface will tell you when all commands have been processed.

Использование первой версии (QuickStatements version 1)[edit]

Screenshot of using QuickStatements version 1

QuickStatements version 1 is still available, but no longer maintained. It has stopped working for some users, but still works fine for others.

  1. Go to https://wikidata-todo.toolforge.org/quick_statements.php
  2. Cut and paste your commands into the window
  3. Click "Do it"
  4. The user interface will tell you when all statements have been processed.

Using QuickStatements version 2 in batch mode[edit]

When to use batch mode?[edit]

QuickStatements version 2 has the "Run in background" button

Batch mode (also known as running in the background or asynchronous batch mode) means your statements are executed from a Wikimedia server, rather than from your Web browser. This has several advantages:

  • Even if you close your browser or if your computer crashes, the statements will be executed until the last one.
  • You can launch several batches in parallel, without slowing down your computer. (The batches seem to be run sequentially)
  • You get a unique URL for your batch, to which you can refer later. This page shows some statistics about your run.
  • To see all your recent batches click "Your last batch". To see everybody else's recent batches click "Last batches"
  • You or a project admin can stop your batch by going to its URL. For instance, if it is realized that the batch is erroneous and you are offline, an admin can stop it immediately (by going to the individual batch page), rather than having to block you.
  • If you discover that something went wrong, you can revert the whole batch afterwards

But there are also drawbacks:

  • It takes a few more clicks, so as a rule of thumb, if you only have 10 or fewer statements, it's better to run them in normal mode.
  • Depending on how busy the server is it might take time for your batch to start so that checking the results might not be possible immediately.
  • There is a limit on the number of statements in a batch, and batches with more statements do not load properly (showing blank page and revolving circle). For simpler statements, the maximum seems to be around 25 thousand statements per batch, but it is much smaller for more complex statements.
  • Batch mode seems to work well for simple statements without qualifiers or references, but more complex statements (where, for example, the successful addition of a qualifier depends on the base statement being already present), there seems to be a much higher error rate.

Before running a batch, it can be a good idea to run a few commands directly in non-batch mode to get a good view of what is being done.

Using batch mode[edit]

  1. Prepare your statement normally as described in the Using QuickStatements version 2 section above
  2. Instead of pressing "Run", press the "Run in background" button.
  3. "Your last batches" will show a list of the most recent batches run by you, with statistics.

The following statistical values are available:

  • DONE: The number of statements that were successfully run
  • ERROR: The number of statements that failed
  • INIT: The number of statements left to run
  • RUN: The number of statements being run right now

Running QuickStatements by URL[edit]

What you should see if you click on the example link in this section

An alternative way of communicating with QuickStatements is to use a URL instead of cutting and pasting commands into the import window. For example, a command to add to Emile Justin Merlot (Q37887397)VIAF ID (P214)"96480189" with source imported from Wikimedia project (P143)Wikimedia Commons (Q565) is Q37887397 TAB P214 TAB "96480189" TAB S143 TAB Q565. You can also generate a prefilled QuickStatements window with https://quickstatements.toolforge.org/#/v1= Q37887397%7CP214 %7C%2296480189%22%7C S143%7CQ565 or https://quickstatements.toolforge.org/#/v1=Q37887397%7CP214%7C%2296480189%22%7CS143%7CQ565. The steps of converting V1 syntax to URL are:

  1. replace TAB with "|" and newline with "||"
  2. apply URL encoding to the string, which will replace "|" with "%7C", double quote with "%22", space with "%20", slash "/" with "%2F", etc.[4]
  3. put https://quickstatements.toolforge.org/#/v1= in front of it

Many templates on Commons, like c:Template:Creator or c:Template:Artwork use that technique to package information that can be imported to Wikidata into a clickable URL.

Хитрости:

  • [[File:Commons to Wikidata QuickStatements.svg|20px|link=https://quickstatements.toolforge.org/#/v1=Q37887397%7CP214%7C%2296480189%22%7CS143%7CQ565]] will encode the URL within a handy clickable icon: (click it but do not click "run"; pressing it will not work since that item already has that property).
  • Pages with QuickStatements URLs may be located through Special:LinkSearch (see here) or through a database query calling externallinks table (see for example here).

Clients[edit]

- Python

Ограничения[edit]

QuickStatements версии 2 на настоящий момент не может:

  • создавать несколько элементов, ссылающихся друг на друга,
  • задавать ранги утверждений,
  • задавать комментарий к правке при удалении утверждений,
  • задавать модель календаря для утверждений в формате даты,
  • задавать точность или globe для утверждений в формате координат,
  • добавлять URL с некоторыми символами (наприме, «_» или «=»),
  • добавлять утверждения to redirected items,
  • добавлять второй утверждение с тем же свойством и его значением, но другими квалификаторами (дополнительные квалификаторы добавляются к первому утверждению),
  • удалять квалификатор или источник (не удаляя всё утверждение), синоним,
  • помечать статусные страницы,
  • создавать лексемы.

Note that for using QuickStatements, an account needs to be autoconfirmed. Also there is no way for users using bot accounts to mark their edits as bot edit (but there is an open ticket to address that).

ЧаВо[edit]

Can QuickStatements add reference statements with more than one claim?
Yes, current QuickStatements can add references that have for example both imported from Wikimedia project (P143) and retrieved (P813) (see here) or both stated in (P248) and page(s) (P304).
How do I experiment with QuickStatements?
Use Wikidata Sandbox (Q4115189).
How do I report issues with the tool?
Check with other users at the talk page or at Wikidata:Project chat. Confirmed bugs should be reported on Phabricator after reading mw:How to report a bug.
Where do I suggest new features?
You can ask at tool's Git page or at User:Magnus Manske/quick statements2, but be aware that we keep Magnus busy!
What is the maximum number of commands I can enter at once?
Not documented. It was already tested with over 11,000 commands. But note that such large batch runs will take several hours to complete.

Лучшие практики[edit]

  • QuickStatements allows edits ranging from single statement to multi-thousand-item batch runs. Very large runs or potentially-controversial runs should go through the approval process described in Wikidata:Bots.
  • Users should avoid creating duplicate items.
  • All statements should have references as per Help:Sources. That might be less important for identifiers, like VIAF ID (P214) or RKDartists ID (P650), etc.
  • Users doing the edits are responsible for fixing or undoing their changes if issues are found. See about statement removal.
  • This tool does not properly honor maxlag. This is generally not a problem, because the actions of the tool are limited by the usual edit limits of the controlling user. This can, however, cause problems if the controlling user is not subject to edit limits (e.g. admins).

Using the API to start batches[edit]

If you are logged in on QuickStatements, you can get a token on your user page. That page also contains information about how to use the token to submit batches programmatically. You need to have submitted at least one server-side batch manually before for this to work!

Edit groups[edit]

QuickStatements V2 creates edit groups for all individual batches. You may discuss individual edit groups, or rollback the whole edit group.

EditGroups is another external tool, not part of QuickStatements. Currently it works on Wikidata, and there is also an instance for Commons. On other Wikibase instances, it may be unavailable.

См. также[edit]

Tools that export to QuickStatements[edit]

Примечания[edit]

  1. https://wikidata-todo.toolforge.org/quick_statements.php
  2. 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 синтаксис работает только в QuickStatements версии 2
  3. Note that due to the way computers operate with floating-point numbers the input format of version 2 may produce undesired results when working with decimal numbers.
  4. https://www.url-encode-decode.com/ is a handy URL encoder/decoder