Is there any way to attach local accumulator for a specific vertex type?

Hi team,
Normal local accumulator is mutable state variables that are attached to each vertex in the graph for the duration of the query’s lifetime,

In my case my query returns multiple Vertex Types , and I want to add something for a specific vertex type.

  or If this is not possible is there any way in PRINT statement , through that we can remove local accumulators which are blank  

My main agenda is just to remove those local accumulators which are not even required for the specific vertex.

Schema: Category edgeconnectsto SubCategoryType1
Category edgeconnectsto SubCategoryType2
Category edgeconnectsto SubCategoryType3

requirement: [ {“category”: A", “subcategory”: [“id”: “A1”, “name”: “A One”, “weight”: “rc”, “theta”: “1.233”, “@customAccum”: [“High”, “Low”] ] }, {“category”: “B”, “subcategory”: [“id”: “B1”, “name”: “B One”, “weight”: “sp”, “theta”: “4.212” ] }…]

Hi!

To add different local accumulators for specific vertex types in a query returning multiple vertices, I’d recommend checking out the CASE statement. You find more details about using accumulators and cases here and the case statement in general here. Let me know if this helps or if you have any other questions!

3 Likes