import axios from 'axios'

const SPARQL_ENDPOINT = `${ROOT_URL}sparql`
// const SPARQL_ENDPOINT = `http://localhost/sparql`

function querySparql(query) {
  const request = {
    method: 'post',
    url: SPARQL_ENDPOINT,
    data: `query=${encodeURIComponent(query)}`,
    headers: {
      'Accept': 'application/sparql-results+json',
      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
    },
    withCredentials: true
  }
  return axios(request)
    // .then(response => response.data)
    .then(() => ({
      head: {
        vars: [
          'c',
          'class',
          'count'
        ]
      },
      results: {
        bindings: []
      }
    }))
}

export { querySparql }

@@ -469,11 +469,8 @@
 %0A   
- //
  .th
@@ -503,182 +503,8 @@
 ta)%0A
-    .then(() =%3E (%7B%0A      head: %7B%0A        vars: %5B%0A          'c',%0A          'class',%0A          'count'%0A        %5D%0A      %7D,%0A      results: %7B%0A        bindings: %5B%5D%0A      %7D%0A    %7D))%0A
 %7D%0A%0Ae

remove stub response from sparql.js