small refactoring
addStmt leads to an invalidateByTriple call to the QueryCache

+ test cases