Pomoc API MediaWiki

To jest automatycznie wygenerowana strona dokumentacji API MediaWiki.

Dokumentacja i przykłady: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=wbparsevalue

(main | wbparsevalue)
  • Ten moduł wymaga praw odczytu.
  • Źródło: WikibaseClient
  • Licencja: GPL-2.0-or-later

Parses values using a ValueParser.

Parametry:
datatype

Datatype of the value to parse. Determines the parser to use.

Jedna z następujących wartości: commonsMedia, entity-schema, external-id, geo-shape, globe-coordinate, monolingualtext, quantity, string, tabular-data, time, url, wikibase-item, wikibase-property
property

Property ID the value to parse belongs to. Determines the parser to use.

parser
Przestarzałe.

ID of the ValueParser to use. Deprecated. Use the datatype parameter instead.

Jedna z następujących wartości: commonsMedia, entity-schema, external-id, geo-shape, globe-coordinate, globecoordinate, monolingualtext, null, quantity, string, tabular-data, time, url, wikibase-entityid, wikibase-item, wikibase-property
values

Wartości do parsowania

Ten parametr jest wymagany.
Oddziel wartości za pomocą | lub alternatywy.
Maksymalna liczba wartości to 50 (500 dla klientów z podwyższonymi limitami).
options

Opcje, których powinien używać parser. Dostarczone jako obiekt JSON.

validate

Whether to additionally verify the data passed in.

Type: boolean (details)
Przykłady:
Parse a plain string into a StringValue object.
api.php?action=wbparsevalue&datatype=string&values=foo|bar [otwórz w brudnopisie]
Parse 1994-02-08 to a TimeValue object with a precision of 9 (year).
api.php?action=wbparsevalue&datatype=time&values=1994-02-08&options={"precision":9} [otwórz w brudnopisie]
Parse 1994-02-08 to a TimeValue object with a precision of 14 (second) with validation enabled, resulting in a validation failure.
api.php?action=wbparsevalue&datatype=time&validate&values=1994-02-08&options={"precision":14} [otwórz w brudnopisie]
Parse foo into an object of whatever datatype P123 is, with validation enabled, potentially resulting in a validation failure depending on P123's datatype's expected input.
api.php?action=wbparsevalue&property=P123&validate&values=foo [otwórz w brudnopisie]