我无法通过ajax更新和删除。我在SPARQL查询中遇到错误,但查询应该没问题。这是我的代码:
function deletePerson(per){
myQuery= ["DELETE{",
"<"+per+"> ?p ?o.",
"?s1 ?p1 <"+per+">.",
"}WHERE{",
"<"+per+"> ?p ?o.",
"OPTIONAL{",
"?s1 ?p1 <"+per+">.}}"].join(" ");
window.alert(myQuery);
$.ajax({
dataType: 'text',
type: 'POST',
url: "http://localhost:3030/Test/update",
data: {'query': myQuery, 'update': 'delete', '_method': 'delete'},
success: function(data) {
window.alert('Deleted');
},
error: myError
});
console.log('After .ajax');
}
我得到的错误是Sparql错误400:在第1行第6列遇到“ EOF”。 “ {” ...?