Pomoc MediaWiki API

To jest automatycznie wygenerowana strona dokumentacji MediaWiki API.

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

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

This parameter is required.
Oddziel wartości za pomocą | lub alternatywy.
Maximum number of values is 50 (500 for clients allowed higher limits).
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]