Page MenuHomePhabricator

Suggestions for auto completion suggestions
Open, Needs TriagePublic

Description

The query service interface has autocomplete suggestions accessible via Ctrl-Space. One of these is the following

SELECT * WHERE {

}

This is useful, but not quite enough to avoid a lot of repetitiveness in typing out queries. Here are some other code blocks which I find myself typing quite frequently, which I think would be useful as suggestions:

SELECT ?item ?itemLabel WHERE {
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
#defaultView:Graph
SELECT ?s ?sLabel ?t ?tLabel WHERE {
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
SELECT (COUNT( * ) AS ?count) WHERE {
  
}
SELECT ?item ?itemLabel (COUNT( ?i ) AS ?count) WHERE {
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} GROUP BY ?item ?itemLabel ORDER BY DESC ( ?count )

Some other more general suggestions:

wdt:P31 / wdt:P279*
prov:wasDerivedFrom / pr:P248
FILTER EXISTS {
  
}

Event Timeline

Restricted Application added projects: Wikidata, Discovery. · View Herald TranscriptJul 12 2017, 12:49 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

We could add some auto completion here:
Source Code

Some of them would better fit here T165727: Query Examples - boilerplate queries section

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJul 12 2017, 8:55 AM

Another suggestion: When ?x is declared as a variable, ?xLabel should be on the list of suggestions for variable names.