With https://bugster.forgerock.org/jira/browse/OPENIDM-15668, relationship-derived virtual property state can now be harvested as 'interim' relationships are traversed, not just when the 'terminal' relationship is traversed. For example, given the referencedRelationshipField of ["adminOfOrg", "children", "children"] where these relationships all point to organizations, queryConfig state can dictate that virtual property state can be harvested starting with relationship field index 0. Thus virtual property state will be harvested from the organizations referenced by the adminOfOrg relationship, through to the grand-children of each organization referenced by the adminOfOrg relationship.
However, this makes it more likely for multiple relationship-derived-virtual property definitions to 'collide' on the same relationship field sequence. In other words, in the example above, it might be possible for another relationship-derived virtual property to be defined by traversing just the adminOfOrg relationship, with different referencedObjectField specifications dictating the mapping functionality for traversed vertices. Because this latter relationship-derived virtual property will be considered the 'ancestor' of the former, so that relationship fields are not traversed redundantly, the adminOfOrg relationship will be traversed only once, and in this case, state corresponding to the referenced relationship used to map to two distinct virtual properties.
For this use-case to be supported, a given relationship field must be associated with multiple 'TerminalState' instances defining the mapping state for a given virtual property.
This Jira covers implementing this functionality, and writing the corresponding functional tests.