title: Create a set from a string of elements in Rego
body: <p>How to create a set from a string in Rego Open Policy Agent language?</p>
  
  <p>I've a string of elements like <code>"values": "pvc-volume,emptydir-volume,hostPath,ConfigMaps"</code> which elements  need to be validated against a given set of admitted values    </p>
  
  <pre><code>valid_backup_profiles := {
        "pvc-volume",
        "emptydir-volume"
      }
  </code></pre>
  
  <p>for example using intersection</p>
  
  <p><code>valid_backup_profiles &amp; elements_coming_from_string_above</code></p>
  
  <p>I know the <code>split(string, ",")</code> function returning an array of elements but the array cannot be intersected with a set. Is there any smart way to generate a set from a string instead of an array?</p>