ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMKGTraversalDirection Class / RelationshipTypeName Property
Example

In This Topic
    RelationshipTypeName Property
    In This Topic
    Gets or sets the relationship type name of the traversal direction object.
    Syntax
    Public Property RelationshipTypeName As String
    public string RelationshipTypeName {get; set;}
    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.
        //TODO - use the config
        //var results = kg.RunFilteredFindPaths(ffp_config);
        // ...
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also