Affects Version/s: BLAZEGRAPH_2_1_4
Fix Version/s: None
Component/s: Wikidata Query Service
When using custom SERVICE in Wikidata query service, I try to implement this pattern:
data -> SERVICE -> data, i.e. some triple matches done resulting in certain result set, this result set is fed to SERVICE, which produces more bindings, and these bindings are used for further processing. Example:
Part 1 is producing a single row of bindings, with ?category bound to wd:Q7361750.
Part 2 generates a number of bindinds for ?item, ?ns and ?subcat based on data in Wikipedia. This also works and results in 16 rows of bindings.
However, Part 3, that is supposed to add labels to bindings named ?item, does not work. What seems to be happening is that instead of this part being run after SERVICE with ?item already bound, it is reordered to be run before SERVICE, which ?item unbound, which results in considering all labels in the database (millions of them) as valid bindings. This of course does not work and leads to either wrong results on small test databases, or to timeout on complete production database.
Is there a way to force execution of the patterns in exactly the order they are listed in the query - Part 1 first, then SERVICE, then Part 3?