Hi,
You can remove ^^http://www.w3.org/2001/XMLSchema#string part but getting
LexicalForm
Example:
for (; result.hasNext();) {
QuerySolution soln = result.nextSolution();
String str = soln.getLiteral("object").getLexicalForm()));
}
On Sun, May 11, 2014 at 10:00 PM, Andy Seaborne <[email protected]> wrote:
> On 07/05/14 22:17, ameni ameni wrote:
>
>> Hello,
>> i have a few quetions.
>> First i have this prefix in the query
>> String queryRequest =
>> "PREFIX base: <"+namespace+"> " +
>> "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" +
>> "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> \n" +
>> "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> \n" +
>> and when i execute the query ,i got this results.
>> aaa^^http://www.w3.org/2001/XMLSchema#string.
>> bbb^^http://www.w3.org/2001/XMLSchema#string.
>> But i need to remove this part (http://www.w3.org/2001/XMLSchema#string)
>> when displaying the results. How can i do this?
>>
>
> Either:
>
> 1/ Use STR() in the query to get the lexical form
>
> or
> 2/ In java, ask for the lexical form of the literal.
>
> Andy
>
>
> Second, i put my result in a text area,
>> String [] res={"","",""};
>> res=Outils.chercher(s,d);
>> jTextArea1.append(res[0]);
>> System.out.println(res[0]);
>> ......
>> RDFNode name1 = soln.get("ex");
>> res[0]=res[0]+name1.toString()+"\n";
>> return res;
>> But it's not nice and i want to put in in a table,how can i do this?
>> My last quetions : it's possible to use HTML with netbeans for displaying
>> query result in order to have a moere beautiful view?
>> Thans very much
>>
>>
>