Hello. My name is Myunjin Lee.

I am testing simple SPARQL query from Korean DBpedia SPARQL
endpoint(http://ko.dbpedia.org/sparql) using Jena.

For that, I implemented simple test code, but I had URI encoding problem of
SPARQL query that has Korean character.

 

My simple query is:

 

        String allSameAsQuery = ""

                       + "PREFIX owl: <http://www.w3.org/2002/07/owl#>\n"

                       + "SELECT *\n" + "WHERE {\n"

                       + "  <http://ko.dbpedia.org/resource/문절망둑>
owl:sameAs ?x .\n" + "}";

 

And then, to process query, I construct Query object.

 

Query query = QueryFactory.create(allSameAsQuery);

System.out.println(query.toString());

 

Problem is that the query string is encoded when I make a Query object.
Print out result is:

 

PREFIX  owl:  <http://www.w3.org/2002/07/owl#>

 

SELECT  *

WHERE

  { <http://ko.dbpedia.org/resource/%EB%AC%B8%EC%A0%88%EB%A7%9D%EB%91%91>
owl:sameAs ?x }

 

So that, I cannot get any owl:sameAs resource.

 

How can I figure out the encoding problem? Or is there any method for my
problem?

Thank for your help.

 

Sincerely yours,

Dr. Myungjin Lee

Reply via email to