code: static void validateOwnLabelAttribute(
        EntityType entityType, Map<String, Attribute> ownAllAttrMap) {
      // Validate label attribute
      Attribute ownLabelAttr = entityType.getOwnLabelAttribute();
      if (ownLabelAttr != null) {
        // Validate that label attribute is in the attributes list
        Attribute ownAttr = ownAllAttrMap.get(ownLabelAttr.getIdentifier());
        if (ownAttr == null) {
          throw new MolgenisValidationException(
              new ConstraintViolation(
                  format(
                      "Label attribute [%s] is not one of the attributes of entity [%s]",
                      ownLabelAttr.getName(), entityType.getId())));
        }
  
        // Validate that the label attribute is not nillable
        if (ownAttr.isNillable()) {
          throw new MolgenisValidationException(
              new ConstraintViolation(
                  format(
                      "Label attribute [%s] of entity type [%s] cannot be nillable",
                      ownLabelAttr.getName(), entityType.getId())));
        }
      }
    }
docs: Validate that the label attribute owned by this entity is part of the owned attributes.
  
  @param entityType entity meta data
  @param ownAllAttrMap attribute identifier to attribute map
  @throws MolgenisValidationException if the label attribute is not an entity attribute