Community Wishlist Survey 2017/Archive/Allow embedding of query results in Wikipedia

Allow embedding of query results in Wikipedia

  • Problem: we have a great query system, with timetable, map or graphs showing up and everybody can use it... except us. There's no way to embed dynamically generated query answers in Wikipedia.
  • Who would benefit: Wikipedia readers, as they can see good quality and interactive elements within articles.
  • Proposed solution: Maybe a bypass of iframe ban on Wikipedia could be done for Wikidata query results.
  • More comments:
  • Phabricator tickets:

Discussion edit

@Theklan:, could you provide a few concrete example of what you want? Max Semenik (talk) 01:04, 21 November 2017 (UTC)[reply]

I assume it's to be able to embed the results of a Wikidata service query into a wiki page, presumably by writing the SQL into the wiki page (between some bracketed magic words) and then the wiki display the results. (Probably the problem would be caching.) Right now there is a bot that serves as a proxy, User:ListeriaBot, that can provide this. --Izno (talk) 04:29, 21 November 2017 (UTC)[reply]
Listeriabot creates lists. There's no way to embed dynamic maps or timetables. -Theklan (talk) 11:44, 21 November 2017 (UTC)[reply]
Another bot could be developed to output GeoJSON or another Map extension-friendly format. Timetables might be SOL on regardless since they would probably rely on HTML on the Mediawiki blacklist (but maybe not). --Izno (talk) 14:08, 21 November 2017 (UTC)[reply]
But this approach is different. Query content is dinamyc, so we can zoom in or out, pan, drag, click, see... and every other option that is not an iframe embedding would make static maps (as happens with graph extension). -Theklan (talk) 21:45, 21 November 2017 (UTC)[reply]

@MaxSem:: if we make this query we can see a map. The map has an an embed result that gives this code:

<iframe style="width: 80vw; height: 50vh; border: none;" src="https://query.wikidata.org/embed.html#%23defaultView%3AMap%0ASELECT%20%3Fitem%20%3Fkoord%20%3Firudia%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP131%2a%20%3Fnon.%0A%20%20wd%3AQ47588%20wdt%3AP527%20%3Fnon.%0A%20%20%3Fitem%20wdt%3AP31%20wd%3AQ513550.%0A%20%20%3Fitem%20wdt%3AP625%20%3Fkoord.%0A%20%20OPTIONAL%20%7B%20%3Fnon%20wdt%3AP18%20%3Firudia.%20%7D%0A%7D" referrerpolicy="origin" sandbox="allow-scripts allow-same-origin allow-popups" ></iframe>

This code can't be embedded in Wikipedia, so we can't benefit of dynamic maps in our articles. The same happens for timelines. Look at this query. And now try to embed the timeline somehow in an article. Impossible, isn't it? But all the people except Wikipedians can embed it via an iframe in their blog, app... and it seems quite weird for me not to be able to reuse something that we are creating. -Theklan (talk) 11:49, 21 November 2017 (UTC)[reply]

The problem here is that current WDQS setup is nowhere near as powerful as required for this to happen on Wikipedia. We have some discussions to give it more servers, but even if these plans will be set in motion, the work won't start before the second half of 2018, which means that Community Tech will not be able to work on this project before the next survey. Another problem is query duration: it's very easy to write a slow query that will run for multiple seconds which means that page saving will take much longer which will negatively affect contributors' experience. Considering all this, I'm archiving this proposal, with the understanding that next year the situation might be different and at least some parts of this proposal might be workable. Max Semenik (talk) 22:33, 21 November 2017 (UTC)[reply]