Just pass rule_data to the import function on the entity, it will handle the validation for you and will throw an exception if necessary.