Indexing on sub-attribute of custom data type


Few questions related to custom data types (
1. Is it possible to index on a sub-attribute of a custom data type? If not, is there any other alternative other than creating an associated vertex which defines this custom data type?
2. Is attribute cardinality like SET / LIST supported with custom data type?



Hi Ronnie,

Actually, "creating an associated vertex which defines this custom data type" sounds like an excellent idea! If an attribute is important enough to define an index on, it probably deserves to be a first class citizen in the graph.

Answers to the other questions:

  1.     Not for the MixedIndex; it does not support Object type keys ( A CompositeIndex index on an Object type key is possible, but it would still be an ugly approach because the index would compare entire objects based on the implemented "equals" method of the custom attribute (which in your case would compare one specific attribute).
  2.     I tried to test this in an example, but got stuck (for now) on the limited documentation given in Otherwise, there is no reason why these cardinalities would not be supported. If you are still interested, we can try and get this working (and add it to the documentation).
Best wishes,



Regarding documentation on custom attributes: Jason Plurad published an example project a few years ago (so, for an older JanusGraph version).



Hi Marc,
Thanks for confirming about "creating an associated vertex which defines this custom data type" approach. In which case i would not be experimenting custom data types for now. Thanks for the details regarding the serializers for custom attributes - i am sure these will come handy for me.