Date
1 - 4 of 4
Indexing on sub-attribute of custom data type
Ronnie
Hi,
Few questions related to custom data types (https://docs.janusgraph.org/basics/common-questions/#custom-class-datatype)
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?
Thanks,
Ronnie
Few questions related to custom data types (https://docs.janusgraph.org/basics/common-questions/#custom-class-datatype)
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?
Thanks,
Ronnie
hadoopmarc@...
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:
Marc
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:
- Not for the MixedIndex; it does not support Object type keys (https://docs.janusgraph.org/index-backend/search-predicates/#data-type-support). 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).
- I tried to test this in an example, but got stuck (for now) on the limited documentation given in https://docs.janusgraph.org/advanced-topics/serializer/. 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).
Marc
hadoopmarc@...
Regarding documentation on custom attributes: Jason Plurad published an example project a few years ago (so, for an older JanusGraph version).
See, https://github.com/pluradj/janusgraph-attribute-serializer
See, https://github.com/pluradj/janusgraph-attribute-serializer
Ronnie
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.
Thanks!
Ronnie
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.
Thanks!
Ronnie