ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMKGTraversalDirection Class
Members Example

In This Topic
    CIMKGTraversalDirection Class
    In This Topic
    Represents a Knowledge Graph Filtered Find Paths TraversalDirection. The filtered find paths algorithm uses traversal directions to specify how relationships are traversed. When no traversal direction is defined for a specific relationship type, the default traversal direction is used.
    Object Model
    CIMKGTraversalDirection ClassCIMKGTraversalDirection ClassCIMKGTraversalDirection Class
    Syntax
    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
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMKGTraversalDirection

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.3 or higher.
    See Also