https://bugzilla.wikimedia.org/show_bug.cgi?id=49805
--- Comment #4 from Rical <[email protected]> --- In the module or template Auteur/doc I must show examples, but a module page is not an element, then wikidata give nothing to mw.wikibase.getEntity(), and mw.wikibase.getEntity("Q535") do not works. Also in wikidata:Victor Hugo the country property give 142, but in Lua, I cannot ask mw.wikibase.getEntity("Q142"). Then I hope that mw.wikibase.getEntity("Q535") works for any element. Get a property by Lua is very hard by present Lua, because in many cases the result is a script error. Go to see what I wrote in http://test2.wikipedia.org/wiki/Module:Auteur to read some properties from one element in the function m.wikidata, at least and really many more that : local entity = mw.wikibase.getEntity( ) local dat = entity.claims wd.image = dat.p18[0].mainsnak.datavalue.value wd.country = dat.p27[0].mainsnak.datavalue.value["numeric-id"] Reading entity.claims.p18[0] (and others) does not work if one writes entity.claims["p18"][0] then I can't do a loop from a list of properties to query. Then I hope that mw.wikibase.getProperty("p20") works for any property. or entity.getProperty("p20") which return nil or .value or .value["numeric-id"] When getEntity("Q535") and getProperty("p20") already exist, we must thinks about users that want make généalogies or biologic classifications. They probably will like mw.wikibase.getProperty("p20", "Q535") which return a string or nil, and where the element is optional. Sorry for "Scribunto", I don't known where to include a Lua bug. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
