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

This page is an archive. Please do not modify it. Use the current page, even to continue an old discussion.

Query Service issues

Could one of the team please cast an eye over recent discussions at mw:Talk:Wikidata query service - there seems to be a backlog needing attention.

Perhaps that page should have a soft-redirect to a page on this wiki? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:51, 2 February 2018 (UTC)

Thanks for mentioning it, we will have a look. Lea Lacroix (WMDE) (talk) 08:58, 5 February 2018 (UTC)

Format for coordinates

It's a small issue, but nevertheless a quite annoying behaviour of the user interface: The easiest way to get good coordinates "by hand" is IMO to look something up on Open Streetmap and then copy/paste from the URL after you "center" on the exact location you want. In that URL, the coordinates are in the form "48.88609/8.99962". When pasting that to P625, e. g., one always needs to replace the / with a space to make this work. I know that in some formats, the slash is used to separate degrees from minutes, seconds, and so on, but wouldn't it be possible to first check if the entered text has exactly that format "decimal number/decimal number" (optionally with a "-" for negative numbers, but nothing else) and just accept that? --Anvilaquarius (talk) 18:08, 5 February 2018 (UTC)


P2559 (Wikidata usage instructions)

Could we move Wikidata usage instructions (P2559) further up the display order please, to make it more prominent? People need to see this when they first see an item -- it's no good if it's hidden right down at the bottom.

has part(s) (P527) could also benefit with being higher up -- ideally just after part of (P361). Thanks! Jheald (talk) 18:10, 6 February 2018 (UTC)

MediaWiki:Wikibase-SortedProperties. Matěj Suchánek (talk) 18:44, 6 February 2018 (UTC)
@Matěj Suchánek: Is that the order actually used in the presentation? Jheald (talk) 19:07, 6 February 2018 (UTC)
It is. Is there something that makes you think the opposite? For instance, today I made a change to have legal form (P1454) placed a bit higher and it works. Matěj Suchánek (talk) 19:15, 6 February 2018 (UTC)

Change P4793 to External Identifier

Shortly after this property (identifiers.org prefix (P4793)) was created it was discovered it did have a formatter URL and made sense as an external id property rather than a String. See the discussion at Property talk:P4793. Can we get this changed? Thanks! ArthurPSmith (talk) 21:42, 5 February 2018 (UTC)

A ticket has been created. Lea Lacroix (WMDE) (talk) 13:12, 12 February 2018 (UTC)

Now done. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:52, 16 February 2018 (UTC)

I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:52, 16 February 2018 (UTC)

Label Query service and property label

This query timeouts :

select distinct ?prop ?propLabel {
  ?item (p:P1766|p:P41|p:P4004) [?qual []] .
  ?prop wikibase:qualifier ?qual .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} limit 1
Try it!

whereas this one seem to be pretty quick

