Wikidata:Contact the development team/Archive/2016/02

Latest comment: 8 years ago by Lydia Pintscher (WMDE) in topic external-id

deletion and restoration of pages on other wikis causes data loss at Wikidata

When a page that is associated with a Wikidata item is deleted on another wiki, the link from that item is automatically removed. However, if that page is the undeleted for whatever reason, the link is not restored with it and all the interlanguage links, etc. are lost until someone notices and manually re-adds the link at Wikidata (there is no way to do this on the local project). See the history of Q5125870 for example - the en.wp article was accidentally deleted and immediately undeleted on the 2nd but the link was not restored until I noticed the link removal on my watchlist today (5th). In addition to accidental deletions, pages may be deleted and then restored due to overturned (speedy) deletions, the merging of page histories and possibly other situations too.

There is a discussion about this on en.wp at w:Wikipedia:Administrators' noticeboard#If you delete and then restore a page, make sure to recreate the link to Wikidata to raise awareness among admins there that this is an issue, however that is at best a workaround and there should be a technical solution. The options suggested in that thread are to either delay the deletion (for 1 day was the suggested duration) or to have the undeletion of a page re-add the link here (my preference). There may be other options too. I don't know how either option could be implemented, or even if they are possible, but as it stands data is lost unnecessarily. Thryduulf (talk: local | en.wp | en.wikt) 20:47, 5 February 2016 (UTC)

Cannot set date/time with precision "seconds"

I was not able to set "15 October 1997, 16:01:00 UTC" as UTC date of spacecraft launch (P619) on spacecraft Cassini−Huygens (Q165585); the entry box states "will be displayed as: +1997-10-15T16:01:00Z" but saving it fails with "Malformed input: +1997-10-15T16:01:00Z". Is this a known limitation? The data model does not mention such limitation, and I could not find related development in Wikidata:Development plan or in Phabricator. -- LaddΩ chat ;) 13:13, 10 February 2016 (UTC)

See Phabricator:T57755. --Yair rand (talk) 13:31, 10 February 2016 (UTC)

Limitations of the current SPARQL implementation

@Deskana (WMF), Lydia Pintscher (WMDE), Jheald: (Following up from the office hours discussion. In the time since then, it has turned out that several things I thought were impossible were actually possible, and that there's a lot I don't know about using SPARQL.)

Some apparent limitations in the current query system implementation:

  • The * and + operators can't give clear filters, such as relating to rank or qualifiers, to each link on the way. To give a hypothetical example: Former Province X (qId X) was a province of a country that existed from 1000-1500. The successor state(s) doesn't use the same subdivisions, but we still have historical articles on the provinces. So, suppose we want to generate a list of all people who were born in X. ?p wdt:P19 wd:QX . doesn't work for people born in subdivisions of X, or in other entities located in the administrative territorial entity (P131) X. So, we could try ?p wdt:P19/wdt:P131* wd:QX ., but that doesn't have them show up either. Why is that? Because the subdivisions of X are now part of other divisions. Those statements have the preferred rank, while the historical data we want uses the normal rank. We could try ?p wdt:P19/(p:P131/v:P131)* wd:QX ., but that comes with even more problems. First, all statements with deprecated rank are included, which we presumably don't want. Second, the results include people born in current subdivisions of X's subdivisions, which have start dates after X's dissolution, and thus were never part of X. We can handle making sure the birth date itself overlaps with X's existence, but we can't check each level of an unspecified number of parent territorial division statements to filter to only those which were true at the time of the birth date.
  • Suppose we want to query the average current population of standard neighborhood areas in the great non-country state of Foo, which has an inconsistent number of layers of subdivisions. But we have high standards for data; not only do we want sources for the population statements, we want sources for all the P131 statements leading to Foo. Real sources, not any imported from Wikimedia project (P143) "sources". We could check any individual statement for this, but there's no way to do that for chains. (Similar situations include: Lists of prominent descendants of a certain individual, some types of taxonomical listings, teacher/student trees.)
  • Frequently, we want to identify items that have a certain "value type". This refers to whether an item is a instance of a certain class, which we can usually find out with wdt:P31/wdt:P279*. However, this doesn't always work perfectly. We also have subproperties. If we want to be more thorough, for P31 we can use ?instancewdt ^wikibase:directClaim/wdt:P1647? wd:P31 . ?p ?instancewdt [ wdt:P279* ?class ]. . Where this becomes a problem is with subclass of (P279). Ideally, we'd want to define ?subclasswdt similarly, but using ?subclasswdt* isn't valid syntax. (Currently there is only one subproperty of P279, but I suspect there will be more in the future.) (Similar issues exist for subproperties of other properties such as location or part of.)
  • Certain complex datatypes are extremely difficult to work with. For example, it is essentially impossible to determine whether a date is certainly later than another date, if they have different precision values. It is also not possible to accurately determine distance between two globecoordinates.
  • Certain complex calculations will inevitably result in a query timeout. I've been trying to work on a query that returns a list of all humans who lived the majority of their lives in a certain area, with some lines attempting to subtract overlapping parts of date ranges in residence statements. I have yet to figure out a query that doesn't timeout.

