QueryResults result = query.execute();
if (result.isEmpty()) return false;
if (result.getRowCount() < 0) {
// Try to get the first row ...
NodeSequence seq = result.getRows();
Batch batch = seq.nextBatch();
while (batch != null) {
if (batch.hasNext()) return true;
// It's not common for the first batch may be empty, but it's possible. So try the next batch ...
batch = seq.nextBatch();
}