dsp-api
dsp-api copied to clipboard
Don't allow Gravsearch queries that describe more than one graph
All the entities mentioned in the WHERE clause of a Gravsearch query must be connected, directly or indirectly, to the main resource.
We could check this by representing the WHERE clause as a graph, using a graph library such as Graph for Scala. We would then traverse this graph starting with the main resource. If the WHERE clause contains any entities that we don't encounter during the traversal, the query is invalid.