Hi I am trying to create an UPDATE
query and send it via ajax. I am continuously getting an error and the update is not done. Any idea why? When I try the UPDATE
query on Apache Fuseki it works well.
function createNewItem(deed, itemNo, desc){
var itemValue =document.getElementById("search").value;
myQuery= ["PREFIX dcterms: <http://purl.org/dc/terms/>",
"PREFIX locah: <http://data.archiveshub.ac.uk/def/>",
"prefix xsd: <http://www.w3.org/2001/XMLSchema#>",
"INSERT DATA",
"{",
"<http://natarchives.com.mt/deed/"+deed+"> locah:associatedWith <http://natarchives.com.mt/item/#item"+itemNo+">.",
"<http://natarchives.com.mt/item/#item"+itemNo+"> dcterms:description \""+desc+"\".",
"<http://natarchives.com.mt/item/#item"+itemNo+"> locah:item \""+itemValue+"\".",
"<http://natarchives.com.mt/item/#item"+itemNo+"> dcterms:identifier \""+itemNo+"\"^^xsd:integer.}"].join(" ");
window.alert(myQuery);
console.log('myQuery: '+myQuery);
$.ajax({
dataType: "jsonp",
url: myEndPointUpdate,
data: {"query": myQuery,
"output": "json"},
success: ready,
error: myError
});
console.log('After .ajax');
}