Hi Frank,
I'm glad to hear you like the library!
I think this can be done in a way that is generally useful. Tell me more about your use case. You indicate that you want to tag each connection with 0-n properties. Are these properties likely to contain many duplicates? Can we assume that these properties are representable with Strings? Can you provide some specifics about the volume of data we might be talking about?
For the tagged properties, let's assume there will be many duplicates. In this case, I think you'll likely want to assign each unique tag value to an "ordinal value", which can be done using an OrdinalMap<String>. Now, for each property, we need to represent a mapping ((from node, to node) -> tag set). Because we've assigned each unique tag an ordinal value, this "tag set" is representable as (for example) a gap-encoded set of variable-length integers, or a bit set if there is a small number of total possible tags.
If you want to keep this off to the side (for example, this might be useful if the number of connections which are tagged is low relative to the total number of connections), then this can be done fairly easily without modifying NFGraph itself (by including the tag data along with the NFGraph in the serialized artifact you transmit to consumers).
You may instead want to write this encoded set of tags in-line in the graph where the properties are being encoded. This will save you from having to represent the ((from node, to node) -> tag set) mapping, because you would be able to read the values as you iterate with a new OrdinalIterator implementation. If you want to go this route, it will be important to ensure that this modification has no impact on the existing use cases. I think this can be done by requiring properties with this feature to be specified in the NFGraphSpec with a new flag (e.g. TAGGABLE v. UNTAGGED) in the same way COMPACT v. HASH, or SINGLE v. MULTIPLE is done. The default should be UNTAGGED to retain backwards compatibility, and the encoding should remain unchanged for graphs which do not use the feature.
I look forward to hearing your thoughts.
Thanks,
Drew.