Hello,
I would like to have your opinion regarding the following: I am trying to decide if I should go with federated queries or virtual graphs
I would like to query stardog along with an external DB which exposes a Sparql Endpoint but also a SQL one.
1- The Federated Queries:
SELECT DISTINCT ?a
WHERE
{
?a a qt:Server.
?a qt:hasPoint ?point.
?point qt:hasType pdm:WHr_I.
{
Select ?b ?value
Where
{
?b qt:hasValue ?value.
Filter(?value > 12)
}
}
filter (?a = ?b)
}
group by ?a
With the Federated query the two queries are executed in parallel, which means that the two queries will return values and the join will be performed at the Stardog level, at the filter(?a = ?b) operation. To gain performance, I was hoping to execute the local query first and then the return "?a" will be injected to be filtered at the remote query level.
I think that now in Stardog the two queries run in parallel?
2- Virtual Graphs:
SELECT DISTINCT ?a
WHERE
{
?a a qt:Server.
?a qt:hasPoint ?point.
?point qt:hasType pdm:WHr_I.
GRAPH <virtual://db2>
{
?b qt:hasValue ?value.
Filter(?value > 12)
}
filter (?a = ?b)
}
group by ?a
Since Stardog handles the SQL generation to the virtual graph, I was wondering if you optimize the SQL query by injecting the returned results form the local query?
Thank you very much for your help.
Cheers,
Charbel