--Yair rand (talk) 08:54, 2 February 2016 (UTC)

Thanks so much for taking the time to write this down. That is very helpful.
@Smalyshev (WMF): also interesting for you. --Lydia Pintscher (WMDE) (talk) 09:06, 2 February 2016 (UTC)
Distance between co-ordinates should become much easier with the imminent deployment of Blazegraph 2.0
I wonder if it would be worth introducing another prefix -- eg wda:P131 for "wikidata additional" -- for statements which are not of top rank, but are not deprecated either. Then one could do recursive searches to include all non-deprecated statements using (wdt:P131|wda:P131)*. It would need a bit of management to automatically manage which statements should be aliased with the wda:... connectors, but not so different from what currently has to be done to maintain the wdt:... connectors. On the plus side, since there are few statements at the moment with preferred rank, introduction of a wda: prefix should be possible without adding a vast number of new statements to the triple store. Pinging @Smalyshev (WMF): ? -- Jheald (talk) 14:30, 10 February 2016 (UTC)
We may consider that, but I'm not convinced yet it'd be beneficial. We may need to discuss this and consider options. Maybe file a task on Phabricator so we do not lose it? --Smalyshev (WMF) (talk) 18:59, 10 February 2016 (UTC)

Special:ApiSandbox

There is an update of Special:ApiSandbox and I´m afraid they forgot Wikidata. Try to input item and property for wbgetclaims. It is not possible. Or I don´t understand the new Sandbox. A way around is to input the information by hand into the browser like "https://www.wikidata.org/wiki/Special:ApiSandbox#action=wbgetclaims&format=json&entity=Q15220420&property=P580". --Molarus 05:11, 11 February 2016 (UTC)

I had the problem too, but found out how it works. In the first screen you choose the action and format and then you click in the left column on the items that are there in your case on wbgetclaims and there you can add property and entity etc.. It would have been nice if there had been a message about the change of the ApiSandbox. Mbch331 (talk) 09:17, 11 February 2016 (UTC)
You are right, thanks. --Molarus 09:47, 11 February 2016 (UTC)

Use of property

Hi all developers! I'm trying to change format of Encyclopædia Britannica Online ID (P1417), but I don't want to screw up something in Wikipedias and other clients. Do you have some methods of tracking use of property? It can be secret method, I won't say it to anybody :) I did some basic search at Google, found that property is used in this kind of modules in some 10-20 wikis and this gadget. I'm pretty sure it's all (and the property isn't so widely used), but you never know. It may be not so important in this case, but it would be good property to test on some methods. IMO, we're not so very far from splitting IMDb ID (P345), I think some colleagues are thinking about it, at least silently :) --Edgars2007 (talk) 09:09, 11 February 2016 (UTC)

