This is the first Wikidata 2 edit in Hungarian Wikipedia: http://hu.wikipedia.org/w/index.php?title=Magyarorsz%C3%A1g&curid=115&am...
I tried to replace the official language first, but it is linked in the infobox as [[magyar nyelv|magyar]]. How can I use properties here? The second thought was .hu, the TLD, but its value in the infobox is currently hu which is translated to [[.hu]] by the infobox template, so after inclusion from WD it became [[..hu]] which is of course red. How can I use that? Shall we rebuild all the infoboxes?
Other items are either missing from the infobox or from WD, so the reason to choose the president whom I dislike was that his name appears both in WD and the infobox and is linked in a simple form.
On Wed, Mar 27, 2013 at 8:20 PM, Bináris wikiposta@gmail.com wrote:
This is the first Wikidata 2 edit in Hungarian Wikipedia: http://hu.wikipedia.org/w/index.php?title=Magyarorsz%C3%A1g&curid=115&am...
Yay :)
I tried to replace the official language first, but it is linked in the infobox as [[magyar nyelv|magyar]]. How can I use properties here?
So you want to get the associated article for the language so you can link to it? I am not sure if that is possible already with Lua. Someone else will have to comment on that.
The second thought was .hu, the TLD, but its value in the infobox is currently hu which is translated to [[.hu]] by the infobox template, so after inclusion from WD it became [[..hu]] which is of course red. How can I use that? Shall we rebuild all the infoboxes?
Yes you'll have to adapt the infobox template then it seems.
Other items are either missing from the infobox or from WD, so the reason to choose the president whom I dislike was that his name appears both in WD and the infobox and is linked in a simple form.
Yes. It is basic so far but more will come :)
Cheers Lydia
-- Lydia Pintscher - http://about.me/lydia.pintscher Community Communications for Wikidata
Wikimedia Deutschland e.V. Obentrautstr. 72 10963 Berlin www.wikimedia.de
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.
On 27.03.2013 20:40, Lydia Pintscher wrote:
On Wed, Mar 27, 2013 at 8:20 PM, Bináris wikiposta@gmail.com wrote:
This is the first Wikidata 2 edit in Hungarian Wikipedia: http://hu.wikipedia.org/w/index.php?title=Magyarorsz%C3%A1g&curid=115&am...
Yay :)
I tried to replace the official language first, but it is linked in the infobox as [[magyar nyelv|magyar]]. How can I use properties here?
So you want to get the associated article for the language so you can link to it? I am not sure if that is possible already with Lua. Someone else will have to comment on that.
It's possible. Adding to the "Wikibase" Scribunto module provided on https://www.mediawiki.org/wiki/Extension:WikibaseClient/Lua, you could define something like this:
-- Return a wiki link to the data item specified by ID function p.itemLink(frame) id = frame.args[1]
page = mw.wikibase.sitelink( id ) label = mw.wikibase.label( id )
return "[[" .. page .. "|" .. label .. "]]" end
-- Return a data item ID from a property value function p.propertyAsItemId(frame) property = frame.args[1]
-- note: if there are multiple values, all but the first are ignored. entity = mw.wikibase.getEntity() claim = entity.claims.[property][0]
-- note: this "numeric-id" stuff is likely to change soon! id = "Q" .. claim.datavalue.value["numeric-id"]}} return id end
Note that these are UNTESTED, and I'm not a Lua expert (yet). Also note that the functions above are lacking proper error handling.
Anyway, with these tools, you can do the following:
{{#invoke:Wikibase|itemLink|{{#invoke:Wikibase|propertyAsItemId|p12345}}}}
Which will then generate a link to the appropriate page on the local wiki, with the appropriate label.
BTW: If you get the above function to work and find them useful, please add them to the documentation page!
The second thought was .hu, the TLD, but its value in the infobox is currently hu which is translated to [[.hu]] by the infobox template, so after inclusion from WD it became [[..hu]] which is of course red. How can I use that? Shall we rebuild all the infoboxes?
Yes you'll have to adapt the infobox template then it seems.
...Or the convention on Wikidata has to change. I personally think that the TLD property should contain "hu", not ".hu". I suggest to take that issue to the peroperty's talk page.
-- daniel
Il giorno 27/mar/2013 21:39, "Daniel Kinzler" daniel.kinzler@wikimedia.de ha scritto:
Yes you'll have to adapt the infobox template then it seems.
...Or the convention on Wikidata has to change. I personally think that
the TLD
property should contain "hu", not ".hu". I suggest to take that issue to
the
property's talk page.
Hmmmm, I don't think it is a good idea. IMHO the data should be still ".hu", since this is what you'd find on Wikipedia as article's title.
It is better to change the template, since we're going to do it anyway.
L.