code: public void deleteEntities(Collection<AtlasVertex> instanceVertices) throws AtlasBaseException {
          RequestContextV1 requestContext = RequestContextV1.get();
  
          Set<AtlasVertex> deletionCandidateVertices = new HashSet<>();
  
          for (AtlasVertex instanceVertex : instanceVertices) {
              String              guid = AtlasGraphUtilsV1.getIdFromVertex(instanceVertex);
              AtlasEntity.Status state = AtlasGraphUtilsV1.getState(instanceVertex);
  
              if (state == AtlasEntity.Status.DELETED) {
                  LOG.debug("Skipping deletion of {} as it is already deleted", guid);
                  continue;
              }
  
              String typeName = AtlasGraphUtilsV1.getTypeName(instanceVertex);
              AtlasObjectId objId = new AtlasObjectId(guid, typeName);
  
              if (requestContext.getDeletedEntityIds().contains(objId)) {
                  LOG.debug("Skipping deletion of {} as it is already deleted", guid);
                  continue;
              }
  
              // Get GUIDs and vertices for all deletion candidates.
              Set<GraphHelper.VertexInfo> compositeVertices = getOwnedVertices(instanceVertex);
  
              // Record all deletion candidate GUIDs in RequestContext
              // and gather deletion candidate vertices.
              for (GraphHelper.VertexInfo vertexInfo : compositeVertices) {
                  requestContext.recordEntityDelete(new AtlasObjectId(vertexInfo.getGuid(), vertexInfo.getTypeName()));
                  deletionCandidateVertices.add(vertexInfo.getVertex());
              }
          }
  
          // Delete traits and vertices.
          for (AtlasVertex deletionCandidateVertex : deletionCandidateVertices) {
              deleteAllTraits(deletionCandidateVertex);
              deleteTypeVertex(deletionCandidateVertex, false);
          }
      }
docs: Deletes the specified entity vertices.
  Deletes any traits, composite entities, and structs owned by each entity.
  Also deletes all the references from/to the entity.
  
  @param instanceVertices
  @throws AtlasException