Smalyshev closed this task as "Resolved".
Smalyshev added a comment.

This one works now:

SELECT ?item ?taxonName ?taxonRank ?parentName ?parentRank ?higherParent WHERE {
  BIND("Rivasmartinezia" AS ?taxonName) .
  BIND(wd:Q34740 AS ?taxonRank) . # Genus
  BIND(wd:Q756 AS ?higherParent) . # Plantae
  ?item wdt:P225 ?taxonName .
  ?item wdt:P105 ?taxonRank .
  ?item wdt:P171/wdt:P225 ?parentName .
  ?item wdt:P171/wdt:P105 ?parentRank .
  ?item (wdt:P171)* ?higherParent .
  hint:Prior hint:gearing "forward" .
}

(note the hint). The hint allows to control in which direction the path is traversed.
See also https://wiki.blazegraph.com/wiki/index.php/QueryHints

Since this is probably the only solution for this now (it's very hard to make optimizer always guess correctly which way to go) and upstream ticket is considered resolved for now, I'm resolving this too.


TASK DETAIL
https://phabricator.wikimedia.org/T145899

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Smalyshev
Cc: Aklapper, Smalyshev, QZanden, EBjune, merbst, Avner, debt, Gehel, D3r1ck01, Jonas, FloNight, Xmlizer, Izno, jkroll, Wikidata-bugs, Jdouglas, aude, Deskana, Manybubbles, Mbch331, Jay8g, Krenair
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to