Talk:Wikidata/Notes/Inclusion syntax v0.4

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search

Property aliases[edit]

The use of the identifier of the property like {{#property:P36}} is more stable as the label like {{#property:capital}}. To improve stability it should also work for aliases like {{#property:alias of capital}}. In case a label changes, we could add the old label as alias. In that case the Wikipedia templates and modules still continue to function properly without the need to change it immediately. HenkvD (talk) 14:56, 18 May 2013 (UTC)

You are correct that IDs are more stable than labels, and I would suggest to use IDs instead of labels -- but labels might be preferred due to their readability. It's a tradeoff. On the other hand, aliases are not necessarily unique, and thus we do not allow them for accessing values. Property labels thought are unique per language. --denny (talk) 14:45, 21 May 2013 (UTC)
"Property labels thought are unique per language." I'm curious, is that automatically enforced (so there can never be two "capital" properties in the same language)? Superm401 | Talk 05:10, 26 May 2013 (UTC)
Yes it is enforced. --Lydia Pintscher (WMDE) (talk) 09:00, 26 May 2013 (UTC)

access a different item by label[edit]

As labels are not unique, I assume you mean article title. --Zolo (talk) 11:07, 19 May 2013 (UTC)

Thanks for catching this, you are correct. --denny (talk) 14:45, 21 May 2013 (UTC)

Implement Copypaste.py as a parser function[edit]

Could be possible to integrate Copypaste.py tool (here and here) as an inclusion parser function into mediawiki? The tool generates an interwiki list in wiki syntax from the Q number. Such function would be very helpful for Commons (until Commons will be integrated fully-fledged). Such syntax can be something like:

{{#interwiki|Q183}}
{{#interwiki|Germany}}
{{#iw|de:Deutschland}}

--ŠJů (talk) 23:52, 5 August 2013 (UTC)

Make inclusion human readable[edit]

Have a look at https://www.wikidata.org/wiki/Wikidata_talk:Infoboxes_task_force#Make_embedding_data_in_wikipedia_human_readable --141.58.44.204 19:14, 25 August 2013 (UTC)

Refer to WP page links and titles?[edit]

Is it possible to return the links to Wikipedia pages and titles of those pages for items? This would be very helpful on commons, where we could use it in templates like Commons:Template:Portrait of and make image descriptions interlingual. --Jfhutson (talk) 20:52, 27 October 2013 (UTC)

Accessing qualifiers for statements[edit]

I added the actual version from wikidata to the dewiki article about Mozilla Firefox: https://de.wikipedia.org/w/index.php?title=Mozilla_Firefox&diff=125417237&oldid=125385804 and want to get the qualifier that sais the Version is from 2013-12-10 as well. --Lbenedix (talk) 20:05, 13 December 2013 (UTC)

release a good inclusion syntax now, otherwise wikidata is not used in wikipedia and WILL CERTAINLY die! --92.201.145.65 08:10, 27 February 2014 (UTC)

I'm going to concur here. I popped into Wikidata to experiment with adding population data just for my hometown, and see if I could incorporate it into the en.wikipedia article. I found that I could invoke the population number, but there is nothing about how to incorporate the "as of" date. Whether the capability isn't there, or whether it just isn't documented, the data can't be used on Wikipedia, since the population data would get updated, but the metadata about that population number is divorced from the data to which it applies. Vanisaac (talk) 09:57, 3 July 2014 (UTC)
Hi Vanisaac, can you explain this:
Explain and discuss. --Atlasowa (talk) 11:21, 3 July 2014 (UTC)
Well, Atlasowa, A) I don't take orders, B) does my comment have anything whatsoever to do with what you are asking?, and C) does my comment indicate in any way any sort of experience that would be germane to your command? Vanisaac (talk) 23:23, 5 July 2014 (UTC)

Seeing that the discussion is way off track, I will reiterate the request to use qualifiers in Wikipedia. Is there a way to incorporate qualifiers in WP articles? Like Vanisaac, I want to use the "point in time" qualifier for population numbers. If this isn't possible yet, this functionality should be added! --P199 (talk) 16:16, 17 July 2014 (UTC)

It is possible using Lua. --Lydia Pintscher (WMDE) (talk) 16:31, 17 July 2014 (UTC)
I have zero experience with Lua programming. Can you make a new module for this? Thanks. --P199 (talk) 16:43, 17 July 2014 (UTC)
It would be great to see an example of a Lua script operating to retrieve and display wikidata data on a wikipedia page. Where could we see this? --Genewiki123 (talk) 23:34, 28 August 2014 (UTC)
As an aside (perhaps), I'd add that trying to amend the wikidata value for population always results in a range figure, e.g. 47,357±1.
In addition there is no facility (that I can see) for actually adding any qualifier. --Unbuttered Parsnip (talk) 02:06, 13 November 2014 (UTC)

Ahh question[edit]

So, {{#property:Pxxx}} will transclude into "" in two cases:

  1. The wikipedia article does not have a wikidata item.
  2. The wikipedia article has a wikidata item, but it does not have Pxxx property.

Is there a way to distinguish between the two, inside a wikipedia inclusion? Thanks Kotz (talk) 16:18, 11 August 2014 (UTC)

Condition 1 is also a property (Wikimedia article)... Test that this property is defined. verdy_p (talk) 11:47, 17 August 2014 (UTC)

Properties of different items - redirects[edit]

The proposal to access properties of a different item doesn't deal with redirects. Can we suppose that non redirect page have its own item page and the statements will be included from the target page? Will even multiple redirect be fully functional? Or we need something like

 {{#property:capital|of=Great Britain and Northern Ireland|noredirect}}

for a possible item page of the redirect page? --ŠJů (talk) 18:11, 17 August 2014 (UTC)

Inclusion and ParserFunctions[edit]

Hi,

I'm not sure if it's the right place but can someone explain me how this syntax works with the ParserFunctions ?

For instance, {{#expr: {{#property:P1082}} / 1000 }} doesn't work anywhere (apparently because of the formatting) but {{#time: Y | {{#property:P569}} }} works on the English Wikipedia but not on the others wikipedias!

And is there an other *simple* way to do that sort of simple calculation ? (it seems too simple to need to be done in Lua).

Cdlt, VIGNERON * discut. 13:41, 9 December 2014 (UTC)

Output from wd is edited, so you need to unedit it before giving it to an expression:
{{#expr:{{formatnum:{{#property:P1082}}|R}} / 1000 }} --Unbuttered Parsnip (talk) 02:29, 19 December 2014 (UTC)
Ok but how do I unedit a time/date ? Cdlt, VIGNERON * discut. 08:07, 19 December 2014 (UTC)
And if you're trying to get the year out of a date, in enwiki I think you need {{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}} - not sure because I don't know what P569 is. --Unbuttered Parsnip (talk) 03:21, 19 December 2014 (UTC)
My question was in general without any particular plan in mind for any Wikipedia. I was just hoping for a simple way to do a simple thing… (and inwoking a module is not « simple » ; I'm probably asking for too much). FYI: d:Property:P569.
Cdlt, VIGNERON * discut. 08:07, 19 December 2014 (UTC)

Any projection?[edit]

Wondering when the |of= might be working. --Unbuttered Parsnip (talk) 02:31, 19 December 2014 (UTC)