ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.KnowledgeGraph Namespace / KnowledgeGraphInvestigation Class / RenameQueryDefinition Method
The name of the ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition to rename. This corresponds to ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition.Name.
The new name for the ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition.
Example

In This Topic
    RenameQueryDefinition Method
    In This Topic
    Renames the ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition with the specified name. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub RenameQueryDefinition( _
       ByVal queryDefinitionName As String, _
       ByVal newQueryDefinitionName As String _
    ) 
    public void RenameQueryDefinition( 
       string queryDefinitionName,
       string newQueryDefinitionName
    )

    Parameters

    queryDefinitionName
    The name of the ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition to rename. This corresponds to ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition.Name.
    newQueryDefinitionName
    The new name for the ArcGIS.Core.CIM.CIMKnowledgeGraphQueryDefinition.
    Exceptions
    ExceptionDescription
    queryDefinitionName or newQueryDefinitionName are null or empty.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    The queryDefinitionName does not exist in the investigation or newQueryDefinitionName already exists in the investigation.
    Remarks
    Query definition names must be unique within an investigation. If the newQueryDefinitionName already exists in the investigation, then an System.InvalidOperationException will be thrown.
    Example
    Rename a Query Definition
    {
      // access the currently active knowledge graph investigation view
      KnowledgeGraphInvestigationView activeView = KnowledgeGraphInvestigationView.Active;
      KnowledgeGraphInvestigation investigation = activeView?.Investigation;
      if (investigation != null)
      {
        await QueuedTask.Run(() =>
        {
          // rename the query definition
          investigation.RenameQueryDefinition("Query1", "EntityQuery");
        });
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.7 or higher.
    See Also