docs: private Schema.BaseType getBaseType(VertexElement vertex) {
          try {
              return Schema.BaseType.valueOf(vertex.label());
          } catch (IllegalArgumentException e) {
              //Base type appears to be invalid. Let's try getting the type via the shard edge
              Optional<VertexElement> type = vertex.getEdgesOfType(Direction.OUT, Schema.EdgeLabel.SHARD).
                      map(EdgeElement::target).findAny();
  
              if (type.isPresent()) {
                  String label = type.get().label();
                  if (label.equals(Schema.BaseType.ENTITY_TYPE.name())) return Schema.BaseType.ENTITY;
                  if (label.equals(RELATION_TYPE.name())) return Schema.BaseType.RELATION;
                  if (label.equals(Schema.BaseType.ATTRIBUTE_TYPE.name())) return Schema.BaseType.ATTRIBUTE;
              }
          }
          throw new IllegalStateException("Could not determine the base type of vertex [" + vertex + "]");
      }