var curl = require('curlrequest');
var fs = require("fs");
var url = 'http://dydra.com/ybiks/testmylib/sparql?query=';
url += encodeURIComponent('select * where { { graph ?g {?s ?p ?o} } union {?s ?p ?o} } limit 10');//SPARQL запрос, SQL для онтологий
//Сам запрос
curl.request({url: url, headers: { accept: 'application/json' }, include: true}, function(err, parts){
if(err) throw err;
fs.writeFile('parts.txt', parts, (err) => {
if (err) throw err;
});
});
window.location.hash = "";
history.replaceState("", document.title, window.location.pathname + window.location.search);