You have to be careful here because if someone uses options `-b`, `\SMW\StoreFactory::getStore()->getQueryResult( $query );` is incorrect.

See https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/maintenance-datarebuilder/maintenance/rebuildData.php#L108