I am new in node.js.I downloaded and executed a project from GitHub from this
link.Here on this
link there is live demo of this app. It is running rdf search using wikidata. This is the function that I found for the search of keyword from wikidata written in file public/scripts/controllers/main.js.
function search () {
if (vm.searchInput != vm.lastSearch) {
var input = vm.searchInput;
vm.lastSearch = input;
vm.searchWait = true;
vm.noResults = false;
$http({
method: 'GET',
url: 'https://www.wikidata.org/w/api.php',
params: {
action: 'wbsearchentities',
format: 'json',
language: 'en',
uselang: 'en',
type: 'item',
continue: '0',
limit: '20',
search: input,
origin: '*',
}
}).then(
function onSuccess (response) {
onSearch(response.data.search);
},
function onError (response) { onSearchErr(); console.log('Error: ' + response.data); }
);
}
vm.searchActive = true;
}
What I have tried:
I have changed the above function for DBpedia but it not search the keyword from DBpedia
function search2 () {
if (vm.searchInput != vm.lastSearch) {
var input = vm.searchInput;
vm.lastSearch = input;
vm.searchWait = true;
vm.noResults = false;
$http({
method: 'GET',
url: 'http://dbpedia.org/sparql',
params: {
action: 'wbsearchentities',
format: 'json',
language: 'en',
uselang: 'en',
type: 'item',
continue: '0',
limit: '20',
search: input,
origin: '*',
}
}).then(
function onSuccess (response) {
onSearch(response.data.search);
},
function onError (response) { onSearchErr(); console.log('Error: ' + response.data); }
);
}
vm.searchActive = true;
}
how I can change this above function for search in DBpedia?what is Javascript SPARQL API for DBpedia?Please help