We don't track usages of individual properties like this at the moment, no. I fear there is not easy way to get this information :( --Lydia Pintscher (WMDE) (talk) 15:36, 11 February 2016 (UTC)

Wikidata page Q1233445 has been changed by XYZ

I am getting cryptic mails from the system, what about invoking some description of the page in the email title? Some labels? 00:25, 11 February 2016 (UTC)  – The preceding unsigned comment was added by Mdupont (talk • contribs).

I think the mail that is sent is a standard mail for all projects, which uses the title of the page, which for an item is the QID. So it's not easy to change the mail, because that would mean there should be a separate mailtemplate for Wikidata and than there is the problem of the language of the labels to use. Not every item has a label in all language. Mbch331 (talk) 09:14, 11 February 2016 (UTC)
Yes that is correct. This is also a sore spot for me but so far not a lot of people have been complaining comparatively so I have not bumped it up too high. The relevant tickets are phabricator:T45044 and phabricator:T47441. --Lydia Pintscher (WMDE) (talk) 08:51, 16 February 2016 (UTC)

When an object has a lot of statements, then the "Add" (statement) button is at the bottom. We need to scroll down (possibly a long page).

I would believe it would be handy to put a second "Add link" near the header "Statements"; then we do not need to scroll down.

That increases the chance of adding duplicate statements. People don't scroll down to check if a statement is already present, they just add the statement and won't notice it's already present. Mbch331 (talk) 11:51, 13 February 2016 (UTC)

getting bulk ids by passing text -tools

Are there any tools to get the number of ids by passing texts. for eg.en:Module:Indian_state_assemblies/db i browsed each page to get the id. i want to collect indian state assemblies & lnk sabha constituency list as in en:List_of_constituencies_of_the_Lok_Sabha. thanks --Mdmahir (talk) 17:37, 13 February 2016 (UTC)

I believe Magnus had a tool for this. Does anyone remember? --Lydia Pintscher (WMDE) (talk) 08:52, 16 February 2016 (UTC)
I don't really understand what they're trying to do, but maybe http://tools.wmflabs.org/wikidata-todo/linked_items.php? - Nikki (talk) 11:54, 16 February 2016 (UTC)

Bug or feature : lua and redirects

The Lua API seem to not be able to follow redirects to retrieve labels. Is this a bug, is there a chance that this will be solved ? author  TomT0m / talk page 16:41, 15 February 2016 (UTC)

@Hoo man: Can you say something about this? --Lydia Pintscher (WMDE) (talk) 08:52, 16 February 2016 (UTC)
@TomT0m: I have looked into this and created phab:T127169. I hope that's the issue you meant, it would be nice if you could double check. Cheers, Hoo man (talk) 10:32, 17 February 2016 (UTC)

Wikidata:Data collaborators

This page is very outdated. Tag as historical or merge it to Wikidata:Partnerships and data imports?--GZWDer (talk) 19:05, 16 February 2016 (UTC)

Oh good find! I think we can get rid of it completely to be honest. I don't think we'll lose anything important. --Lydia Pintscher (WMDE) (talk) 19:09, 16 February 2016 (UTC)


Problem with Property:P2536

Somehow it can only be set to "novalue" or "somevalue", but not to a custom value. Is this currently intended or a bug? Sample at Q15397819.
--- Jura 07:53, 17 February 2016 (UTC)

We've got a fix in preparation at phabricator:T127095. Hopefully going live later today or tomorrow. --Lydia Pintscher (WMDE) (talk) 09:34, 17 February 2016 (UTC)
Works for me. Thanks for your quick action. It seems GZWDer reported it as well.
--- Jura 18:48, 17 February 2016 (UTC)

Add support for ady:

Hi. ady: is now an operational Wikipedia. Please allow Wikidata links to work there. Thanks! — MarcoAurelio (talk) 19:16, 15 February 2016 (UTC)

