title: Fetch core data object where to-many relationship contains all objects in a set
body: <p>What I'm looking for is a succinct way to fetch a core-data object that is identified uniquely by its relationships. e.g., given the data model:</p>
  
  <p><img src="https://i.stack.imgur.com/Qa11K.png" alt="enter image description here"></p>
  
  <p>... and given a set of <code>NSManagedObject</code> nodes, I'd like to fetch a triangle, or at least know if a TriangleEntity exists like so:</p>
  
  <pre><code>NSSet *nodeSet = // a set of 3 NSManagedObject*s
  NSFetchRequest *request = [[NSFetchRequest alloc] initWithEntityName:@"TriangleEntity"];
  NSPredicate *predicate = [NSPredicate predicateWithFormat:@"corners CONTAINS ALL %@", nodeSet]; 
  </code></pre>
  
  <p>I don't think that <code>CONTAINS ALL</code> is proper syntax -- And I know that I could just unpack the NSSet and fetch </p>
  
  <pre><code>@"corners CONTAINS %@ AND corners CONTAINS %@ AND corners CONTAINS %@", setObj1, setObj2, setObj3
  </code></pre>
  
  <p>... but that seems silly. Is there a more elegant solution?</p>