def query(self, woql_query: Union[(dict, WOQLQuery)], commit_msg: Optional[str]=None, get_data_version: bool=False, last_data_version: Optional[str]=None) -> Union[(dict, str)]:
    'Updates the contents of the specified graph with the triples encoded in turtle format Replaces the entire graph contents\n\n        Parameters\n        ----------\n        woql_query : dict or WOQLQuery object\n            A woql query as an object or dict\n        commit_mg : str\n            A message that will be written to the commit log to describe the change\n        get_data_version: bool\n            If the data version of the query result(s) should be obtained. If True, the method return the result and the version as a tuple.\n        last_data_version : str\n            Last version before the update, used to check if the document has been changed unknowingly\n        file_dict: **deprecated**\n            File dictionary to be associated with post name => filename, for multipart POST\n\n        Raises\n        ------\n        InterfaceError\n            if the client does not connect to a database\n\n        Examples\n        -------\n        >>> WOQLClient(server="http://localhost:6363").query(woql, "updating graph")\n\n        Returns\n        -------\n        dict\n        '
    self._check_connection()
    query_obj = {'commit_info': self._generate_commit(commit_msg)}
    if isinstance(woql_query, WOQLQuery):
        request_woql_query = woql_query.to_dict()
    else:
        request_woql_query = woql_query
    query_obj['query'] = request_woql_query
    headers = {'user-agent': f'terminusdb-client-python/{__version__}'}
    if (last_data_version is not None):
        headers['TerminusDB-Data-Version'] = last_data_version
    result = requests.post(self._query_url(), headers=headers, json=query_obj, auth=self._auth())
    if get_data_version:
        (result, version) = _finish_response(result, get_data_version)
        result = json.loads(result)
    else:
        result = json.loads(_finish_response(result))
    if (result.get('inserts') or result.get('deletes')):
        return 'Commit successfully made.'
    elif get_data_version:
        return (result, version)
    else:
        return result
Updates the contents of the specified graph with the triples encoded in turtle format Replaces the entire graph contents

Parameters
----------
woql_query : dict or WOQLQuery object
    A woql query as an object or dict
commit_mg : str
    A message that will be written to the commit log to describe the change
get_data_version: bool
    If the data version of the query result(s) should be obtained. If True, the method return the result and the version as a tuple.
last_data_version : str
    Last version before the update, used to check if the document has been changed unknowingly
file_dict: **deprecated**
    File dictionary to be associated with post name => filename, for multipart POST

Raises
------
InterfaceError
    if the client does not connect to a database

Examples
-------
>>> WOQLClient(server="http://localhost:6363").query(woql, "updating graph")

Returns
-------
dict
def query(self, woql_query: Union[(dict, WOQLQuery)], commit_msg: Optional[str]=None, get_data_version: bool=False, last_data_version: Optional[str]=None) -> Union[(dict, str)]:
    'Updates the contents of the specified graph with the triples encoded in turtle format Replaces the entire graph contents\n\n        Parameters\n        ----------\n        woql_query : dict or WOQLQuery object\n            A woql query as an object or dict\n        commit_mg : str\n            A message that will be written to the commit log to describe the change\n        get_data_version: bool\n            If the data version of the query result(s) should be obtained. If True, the method return the result and the version as a tuple.\n        last_data_version : str\n            Last version before the update, used to check if the document has been changed unknowingly\n        file_dict: **deprecated**\n            File dictionary to be associated with post name => filename, for multipart POST\n\n        Raises\n        ------\n        InterfaceError\n            if the client does not connect to a database\n\n        Examples\n        -------\n        >>> WOQLClient(server="http://localhost:6363").query(woql, "updating graph")\n\n        Returns\n        -------\n        dict\n        '
    self._check_connection()
    query_obj = {'commit_info': self._generate_commit(commit_msg)}
    if isinstance(woql_query, WOQLQuery):
        request_woql_query = woql_query.to_dict()
    else:
        request_woql_query = woql_query
    query_obj['query'] = request_woql_query
    headers = {'user-agent': f'terminusdb-client-python/{__version__}'}
    if (last_data_version is not None):
        headers['TerminusDB-Data-Version'] = last_data_version
    result = requests.post(self._query_url(), headers=headers, json=query_obj, auth=self._auth())
    if get_data_version:
        (result, version) = _finish_response(result, get_data_version)
        result = json.loads(result)
    else:
        result = json.loads(_finish_response(result))
    if (result.get('inserts') or result.get('deletes')):
        return 'Commit successfully made.'
    elif get_data_version:
        return (result, version)
    else:
        return result