Maybe https://phabricator.wikimedia.org/T125501 should be re-opened. BTW, there is Adyghe Wikipedia (Q22676953).
--- Jura 21:38, 15 February 2016 (UTC)
This is tracked in T127045. Mbch331 (talk) 14:53, 16 February 2016 (UTC)
Fantastic. Thank you! — MarcoAurelio (talk) 14:56, 16 February 2016 (UTC)
Would you re-open both? It still doesn't work for me. Trying to add "ady:Адыгабзэ" to Adyghe (Q27776).
--- Jura 08:15, 18 February 2016 (UTC)
It works for me. See this edit. Mbch331 (talk) 08:25, 18 February 2016 (UTC)
Did you use Special:SetSiteLink or just "edit" on Q27776? I had tried the later. --- Jura 08:26, 18 February 2016 (UTC)
Still not. --- Jura 08:37, 18 February 2016 (UTC)
Just edit. Then scrolled to the end of the sitelink box, entered ady in the first field, pasted the value for the page Адыгабзэ, clicked on the value in the dropdownlist and clicked save at the top of the sitelink box. Mbch331 (talk) 08:39, 18 February 2016 (UTC)
By just typing "a" I get a few, but not adywiki. Doesn't seem to be some local cache or "ad"-blocker issue either.
--- Jura 08:50, 18 February 2016 (UTC)
It can be your localStorage for javascript (which isn't cleared when restarting your browser nor when deleting your cache). In a javascript console type localStorage.clear();. That should do the trick. I tried it, when I type a, I don't see it, but when I type ad, I do see ady. Mbch331 (talk) 09:26, 18 February 2016 (UTC)
It must have been the local storage issue. Thanks!
--- Jura 09:43, 18 February 2016 (UTC)
You're welcome. Mbch331 (talk) 09:45, 18 February 2016 (UTC)

Lua / WP / WD

Yesterday, I wrote this line of code:

string.gsub(s, "{{(%w+)}}", function (n) return frame:expandTemplate{ title = n } end)

I use this code to read a text (s) from Wikidata and turn the parts, that should be Wikipedia templates, into real, working Wikipedia templates. Maybe I should print this line of code onto a T-shirt, this is really fantastic. You do a really good job. --Molarus 13:28, 17 February 2016 (UTC)

I'm not really sure this should be used as this make the strings totally unusable outside of Mediawiki, and text is supposed to be raw, more or less. What's your usecase ? author  TomT0m / talk page 15:02, 17 February 2016 (UTC)
I'll add, this could work on some Wikipedia but not on another linguistic version. author  TomT0m / talk page 15:03, 17 February 2016 (UTC)
The string s is monotext (caption of pictures), therefore it will be used only at one Wikipedia anyway. And it is no problem to cut templates out of a text or transform them into text if necessary (as this piece of code demonstrate). But my point is, that this short piece of code combines WD, WP and Lua. It is a beautiful piece of code in many ways. By the way, most templates have arguments, which this piece of code couldn´t do, but that would destroy the iconic look. --Molarus 20:50, 17 February 2016 (UTC)

Bug

Transferred from Project chat.

So this morning (and perhaps others days) we have on wp:fr few (not a lot) pages which display a error message from wikidata. See : [1]. We have a discussion in french fr:Discussion Projet:Wikidata#Bug, and we suppose that the error is from mediawiki or wikidata. --Nouill (talk) 12:42, 17 February 2016 (UTC)

The French error message is "Too many Wikidata entities accessed" on pages which do not really access too many Wikidata entities and which a purge brings back to normal.
A short summary of that French discussion: the category that tracks such errors can show sometimes up to 500 pages, which is few compared to the total number of pages on the French Wikipedia, but still this unreproducible bug may sometimes affect an important article, so if as it seems it is a problem of high server load it is important to report the bug. Oliv0 (talk) 09:54, 18 February 2016 (UTC)
Based on the error message it seems that you are trying to access too many entities at once via Lua. Can you link me to an template that is used in these articles and makes use of Lua? --Lydia Pintscher (WMDE) (talk) 10:07, 18 February 2016 (UTC)
The image given above shows that the error messages occurred in this article fr:John Francis Wade at every template using Lua (fr:Template:Infobox Biographie2, fr:Template:Autorité and fr:Template:Portail), however this unreproducible problem did not seem to be due to really accessing the limit number of entities but to server load because the messages disappear with a server purge of the articles. Oliv0 (talk) 06:59, 19 February 2016 (UTC)
There was a high server load earlier this week due to a database schema change. So that probably has been the cause. Mbch331 (talk) 08:35, 19 February 2016 (UTC)
Could this be related to this issue? -- LaddΩ chat ;) 18:11, 19 February 2016 (UTC)

