Page MenuHomePhabricator

ASK returns wrong result with property path
Closed, ResolvedPublic

Description

After finding an odd result while testing an ASK query, I stumbled upon this obvious example case :

ASK {
  wd:Q618123 wdt:P279+ wd:Q5 . # is "geographical object" an indirect subclass of "human being"
}

returns true. Results are the same with wdt:P279* (is indirect or direct subclass of).

Oddly enough, the same query without + (direct subclass of) returns false :

ASK {
  wd:Q618123 wdt:P279 wd:Q5 . # is "geographical object" a direct subclass of "human being"
}

and this SELECT query returns no result (as expected, quite frankly :-D ) :

SELECT ?q
WHERE {
  wd:Q618123 wdt:P279* ?q . # "geographical object" is a direct or indirect subclass of the class we're looking for
  ?q wdt:P279* wd:Q5 # which is itself a direct or indirect subclass of "human being"
}

So wd:Q618123 is a { direct or indirect } and { indirect } subclass (so it must be indirect by intersection) of wd:Q5. But it is not a direct subclass of wd:Q5 (which we've already established), and it is impossible to find an intermediate class between wd:Q618123 and wd:Q5, which means it isn't an indirect subclass of wd:Q5 either.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Smalyshev renamed this task from ASK considers absurd subclasses as valid in Wikidata Query Service to ASK returns wrong result with property path.Sep 12 2016, 10:33 PM
Smalyshev triaged this task as Medium priority.
Smalyshev moved this task from Incoming to Need investigation on the Wikidata-Query-Service board.
Smalyshev moved this task from Need investigation to Blazegraph on the Wikidata-Query-Service board.
Smalyshev claimed this task.

Fixed in BG 2.1.5