Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.ResultSetFormatter


            try{
            q = q.replace("&lt;","<").replace("&gt;",">").replace(" WHERE","\nWHERE").replace(" SELECT","\nSELECT").replace(" FROM","\nFROM").replace(" PREFIX","\nPREFIX").replace("{ ","{\n").replace(". ",".\n\t").replace("; ",";\n\t\t");
               
            OntModel ontModel = Util.getOntModel();
            ResultSet rs = Util.executeSparqlQuery(ontModel ,q);
            ResultSetFormatter rsf = new ResultSetFormatter();
            result = rsf.asXMLString(rs);
            //result = Integer.toString(rs.getRowNumber()) ;
            result = result.replace("<","&lt;").replace(">","&gt;");
           
            }catch (Exception ex){
                result = "<font color=\"red\">" + ex.getMessage() + "</font>";
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.ResultSetFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.