On 27/10/2015 08:42, Stas Malyshev wrote:
Hi!
It should be a basic requirement of any SPARQL engine that it should be able to handle path queries that contain cycles.
So I did some simple checks, and on simple examples Blazegraph handles cycles just fine. However, on more complex queries, the cycles seem to be causing trouble. I don't know yet why, I'll look at it further, probably next week.
So the problem is not "handling cycles" in general, it is handling some specific data set, and most probably is a consequence of some bug. I'll report when I have more data about what exactly triggers the bug.
The key issue with if a graph contains cycles is that you can not then just assume that each successive generation of nodes obtained by adding another path step are by definition new nodes (as they would be for an acyclic graph -- well not entirely, because you might already have reached them by a shorter path; but nothing's going to seriously break with an acyclic graph if you get this check wrong).
In contrast, with a graph that contains cycles, you need to do some sort of hash join with what you have already seen, to specifically identify the new nodes.
If the query planner is somehow messing up those hash joins when given multiple interrelated path requirements, that could be a source of trouble.
-- James.