以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  查询时候 ResultSetFormatter.out(System.out,results,query);的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=73971)


--  作者:lihan6415151528
--  发布时间:4/7/2009 4:20:00 PM

--  查询时候 ResultSetFormatter.out(System.out,results,query);的问题
ResultSetFormatter.out(System.out,results,query);是向控制台输出查询结果

那么我想传到页面呢??急求大家帮忙,我的代码


OntModel text_ontmodel = ModelFactory.createOntologyModel();
  OntDocumentManager dm = text_ontmodel.getDocumentManager();
  
  dm.addAltEntry("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "file:d://travel.owl");
  text_ontmodel.read("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
  
  StringBuffer sb = new StringBuffer();
  
  sb.append("PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>" +
    " PREFIX base: <http://www.owl-ontologies.com/Ontology1237752693.owl#> "+
    "PREFIX owl: <http://www.w3.org/2002/07/owl#> "+
    "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>");
  
  sb.append( " SELECT ?y  where{?y rdfs:subClassOf base:Blakemore_Hotel} ");
  
  Query query = QueryFactory.create(sb.toString());
  Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
  InfModel inf = ModelFactory.createInfModel(reasoner, text_ontmodel);
  
  QueryExecution qe = QueryExecutionFactory.create(query,inf);

  ResultSet results = qe.execSelect();
     ResultSetFormatter.out(System.out,results,query);

     qe.close();


--  作者:jpz6311whu
--  发布时间:4/7/2009 6:32:00 PM

--  
楼主学一下jsp吧
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
2,734.375ms