@Override public boolean isDeleted(GraphCentricQuery query, JanusGraphElement result) { if (result == null || result.isRemoved()) return true; else if (query.getResultType() == ElementCategory.VERTEX) { Preconditions.checkArgument(result instanceof InternalVertex); InternalVertex v = ((InternalVertex) result).it(); return (v.hasAddedRelations() || v.hasRemovedRelations()) && !query.matches(result); } else if (query.getResultType() == ElementCategory.EDGE || query.getResultType()==ElementCategory.PROPERTY) { Preconditions.checkArgument(result.isLoaded() || result.isNew()); //Loaded relations are immutable so we don't need to check those //New relations could be modified in this transaction to now longer match the query, hence we need to //check for this case and consider the relations deleted return result.isNew() && !query.matches(result); } else throw new IllegalArgumentException("Unexpected type: " + query.getResultType()); }