ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Core.CIM Namespace / KGTraversalDirectionType Enumeration
Example Example

In This Topic
    KGTraversalDirectionType Enumeration
    In This Topic
    Specifies relationships traversal directions in the filtered find paths algorithm.
    Syntax
    Members
    MemberDescription
    Any The filtered find paths algorithm considers all relationships independent of their direction.
    Backward The filtered find paths algorithm considers only the relationships that are traversed in backward direction.
    Forward The filtered find paths algorithm considers only the relationships that are traversed in forward direction.
    Example
    Run FFP Using Traversal Filters
        //using ArcGIS.Core.Data.Knowledge.Extensions;
    
        await QueuedTask.Run(() =>
        {
            var ffp_config = new CIMFilteredFindPathsConfiguration();
            ffp_config.Name = "Run FFP w Traversal Filters";
    
            //set origin entities
            //set destination entities
    
            //set any path filters
    
            //Set traversal filters
            //A traversal filter is used to specify the traversal direction of a relationship (to be)
            //included in the result paths. By default, paths are evaluated without considering the
            //direction of relationships in the graph - i.e. KGTraversalDirectionType.Any.
            //Relationships can be evaluated in specific directions by changing the KGTraversalDirectionType
            //enum value of the traversal_filter.TraversalDirectionType.
    
            //For example, the traversal direction is being set for the following relationship types...
            var traversalFilters = new List<CIMKGTraversalDirection>();
            foreach (var relation in new List<string> { "near_poi", "near_facility", "near_facility2" })
            {
                var traversal_filter = new CIMKGTraversalDirection();
                traversal_filter.RelationshipTypeName = relation;
    
                //All relationships of the specified type are considered (default)
                traversal_filter.TraversalDirectionType = KGTraversalDirectionType.Any;
                //Relationship can only be traversed from origin to destination
                traversal_filter.TraversalDirectionType = KGTraversalDirectionType.Forward;
                //Relationship can only be traversed from destination to origin
                traversal_filter.TraversalDirectionType = KGTraversalDirectionType.Backward;
    
                traversalFilters.Add(traversal_filter);
            }
    
            ffp_config.TraversalDirections = traversalFilters.ToArray();
    
    //etc.
        });
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.CIM.KGTraversalDirectionType

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.3 or higher.
    See Also