Click here to Skip to main content
15,891,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using servlet for handling ontology based functions and manage SPARQL queries in eclipse IDE.I got some SPARQL query result(eg:- individuals of some class).

I want to print that result in servlet/jsp insted of console.

following code segment can be used to print the result in console
----------------------------------------------------------------
String queryStr = 
	"PREFIX rdfs:  "+
	"PREFIX rdf:   "+
	"select ?l "+
	"where { "+
	"?ind  rdf:type  ;"+
	" rdfs:label ?l "+
	"}\n ";
			
	com.hp.hpl.jena.query.Query query = QueryFactory.create(queryStr);
	QueryExecution qe = QueryExecutionFactory.create(query,model);
	com.hp.hpl.jena.query.ResultSet rs = qe.execSelect();
	ResultSetFormatter.out(System.out, rs);


Any idea ...??
Thank in advance!
Posted
Updated 2-Nov-10 4:08am
v3
Comments
Nagy Vilmos 2-Nov-10 10:08am    
Retaged as JSP

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900