Cancer Book Titleda " Cancer Top Killer in Malaysia" and requesting for your permission to use content

Dear Admin,

We are in the process of writing, publishing and launching a Cancer Book Titled " Cancer Top Killer in Malaysia" and seeking / requesting for your permission to use content in extracting some of images and information for citation/references from –

Wikipedia, the free encyclopaedia- Health effects of tobacco-http://en.wikipedia.org/wiki/Health_effects_of_tobacco

The cancer book is our fundraising project for a few NGOs under our care. 1. Pertubuhan Kebajikan Nurqaseh Pdrm Malaysia (PPM 003-14- 19112014) 2. Persatuan Ibu Bapa & Anak-Anak Sakit Kanser Malaysia (PPN-002-4-15032012) 3. Pertubuhan Kebajikan Nur Hati Selangor Dan Wilayah Persekutan, Kuala Lumpur (No. PPP: sel0514/04[6], No. PPM:2425/04, No. Pendaftaran: 0748-7 sel)

Thank you.

Regards,

Hapsah Mohd Dahalan Hohorary Secretary Perqaseh PDRM Malaysia NGO (Royal Malaysia Police NGO)

This is Wikidata, not the English Wikipedia. Every projects has their own admins, but this isn't really a case for admins. Content on Wikipedia is free for reuse, under certain conditions. Wikipedia uses the CC-BY-SA 3.0/GFDL license. You're allowed to use one of these licenses when reusing content. When using CC-BY-SA 3.0, there are two basic conditions to be met: First you need to mention the author(s) of the text you are reusing. This can be done by either pointing to the history page of the article (https://en.wikipedia.org/w/index.php?title=Health_effects_of_tobacco&action=history) or mentioning everybody that's mentioned on the history page of the article (and there are over a thousand edits on that page). Second condition is that you need to share the reused information under the same license as originally used. It's all explained here: https://en.wikipedia.org/wiki/Wikipedia:Reusing_Wikipedia_content. Mbch331 (talk) 11:56, 19 February 2016 (UTC)

Celestial coordinates

On Wikidata:Requests for comment/DMS datatype, Swpb is wondering about a new data type which would be suitable for storing right ascension (Q13442) and declination (Q76287).

Has anything like that been considered before? And is there anything in Phabricator about it already? (I couldn't find anything, but maybe I'm not searching for the right things)

- Nikki (talk) 19:38, 9 February 2016 (UTC)

Why would it be problem to store it as a quantity with a unit (arcsecond (Q829073))? Lua or other gadgets could easily convert it to degree, minute and second of arc. (Recent thread at Wikidata:Project chat/Archive/2016/01#Storing time with multiple parts.) Matěj Suchánek (talk) 20:27, 9 February 2016 (UTC)
I don't think we had any requests for that yet. Would it be possible to use the globe coordinate with another reference globe for this? --Lydia Pintscher (WMDE) (talk) 11:31, 10 February 2016 (UTC)
The only globe suitable seems to me Universe (Q1), but the problem with that is that every claim made with that globe would need to have (always) a qualifier "relative to Earth". That doesn't seem a sensible solution, nor exactly accurate. --Izno (talk) 14:33, 10 February 2016 (UTC)
Ok that makes sense. Can you open a ticket on phabricator please? --Lydia Pintscher (WMDE) (talk) 08:49, 16 February 2016 (UTC)
  Done --Micru (talk) 13:16, 24 February 2016 (UTC)

Coordinates

Hello,

Regularly I have lot of trouble with coordinates on wikidata.

On Q201653, when I click on "35°39'46.8"N, 139°45'40.4"E" that redirect me on to the coordinates "35, 0" (https://tools.wmflabs.org/geohack/geohack.php?language=en&params=35°39%2746.8"N,%20139°45%2740.4"E). (And the headquarters of SoftBank is not in Algeria ^^). Same things on Q202468, who redirect me to "47, 0" (https://tools.wmflabs.org/geohack/geohack.php?language=en&params=47°45%2712.8304"N,%2010°19%2740.1304"E). Same things on Q202969. Idem on Q202988, etc, etc. In a fast estimation, I see this bug maybe 50 % or more of the time (but I don't remember that bug in summer 2015 when I do some maintenance about coordinates, maybe it new or specific to entreprise items).

A other problem is when I copy and paste some coordinates, on usually maintenance/import from freebase, like on Q202210, the link (to Geohack) on the coordinates disappeared, and it doesn't reappeared with a refresh. Same things on Q202972.

I don't see anything about those problems on phabricator but I don't usually use phabricator so maybe I miss something. --Nouill (talk) 09:22, 24 February 2016 (UTC)

P:P625#P1630 = here for SoftBank https://tools.wmflabs.org/geohack/geohack.php?language=en&params=35°39'46.8%22N,_139°45'40.4%22E is not understood by the geohack tool, the link on the coordinate value should appear as https://tools.wmflabs.org/geohack/geohack.php?params=35_39_46.8_N_139_45_40.4_E Oliv0 (talk) 10:13, 24 February 2016 (UTC)
The URLs are wrong when coordinates are used as qualifiers, the Phabricator ticket for it is phab:T118230. - Nikki (talk) 19:26, 26 February 2016 (UTC)

This is bug in MediaWiki:Gadget-AuthorityControl.js reported at line 186. Fixed for mainsnaks, not fixed for qualifiers. --JulesWinnfield-hu (talk) 21:07, 24 February 2016 (UTC)

  Done Fixed. --JulesWinnfield-hu (talk) 15:01, 27 February 2016 (UTC)

external-id

Some of our templates on svwp suddenly broke, like those with P1841, which suddenly has a new datatype. Where can we read details about the new datatype(s)? -- Innocent bystander (talk) 20:14, 28 February 2016 (UTC)

Here's the tech info: https://lists.wikimedia.org/pipermail/wikidata/2016-February/008140.html. Mbch331 (talk) 20:19, 28 February 2016 (UTC)
Thanks! When I see the plans for this datatype, I wonder how you intend to solve this for propertys with more than one formatter URL (P1630) like Finnish Ministers database ID (archived) (P2182)? The url we prefer on a Swedish speaking wiki is then different from that on a Finnish and an English speaking wiki! On svwp we have a module that automagicly "prefer" the P1630 with language:Swedish as a qualifier. I doubt that is as simple to do if you install the url directly into the item. -- Innocent bystander (talk) 07:36, 29 February 2016 (UTC)
And please, in the future, before you change things like this. Send us a message in the client. A lot of templates on svwiki which used Wikidata suddenly gave error-messages like Unknown datatype. -- Innocent bystander (talk) 10:37, 29 February 2016 (UTC)
It was announced in the weekly summary and many other places. I am not sure how much more noise I can make about changes like this without annoying people who don't care. --Lydia Pintscher (WMDE) (talk) 13:51, 29 February 2016 (UTC)