From: Lee K. <le...@sw...> - 2015-04-20 18:28:19
|
Hi, We are currently evaluating using Blazegraph as our rdf database and have run in the issue described at http://trac.bigdata.com/ticket/757. The below query causes the AssertionError to be thrown: SELECT (COUNT(*) as ?c) { SELECT ?uri ?graph where { { SELECT * WHERE { GRAPH ?graph { ?uri a <http://object> . ?uri <http://purl.org/dc/terms/title> ?title . } MINUS { ?uri a <http://other> } } ORDER BY ?title } } } Some debugging shows that the error is caused by the ASTWildcardProjectionOptimizer failing to recurse into the subqueries to rewrite the * projection. However this recursion is implemented in the BOpUtility.postOrderIterator(BOp) method - this method uses the argIterator to find child operators and therefore only visits children for nodes with an arity > 0. The root query node for the above query has an empty 'args' collection and all the associated components of the top-level query are stored in the annotations map. It looks like the iterator should search through the annotations rather than the args for query nodes. As there are a lot of implementations of the BOp interface, it seems that changing the postOrderIterator2(BOp) method is unlikely to be the correct fix. It seems that either the AST query nodes should override the arity() function to return the count of the annotations map, or the ASTWildcardProjectionOptimizer should use its own iterator for the nodes of the query. The latter option would be the least impactful change but I am not familiar with the codebase to understand the correct fix. Any help in resolving the issue would be appreciated. |