On Monday, March 18, 2013 08:43:38 AM kenney wrote:
>
> I am using SPARQL in Jena to query a Chinese Ontology. But the results
> of the query shows only space character so I can't see the exact character.
> My Chinese Ontology is utf-8 coded. If I use other methods in Jena to
> read the Ontology like listSubjectsWithProperty, the Chinese character
> shows well. I don't know whether SPARQL does not support Chinese
> or are there any other problems?
>
>
> Here comes my query:
> Query: String queryStr="PREFIX
> rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+
> "PREFIX
> rdfs:<http://www.w3.org/2000/01/rdf-schema#>"+
> "PREFIX
> cuisine:<http://www.semanticweb.org/dell/ontologies/2012/10/untitled-ontology-11#>"+
> "SELECT ?instance" +
> "WHERE {"+
+ doesn't put in spaces or line breaks and neither does splitting
the string over lines. This bit will turn into
SELECT ?instanceWHERE {
and the variable instanceWHERE is unbound. (WHERE is optional in
SPARQL at this point.)
> "?instance rdfs:subClassOf
> cuisine:èè´."+
> "}";
A really useful tactic when you're constructing queries and there's
a problem is to print the query string out -- this will help you see
places where the construction went wrong. It will also encourage
you to put newlines ("\n") in the strings so that you can read the
query without scrolling forever rightwards and then ARQ messages
with the line number in will be more useful.
Chris
--
"The wizard seemed quite willing when I talked to him." /Howl's Moving Castle/
Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)