ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Knowledge.Analytics Namespace / KnowledgeGraphCentralityScores Class / Item Property
Example

In This Topic
    Item Property (KnowledgeGraphCentralityScores)
    In This Topic
    Indexer to retrieve the array of scores for a specific entity identified by its UID.
    Syntax
    Public ReadOnly Default Property Item( _
       ByVal uid As Object _
    ) As Double()
    public double[] this[ 
       object uid
    ]; {get;}

    Parameters

    uid

    Property Value

    The array of centrality measure scores for the given entity
    Remarks
    Returns the scores for the centrality computation for the input uid used as the key to the indexer. The returned array of scores contains one score, or "result", per input ArcGIS.Core.CIM.CentralityMeasure used in the centrality analysis. Scores are arranged in the array in the same order as the measures in the input measures array.
    . Note: The uid is the entity object identifier (refer to ArcGIS.Core.Data.Knowledge.KnowledgeGraphNamedObjectValue.GetID)
    Example
    Output Centrality Results
    {
      //using ArcGIS.Core.Data.Knowledge.Extensions;
    
      await QueuedTask.Run(() =>
      {
        ///var kgConfig = ...;
        //var kgSubgraph = ...;
        //var measures = ...;
        //using(var kg = ...) {
        var results = kg.ComputeCentrality(kgConfig, kgSubgraph, measures);
        //loop through each (entity) named type (relates are never included in results)
        foreach (var named_type in results.NamedTypes)
        {
          //Get the entity uids for each named type
          foreach (var uid in results.GetUidsForNamedType(named_type))
          {
            //Get the scores for each uid via the [] indexer on "Scores"
            var scores = results.Scores[uid];
            //There is one score per measure in the input measures array
            //Note: results.Scores.Measures is also provided for convenience...
            //for (int m = 0; m < results.Scores.Measures.Length; m++)
            for (int m = 0; m < measures.Length; m++)
            {
              var score = scores[m];//score for the given measure
                                    //TODO - use measure score
    
            }
          }
        }
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.6 or higher.
    See Also