:doc:`IoTTwinMaker <../../iottwinmaker>` / Client / execute_query

*************
execute_query
*************



.. py:method:: IoTTwinMaker.Client.execute_query(**kwargs)

  

  Run queries to access information from your knowledge graph of entities within individual workspaces.

   

  .. note::

    

    The ExecuteQuery action only works with `Amazon Web Services Java SDK2 <https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html>`__. ExecuteQuery will not work with any Amazon Web Services Java SDK version < 2.x.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iottwinmaker-2021-11-29/ExecuteQuery>`_  


  **Request Syntax**
  ::

    response = client.execute_query(
        workspaceId='string',
        queryStatement='string',
        maxResults=123,
        nextToken='string'
    )
    
  :type workspaceId: string
  :param workspaceId: **[REQUIRED]** 

    The ID of the workspace.

    

  
  :type queryStatement: string
  :param queryStatement: **[REQUIRED]** 

    The query statement.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return at one time. The default is 50.

    

  
  :type nextToken: string
  :param nextToken: 

    The string that specifies the next page of results.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'columnDescriptions': [
              {
                  'name': 'string',
                  'type': 'NODE'|'EDGE'|'VALUE'
              },
          ],
          'rows': [
              {
                  'rowData': [
                      {...}|[...]|123|123.4|'string'|True|None,
                  ]
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **columnDescriptions** *(list) --* 

        A list of ColumnDescription objects.

        
        

        - *(dict) --* 

          A description of the column in the query results.

          
          

          - **name** *(string) --* 

            The name of the column description.

            
          

          - **type** *(string) --* 

            The type of the column description.

            
      
    
      

      - **rows** *(list) --* 

        Represents a single row in the query results.

        
        

        - *(dict) --* 

          Represents a single row in the query results.

          
          

          - **rowData** *(list) --* 

            The data in a row of query results.

            
            

            - (:ref:`document<document>`) -- 
        
      
    
      

      - **nextToken** *(string) --* 

        The string that specifies the next page of results.

        
  
  **Exceptions**
  
  *   :py:class:`IoTTwinMaker.Client.exceptions.InternalServerException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.QueryTimeoutException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.ValidationException`

  
  *   :py:class:`IoTTwinMaker.Client.exceptions.ServiceQuotaExceededException`

  