select distinct ?prop ?propLabel {
  ?item (p:P1766|p:P41|p:P4004) [?qual []] .
  ?prop wikibase:qualifier ?qual .
  #SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} limit 1
Try it!

so either there is a bug with the label service if you require labels for properties, or there is a big performance issue at the moment. author  TomT0m / talk page 12:47, 10 February 2018 (UTC)

@Smalyshev (WMF): Do you know anything about this? Lea Lacroix (WMDE) (talk) 08:35, 12 February 2018 (UTC)
select distinct ?prop ?propLabel {
  { SELECT DISTINCT ?prop {
   ?item (p:P1766|p:P41|p:P4004) [?qual []] .
   ?prop wikibase:qualifier ?qual .
  } LIMIT 1 }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Without it, label service probably does much more work than it should with the limit clause. Smalyshev (WMF) (talk) 07:15, 13 February 2018 (UTC)

@Smalyshev (WMF): You mean that it computes the label systematically and even if « ?propLabel » is not used at all in the query ? But most of the time the label is useless in the query ! This is suboptimal and not very user friendly to encapsulate the query just for that.
Then I guess it may be worth coding a data view that displays the label and compute it at viz time, or a js gadget that computes the label from the item identifier, according to the user language, without having to dealing with this on the query. author  TomT0m / talk page 14:51, 13 February 2018 (UTC)
@TomT0m: Not exactly, what I mean is I suspect the service is called on more than one property, even though limit 1 is set... It is not called if you don't have ?propLabel - it wouldn't know what to do then - but it is called when you have it, and probably more than once. If you wrap the inside query, it would be called only once. Also, I'm not sure you need distinct there - if you have limit 1, there's no chance of result having duplicates as far as I can see.
It is possible to do visualization mode that fetches labels at display time, and for big result sets it may be advantageous, but for small ones - not so sure, unless of course the query is suboptimal. But that's not a bad idea to have such mode, could you submit a phab task describing the idea? Smalyshev (WMF) (talk) 20:10, 13 February 2018 (UTC)
(1) That’s what I had in mind. Each time the query service « choose » a value for « ?prop » it computes the value for « ?propLabel », even if « ?prop » is discarded later. This is suboptimal as no « ?prop » value can be discarded through « ?propLabel », nor the value or any other variable in the query. (There is a functional dependancy between ?prop and ?propLabel, but nothing actually depends on the value of ?propLabel). Of course this is a very particular case that ?propLabel appears only on the projected variable, so it’s easy to see. Maybe if the query engine new that the « label » service result is functional (always has one and only one value xLabel for each ?x value) it could take advantage of this, for example through some kind of « constraint network » analysis, in constraint programming (Q528588) terminology. After some googling this seem to be described for example here. Although it’s a very particular case as usually we can’t be sure that there is a functional dependancy between two or more variables in graph patterns, except in a very few cases (for example we are sure that for every property we have 1 corresponding qualifier property, and the other way around). If he’s aware of this, the query engine could delay the computed of dependant values to the projection step. Maybe he does this but the « service » extension does not allow it to draw the conclusion he can.
I’ll file a ticket. author  TomT0m / talk page 12:29, 14 February 2018 (UTC) @Smalyshev (WMF): done. author  TomT0m / talk page 13:01, 14 February 2018 (UTC)

Statement only visible to some users?

There's a strange edit war going on on Q1218, where two users (@Sokuya, Emir of Wikipedia:) have been repeatedly adding what appears to me to be a duplicate of the official website (P856) statement, and one editor (@Triggerhippie4:) has been reverting them. The edit summaries are quite confusing: (revert) "already here", (re-add) "I can't find it here. There is no official website parameter.", (revert) "there is", (re-add) "restore", (revert) "it's a duplicate. are you blind?", etc. Now, I can see what is either the original statement or some kind of technical glitch, but I don't know if that means much here. Is there any chance that something on this item is causing it to appear differently for different users? (Also, to the two users who don't see the statement, could you try to do a Ctrl-F search for "official website" if you haven't done so, just to make sure you didn't somehow both miss the statement? And to any passers-by, could you post whether the statement appears for you?) --Yair rand (talk) 17:59, 19 February 2018 (UTC)

I did search with Ctrl-F but didn't find it. Strangely it does appear on Q1218 when I scroll manually to find it. Somehow the "official website" string not found with Ctrl-F, very strange (I'm using Safari browser on Mac, I've a screenshot of it but don't know where to upload it so you can see it too). @Triggerhippie4: is right, it does appear. I can see it now when I scroll manually to find it. Sokuya (talk) 18:32, 19 February 2018 (UTC)
Using Firefox on Windows find works for me. Mbch331 (talk) 18:44, 19 February 2018 (UTC)
I can see it now. Prior to when I reverted I did do Ctrl-F and couldn't find it which is why I reverted. --Emir of Wikipedia (talk) 19:28, 19 February 2018 (UTC)
I was able to find it with Ctrl-F during the edit-war, and still can (Chrome, Windows). --Triggerhippie4 (talk) 00:03, 20 February 2018 (UTC)
I can find it without problem. A cache issue, maybe ? --Hsarrazin (talk) 08:32, 20 February 2018 (UTC)

Query timeout (Dutch descriptions)

There is a timeout problem at Wikidata:Request_a_query#People_without_Dutch_description brought up by Mbch331. Instead of pinging Lucas Werkmeister there, the formally better way to bring this up would be to post it here (sorry about it Lucas). It's a general request for maintenance ..
--- Jura 08:28, 20 February 2018 (UTC)

To break down the problem, why does this query work:
SELECT ?item WHERE {
  ?item wdt:P31 wd:Q5
  OPTIONAL {?item schema:description ?descnl FILTER((LANG(?descnl)) = "nl")   }
} LIMIT 1
Try it!
but not this query:
SELECT ?item WHERE {
  ?item wdt:P31 wd:Q5
  OPTIONAL {?item schema:description ?descnl FILTER((LANG(?descnl)) = "nl")   }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
} LIMIT 1
Try it!
and not this query:
SELECT ?item WHERE { {
SELECT ?item WHERE {
 ?item wdt:P31 wd:Q5
 OPTIONAL {?item schema:description ?descnl FILTER((LANG(?descnl)) = "nl")   }
} LIMIT 1
} }
Try it!
--Pasleim (talk) 10:20, 20 February 2018 (UTC)

I think there is a FILTER ( !BOUND(?descnl) ) missing in Pasleim's sample. It might be better to just experiment with Mbc331's sample and attempt to get it to work. Here there are two queries that don't work (and did work, or at least should work) and one that does.
--- Jura 10:57, 20 February 2018 (UTC)

#times-out even with hint
SELECT ?item ?itemLabel
WHERE
{ 
  # hint:Query hint:optimizer "None".  
  {
    SELECT ?item 
    WHERE
    {  ?item wdt:P31 wd:Q5
        OPTIONAL { ?item schema:description ?descnl FILTER(LANG(?descnl) = "nl")   }
        FILTER ( !BOUND(?descnl) )
    }
    LIMIT 1
    }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!


#times-out even with hint
SELECT ?item ?itemLabel
WITH
{ 
    SELECT ?item 
    WHERE
    {  ?item wdt:P31 wd:Q5
        OPTIONAL { ?item schema:description ?descnl FILTER(LANG(?descnl) = "nl")   }
        FILTER ( !BOUND(?descnl) )
    }
    LIMIT 1
} as %include  
WHERE
{
  # hint:Query hint:optimizer "None".  
  INCLUDE %include
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!
#works
SELECT ?item
WHERE
{ 
        ?item wdt:P31 wd:Q5
        OPTIONAL { ?item schema:description ?descnl FILTER(LANG(?descnl) = "nl")   }
        FILTER ( !BOUND(?descnl) )
}
LIMIT 5000
Try it!


Hope that clarifies it.
--- Jura 10:57, 20 February 2018 (UTC)

Merging two items

Dear Wikipedia,

I've noticed that the En, Id, Sv entries for Mystic Ark are separated from the Ja entry for Mystic Ark. For some reason I can't merge the two items. I've forgotten my Wikipedia account, and I have little clue as to how to use Wikipedia beyond browsing, and I have other things to do...

https://www.wikidata.org/wiki/Q6948921

https://www.wikidata.org/wiki/Q11342060

They're about the same thing, so I think they should be merged.  – The preceding unsigned comment was added by 98.163.90.2 (talk • contribs) at 20. 2. 2018, 14:44‎ (UTC).

  Merged Matěj Suchánek (talk) 15:33, 20 February 2018 (UTC)

WD:Lexicographical data

Unfortunately, bad things went on when WD:Wiktionary got moved to WD:Lexicographical data. All non-translation subpages were moved but without existing translations (which seems to be a bug). The only way to fix it is to undo all sub-moves and then move them one by one. I'm currently working on fixing this. Matěj Suchánek (talk) 20:15, 25 February 2018 (UTC)

Thanks Matěj. It's the first time I try such a big renaming including a lot of subpages and translation pages, and obviously it didn't go as expected ^^ Lea Lacroix (WMDE) (talk) 09:12, 27 February 2018 (UTC)