Rical updated the task description. (Show Details)

CHANGES TO TASK DESCRIPTION
On 2018-01-23,The purpose of the proposed task is to simplify for Lua coders the use of wikibase. get properties values need to use a complex code using several functions and snaks like:
```
local snak = entity['claims']['P342'][1]['qualifiers']['P342'][1]
```
Otherwise, they could search and test for days or weeks.

This property function gets the sought property from any available element and language and returns its value if available.

These are heavyOtherwise, as usual in scribunto, it returns zero and hasardous tasks for Lua-codersthe module displays an error or changes the requested language...
HowThe simplest use is to help them?request only the property keyword like "image" or "lastname"...
Create a new function in the Lua part of scribunto for the Extension:Wikibase ClientThis function gets also pseudo properties: //"description"//, //"label"//, //"title"//, //"QITEM"// like //"Q34743"//, and //"sitelink"// like //"Author:Rudyard Kipling"//.

This function gets the sought property from any available item and language.
* //QITEM//, like //"Q1234"//,
e //QITEM// argument can be the id like //"Q535"// or the title or the label of another sought item. //"Q"// asks the property for the current page.

The value of the default property is returned in the content of the calling page.
can be the Title or the Label of the pageThe module can request it in any language.
* //property// can be defined like //"P18"// or from it's own name, in English (or in the local content languageFor a value in the content or page or language of the user, if non ambiguous)use //"content"// or //"page"// or //"user"//.
* //language// can be a sequence.
Properties include Label
For simplicity of use, the module can request languages in descending priority in 2 formats: //"user; content; en, de, es"// or //{'user', 'content', Title'en', description'de', sitelink...' es',}//

Examples:

```
...
local prop2 = mw.wikibase.property('lastname') -- Named pseudo property
local prop3 = mw.wikibase.property('Llabel', 'Q', { 'user', 'page', 'content', 'en', 'de', 'es', } ) -- Default values
local prop4 = mw.wikibase.property('description', 'Nelson Mandela', { 'user', 'fr', } ) -- other case
...

TASK DETAIL
https://phabricator.wikimedia.org/T185557

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Rical
Cc: Lydia_Pintscher, hoo, thiemowmde, Uzume, Aklapper, Rical, Lahi, Gq86, GoranSMilovanovic, Soteriaspace, Jayprakash12345, JakeTheDeveloper, QZanden, Zoranzoki21, LawExplorer, Wikidata-bugs, aude, TheDJ, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to