ad-freiburg / qlever-ui

A user interface for QLever
Apache License 2.0
21 stars 15 forks source link

"Connected Lines" context incomplete for some completion queries #16

Closed hannahbast closed 4 years ago

hannahbast commented 4 years ago

Consider the following query on Wikidata, where _ is the cursor position (Q873 is "Meryl Streep", P166 is "award received", P31 is "instance of"):

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT WHERE {
  wd:Q873 p:P166 ?m .
  ?m ps:P166 ?award .
  ?award wdt:P31 _
}

Then the "core" part of the completion query is

SELECT ?qleverui_entity (COUNT(?qleverui_entity) AS ?qleverui_count) WHERE {
  ?m ps:P166 ?award_received .
  ?award_received wdt:P31 ?qleverui_entity .
}
GROUP BY ?qleverui_entity

The first triple is missing, but it should be there because it is connected to the second triple which in turn is connected to the third triple. This is apparently a bug in computing the "Connected Lines" (both in the master and in the branch). It explains various unexpected rankings we have been getting in the past