使用Ajax更新SPARQL

时间:2019-03-07 14:13:50

标签: javascript ajax sparql

嗨,我正在尝试创建一个UPDATE查询并通过ajax发送。我不断收到错误消息,但更新未完成。知道为什么吗?当我在Apache Fuseki上尝试UPDATE查询时,效果很好。

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');
}

0 个答案:

没有答案