ArcGIS Pro 3.7 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 ReadOnly Property IsRelationship As Boolean
    public bool IsRelationship {get;}
    Example
    SubLayers of a KnowledgeGraph Layer
    {
      var kg_layer = map.GetLayersAsFlattenedList().OfType<KnowledgeGraphLayer>().FirstOrDefault();
      if (kg_layer == null)
        return;
    
      if (map.MapType == MapType.LinkChart)
      {
        // if map is of MapType.LinkChart then the first level
        // children of the kg_layer are of type LinkChartFeatureLayer
        var childLayers = kg_layer.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
        // kg_layer are the standard Featurelayer and StandAloneTable
        var chidlren = kg_layer.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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also