-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexampleDynFields.html
More file actions
40 lines (33 loc) · 1.01 KB
/
exampleDynFields.html
File metadata and controls
40 lines (33 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<title>ReLOD demo dataset visual similarity relations</title>
</head>
<body>
<h1>ReLOD demo dataset visual similarity relations</h1>
<script>
//async request to the url -> print the result
function httpPostAsync(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
//if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
//query worked
document.write(xmlHttp.responseText);
//xmlHttp.abort();
//}
}
xmlHttp.open("POST", theUrl, true);
xmlHttp.send(null);
}
const server = "http://localhost:3030/d1";
let query = "INSERT DATA{ <http://example/book888> <http://purl.org/dc/elements/1.1/title> \"oooA new book5\"}";
let queryUrl = server + "?update=" + encodeURIComponent(query);
console.log(queryUrl);
httpPostAsync(queryUrl);
/*query = "Select * where {<http://example/book888> ?p ?o}";
queryUrl = server + "?query=" + encodeURIComponent(query);
console.log(queryUrl);
httpPostAsync(queryUrl);*/
</script>
</body>
</html>