title: Storing gremlin count values and comparing later in traversal
body: <p>I am new to Gremlin and have just started with it.I have a graph where every vertex has a property <strong><em>Referenceable.qualifiedName</em></strong> and <strong><em>__typeName</em></strong>.</p>
  
  <p>Edge label between vertices with '__typeName' as 'avro_schema' and 'avro_field' is <strong><em>'__avro_record.fields'</em></strong> and there is 1 to many relationship between 'avro_schema'(1) and 'avro_field'(many).</p>
  
  <p>Edge label between vertices with '__typeName' as 'avro_field' and 'DataClassification' is <strong><em>'classifiedAs'</em></strong> and there is 1 to many relationship between 'avro_field'(1) and 'DataClassification'(many).</p>
  
  <p>I want to find out all 'avro_schema' vertices property 'Referenceable.qualifiedName' in the graph where each of the 'avro_field' has a 'classifiedAs' relationship to <strong><em>'DataClassification'</em></strong></p>
  
  <p>I have tried the gremlin query to find out given a particular avro_schema find out the number of avro_field which has a relationship to DataClassification via classifiedAs. That works. </p>
  
  <p>But i am not able to keep a count of the edges between avro_schema to avro_field and then compare with number of avro_field which has relationship to DataClassification type.</p>
  
  <p>This gives number of classified avro_field for a give avro_schema</p>
  
  <p><code>g.V().has('__typeName','avro_schema').has('Referenceable.qualifiedName' , "com.example.avro.test2Complicated16").outE('__avro_record.fields').inV().out('classifiedAs').has('__typeName','tDataClassification').count()</code></p>
  
  <p>Also I tried to this to aggregate across all avro_schema which satisfies the condition,but it doesn't work.</p>
  
  <p><code>g.V().has('__typeName','avro_schema').where(identity().out('__avro_record.fields').store('sumi').out('classifiedAs').has('__typeName','DataClassification').count().is(eq('sumi'.size()))).values('Referenceable.qualifiedName')</code></p>
  
  <p>I want to know all the avro_schema in which all the avro_field has any of the 'classifiedAs' edge relationship to DataClassification</p>
  
  <p>On further trying I got down to the query but size of the collection 'xm' is always returned as 0.</p>
  
  <p><code>g.V().has('__typeName','avro_schema').local(out('__avro_record.fields').store('xm').local(out('classifiedAs').has('__typeName', 'DataClassification').count().is(eq(1))).count().is(eq(select('xm').size())))</code></p>