Answer the question
In order to leave comments, you need to log in
Where could be the encoding error?
I'm trying to write a query to Dydra (graph database). Using curl from the linux console, the request is executed as it should, in response I get json. Latin is displayed.
$ curl -H 'Accept: application/json' \http://dydra.com/ybiks/testmylib/sparql?query=select%20*%20where%20%7B%20%7B%20graph%20%3Fg%20%7B%3Fs%20%3Fp%20%3Fo%7D%20%7D%20union%20%7B%3Fs%20%3Fp%20%3Fo%7D%20%7D%20limit%2010
But if you make a request from Node.js, then the Latin characters are replaced by question marks.var curl = require('curlrequest');
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;
console.log(parts)
});
PS I changed the encoding in the curl module, it did not help
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question