Module talk:Wikibase
Latest comment: 9 years ago by Matroc in topic Possible code change
- Swept in from the pub
Hi guys. I added a function to Module:Wikibase and an #ifeq statement to templates IsPartOf, Itinerary, Phrasebookguide, and PartOfTopic which checks whether the corresponding Wikidata item is marked as a WP disambig page. When it is, the article is added to the maintenance category Pages linked to a data item for a disambiguation. Those articles need to have their WD item corrected to correspond to the actual topic rather than the disambig page. (Note that our own disambig pages will not be showing up in the category.) When doing so, please move the links for any other Wikivoyage language versions which may also be present in the disambiguation item. Cheers! Texugo (talk) 17:01, 13 September 2013 (UTC)
- What is Module:Wikibase? I can't find any documentation for it. LtPowers (talk) 19:08, 13 September 2013 (UTC)
- It is a package of Lua modules for accessing WD properties which are unaccessible via #property. I have adapted it from it:Modulo:Wikibase, where it also still lacks documentation. Texugo (talk) 19:17, 13 September 2013 (UTC)
- Some of its functions I do not yet understand, but I will try to put some rudimentary documentation there shortly. Texugo (talk) 19:32, 13 September 2013 (UTC)
- OK. I whipped up some quick documentation for Module:Wikibase, to the extent that I understand it. Please have a look. Texugo (talk) 20:39, 13 September 2013 (UTC)
- Looks good. Next question: Why are some properties inaccessible via #property? LtPowers (talk) 23:01, 13 September 2013 (UTC)
- I'm probably not the best one to answer that question, but I think there are multiple answers depending on the property in question. For example, #property was prepared to call coordinates together and not prepared to call the latitude and longitude separately, which is the only way they are useful without further parsing, the wikipedia and other WV links are not technically properties with unique property names but rather language codes, etc. etc. I don't know why "capital" is included, since that one actually works with #property. Perhaps it would be better to ask Ricordisamoa, who is very active on Wikidata and who is developing Wikibase on it:. Texugo (talk) 02:44, 14 September 2013 (UTC)
- Looks good. Next question: Why are some properties inaccessible via #property? LtPowers (talk) 23:01, 13 September 2013 (UTC)
- OK. I whipped up some quick documentation for Module:Wikibase, to the extent that I understand it. Please have a look. Texugo (talk) 20:39, 13 September 2013 (UTC)
- Some of its functions I do not yet understand, but I will try to put some rudimentary documentation there shortly. Texugo (talk) 19:32, 13 September 2013 (UTC)
- It is a package of Lua modules for accessing WD properties which are unaccessible via #property. I have adapted it from it:Modulo:Wikibase, where it also still lacks documentation. Texugo (talk) 19:17, 13 September 2013 (UTC)
Possible code change
edit- I believe that mw.wikibase.getEntity() was deprecated and to use mw.wikibase.getEntityObject() instead!
- I have been using this module for a bit in a temporary manner (not saved permanently on any article page) while editing an article page and seeking out more information. I believe, that it has been employed permanently for the Sidebar or Quickbar...
- One drawback is that this module works with the current frame object - it would be cool to be able to send it the name of an article and get results for a different article from the same page. (maybe I will mention that on Lua Requests on Mediawiki - The way the code presently works may not allow it!)...
- Hopefully Wikidata as a project will be around for the long haul...
- I believe that one could use this module and possibly the Module:Wikidata (to handle properties -#property-) for info boxes etc., but probably not for WV at this time!.
- Some examples that I temporarily use are listed below as an FYI:
1. {{geo|{{#invoke:wikibase|latitude}}|{{#invoke:wikibase|longitude}}|zoom=8}} 2. {{Mapframe|{{#invoke:wikibase|latitude}}|{{#invoke:wikibase|longitude}}|zoom=8}} 3. [http://tools.wmflabs.org/reasonator/?q={{#invoke:wikibase|id}} RESONATOR TOOL]
- I usually link to Resonator (better presentation) rather than directly to Wikidata so that I am not in a position to edit or alter things. There is also a link to a named Category in Commons on the resulting Resonator page ...
- I put more notes on my talk page and have a working table that I tested as a Template - Template
- Just a few thoughts - Cheers! Matroc (talk) 21:13, 4 October 2014 (UTC)
- Could add minor code to retrieve the name of the banner in Wikidata if so desired - Matroc (talk) 08:40, 12 December 2014 (UTC)
- {{#invoke:wikibase|latitude}} and {{#invoke:wikibase|latitude}} do not appear to be working at this time - may be due to possible changes in Wikidata??? - Matroc (talk) 17:08, 20 May 2015 (UTC)
- Could add minor code to retrieve the name of the banner in Wikidata if so desired - Matroc (talk) 08:40, 12 December 2014 (UTC)