Page MenuHomePhabricator

Provide path towards SPARQL queries
Closed, ResolvedPublic

Description

Requested on two other forums:

optionally provide way of supplying two links in each box

  • one to a query that delivers all the items with the property
  • the other to a query that delivers all the items that don't

It would be great if you could click on any of the green squares & a list of those items that are missing that property appeared. Will really help with the completeness. Maybe only first 10, 20 or 50 for long lists.

it would be great to have 2 pregenerated queries for missing and completed property for the items.

The inconvenient part: our SPARQL queries are not that long, but still, throwing two complete URLs to the query service for each cell will blow up the page size.

Current suggestions:

  1. Generate short URLs
  2. Create a helper template that will generate these links
  3. Create a link to integraality with a few params, which redirects to the WDQS.

Also, I’m ensure how this should look from a UI perspective − there’s just not that much space in each cell, so I really don’t see how to cram two links in there. One link would be doable.

Event Timeline

I’m not keen on 1/, because generating crazy amount of arbitrary ShortURLs will eat up short URLs for no good reason (also, pretty sure this would be throttled).

2/ and 3/ are actually the same really − because 3/ could be made using a template too ;)

Does wikidata have a limit on how many templates can be on a page?

In the brackets you already show the number of items with this property. Hyperlink that. The second link for the negatives could also be in the brackets as a count, so it might look like "86.56% (2300:357)" where both the 2300 and the 357 are hyperlinks.

Or if that is too much, scrap the counts entirely (a percentage is already clear), and add two links with the symbols + and -. So it could end up simply as "86.56% (+ -)"

Or if that is too much, scrap the counts entirely (a percentage is already clear), and add two links with the symbols + and -. So it could end up simply as "86.56% (+ -)"

Yeah this is what I was thinking: do a return after the percentage with the number and the +/- or something like (=/≠ ).

I've made progress on this. The page already calls a template ("Coloured cell") per cell, so my concern about template limits is irrelevant. So I decided to go with your "option 2", and made a helper template to generate these links. It has been set up as a wrapper for Coloured cell.

The template: https://www.wikidata.org/wiki/Template:Integraality_cell
A test case: https://www.wikidata.org/wiki/Template:Integraality_cell/test

Note that each cell now needs 5 parameters instead of 2:
{{Integraality cell |
1=(number between 0.00 and 100.0, as currently supplied to Coloured cell)|
2=selector_SPAQRL|
3=grouping_property|
4=group_item|
5=column_property
}}

In each case it's ok to have spaces in the values of parameters, as they will get encoded. It will probably break if there are ever pipes or curly brackets in a parameter value.

JeanFred claimed this task.
JeanFred triaged this task as High priority.
JeanFred added a subscriber: VIGNERON.

Thanks @99of9 for working on this! And apologies for dropping this for so long ^_^

I looked into this during my sprint for the WikidataCon service pack update. UI wise, I had done beforehand some user-testing with @VIGNERON. We iterated on the +/- idea, on using emojis, images, Unicode characters − it was tough to find something that was good: most things we tried were unclear (“what’s that link for?”) and/or ugly (non-transparent icons, text links coloured in blue/purple not visible with the blue backgrounds.

Eventually I realised that it did not have to be a single link if I needed to have a redirection layer anyways − that layer could provide both options. Also option 2 required to slap in every cell information that is already set in the configuration template − Option 3 allowed to stay DRY. So that’s what I went for :)

This was added in 9e103b1. I modeled the SPARQL queries on the work on 99of9, but please do double check them.

Closing this as Resolved.