ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LinkChartFeatureLayer Class / IsRelationship Property
Example

In This Topic
    IsRelationship Property
    In This Topic
    Gets if the link chart feature layer represents a relationship in the Knowledge Graph.
    Syntax
    public bool IsRelationship {get;}
    Public ReadOnly Property IsRelationship As Boolean
    Example
    SubLayers of a KnowledgeGraph Layer
    var map = MapView.Active.Map;
    var kgLayer = map.GetLayersAsFlattenedList().OfType<KnowledgeGraphLayer>().FirstOrDefault();
    if (kgLayer == null)
      return;
    
    if (map.MapType == MapType.LinkChart)
    {
      // if map is of MapType.LinkChart then the first level
      // children of the kgLayer are of type LinkChartFeatureLayer
      var childLayers = kgLayer.Layers;
      foreach (var childLayer in childLayers)
      {
        if (childLayer is LinkChartFeatureLayer lcFeatureLayer)
        {
          var isEntity = lcFeatureLayer.IsEntity;
          var isRel = lcFeatureLayer.IsRelationship;
    
          // TODO - continue processing
        }
      }
    }
    else if (map.MapType == MapType.Map)
    {
      // if map is of MapType.Map then the children of the
      // kgLayer are the standard Featurelayer and StandAloneTable
      var chidlren = kgLayer.GetMapMembersAsFlattenedList();
      foreach (var child in chidlren)
      {
        if (child is FeatureLayer fl)
        {
          // TODO - process the feature layer
        }
        else if (child is StandaloneTable st)
        {
          // TODO - process the standalone table
        }
      }
    }
    
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.3 or higher.
    See Also