Page MenuHomePhabricator

Add Kartographer transformation to Code tab
Closed, ResolvedPublicFeature


Feature summary (what you would like to be able to do and where):
When you have results for a Wikidata query, there is a handy option called </> Code that makes it easy to reuse the query in a number of different ways.

It would be handy to have an option in there that prepares the query for being used in a Kartographer <mapframe>. This requires some fairly straightforward adjustments, but they are tedious to do manually and easy to forget

I don't know all the things it needs to do, but it really needs to swap " to ' or the mapframe will throw an error.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
Often when you try to use a query in Kartographer, you get a JSON error (with poor error text), especially since many examples and the autocompleter uses ".
An example is shown in this video clip (although in that case, no one else but me is to blame):

Benefits (why should this be implemented?):
This will make it easier to make Wikidata supported Kartographer maps.

Event Timeline

Do you have a link to a wiki page with a mapframe that could come out of WDQS? It'd be good to see what the end result would need to look like.

Escaping the double quotes (\") seems to work just as well (user sandbox), and sounds like a much better idea to me than replacing them with single quotes and hoping the result is an equivalent query.

For legibility, I would prefer single quotes rather than escaping, but if there are some queries where single or double quotes matter (I wasn't ware it could be), then escaping is of course a better solution.

If something is added please also consider adding pandas see T257117

Change 856032 had a related patch set uploaded (by Gerrit Patch Uploader; author: Jan Ainali):

[wikidata/query/gui@master] Add mapframe example to code examples

Change 856032 merged by jenkins-bot:

[wikidata/query/gui@master] Add mapframe example to code examples

The Gerrit change implementing this was included in this query-gui build, so it should be deployed soon (within 30 minutes, I believe).