Hi Andy,
Many thanks for the response!
Yes, but I am quite sure I am only sending one update. As I say, I have been able to query without any problem. It is only when I attempt to update that I run into this problem.
Perhaps there is an issue with my sparql_update function?
var end_point_update = "http://host/fuseki/ds/update";
function sparql_update (query_str) {
g_query_result_string = undefined;
var querypart = "query=" + escape (query_str); // escape makes the string ASCII-portable
var xmlhttp = new XMLHttpRequest (); // ajax
xmlhttp.open ('POST', end_point_update, false); // GET can have caching probs, so POST. NOT ASYNCHRONOUS - WAIT
// probably need these headers
xmlhttp.setRequestHeader ('Content-type', 'application/x-www-form-urlencoded');
xmlhttp.setRequestHeader ("Accept", "application/sparql-results+json");
// Set up callback to get the response asynchronously.
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
// results are in a string in xmlhttp.responseText but we can't return it from this sub-function
console.log (xmlhttp.responseText);
} else {
// Some kind of error occurred.
alert("Sparql query error: " + xmlhttp.status + " " + xmlhttp.responseText);
}
}
}
// Send the query to the endpoint.
xmlhttp.send (querypart);
// here we have the query result in a string, let's convert it to json, then return a JS object
return result_json = eval("(" + xmlhttp.responseText + ")");
}
Kind Regards,
Kris.
answered
23 Jan, 08:54
Bob Boonah
11●1
accept rate:
0%