<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sparql(self, dataset_key, query, desired_mimetype='application/sparql-results+json', **kwargs):
 """Executes SPARQL queries against a dataset via POST :param dataset_key: Dataset identifier, in the form of owner/id :type dataset_key: str :param query: SPARQL query :type query: str :returns: file object that can be used in file parsers and data handling modules. :rtype: file object :raises RestApiException: If a server error occurs Examples -------- """

        api_client = self._build_api_client(
            default_mimetype_header_accept=desired_mimetype)
        sparql_api = kwargs.get('sparql_api_mock',
                                _swagger.SparqlApi(api_client))
        owner_id, dataset_id = parse_dataset_key(dataset_key)
        try:
            response = sparql_api.sparql_post(
                owner_id, dataset_id, query, _preload_content=False, **kwargs)
            return six.BytesIO(response.data)
        except _swagger.rest.ApiException as e:
            raise RestApiError(cause=e)