The problem with this query is that all bind + concat are executed sequentially and this is slow (I wanna use more complex functions that concat. I use concat as an example).
is there a way to for the bind and concat to run in parallel for all possible values of ?o ?
No, this is currently not possible. We might consider something like that in the future, for really expensive UDFs, but for now your best course of action is to run multiple queries in parallel, each reading some non-overlapping part of the relevant data (i.e. ?s http://geophy.io/ontologies/system#value ?o), and doing the HTTP requests.
Alternatively you may try to collect all those 1000 resources in one query and batch them for HTTP requests, if possible. That’s likely to scale better than doing 1000 parallel HTTP requests.
just a question from my side. I know that in general databases are able to parallelize the UNION operator. Does this also hold for Stardog? If so, one could also compute n subqueries for each chunk of the data and combine those results by the UNION operator. Indeed, that’s more or less the same as executing n separate queries.
Yeah, that’s a good point. We have looked into it at some point in the context of reasoning (since query rewriting transforms the original query into a UCQ, union of conjunctive queries). But at this point this isn’t enabled in Stardog and queries run single-threaded. It’s certainly something we plan to return to in some not very distant future.