code: public static Object getTypedValue(String valueStr, Attribute attr) {
      // Reference types cannot be processed because we lack an entityManager in this route.
      if (EntityTypeUtils.isReferenceType(attr)) {
        throw new MolgenisDataException(
            "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities");
      }
      return getTypedValue(valueStr, attr, null);
    }
docs: Convert a string value to a typed value based on a non-entity-referencing attribute data type.
  
  @param valueStr string value
  @param attr non-entity-referencing attribute
  @return typed value
  @throws MolgenisDataException if attribute references another entity