以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  jena 引用错误!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=37012)


--  作者:honghuhuchao
--  发布时间:8/20/2006 3:04:00 PM

--  jena 引用错误!
我把lib下面的jar文件全导进classpath里面去了。但是容然提示错误。源代码:
package wrm;

import java.io.*;
import com.hp.hpl.jena.db.*;
import com.hp.hpl.jena.rdf.model.*;
public class wrmds {

  public static void main(String[] args) {
     OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM, null);
      FirstOntology firstonto=new FirstOntology();
      OntDocumentManager mgr = new OntDocumentManager();
      OntModelSpec s = new OntModelSpec(OntModelSpec.OWL_DL_MEM);
      s.setDocumentManager(mgr);
      m = ModelFactory.createOntologyModel(s, null);
      m.read(firstonto.MROntoSpace.getOntUrl(),"");
      firstonto.MROntology=new MulMROntoModelMgr(m);
      String fileName = "D:\\wrm_ds.owl";
      FileOutputStream ontOutput = new FileOutputStream(fileName);
      m.write(ontOutput);
      }

}
提示错误:
java.lang.Error: Unresolved compilation problems:
 OntModel cannot be resolved or is not a type
 ModelFactory cannot be resolved
 OntModelSpec cannot be resolved
 FirstOntology cannot be resolved or is not a type
 FirstOntology cannot be resolved or is not a type
 OntDocumentManager cannot be resolved or is not a type
 OntDocumentManager cannot be resolved or is not a type
 OntModelSpec cannot be resolved or is not a type
 OntModelSpec cannot be resolved or is not a type
 OntModelSpec cannot be resolved
 ModelFactory cannot be resolved
 MulMROntoModelMgr cannot be resolved or is not a type

 at wrm.wrmds.main(wrmds.java:15)
Exception in thread "main"
请各位大侠帮帮忙啊!


--  作者:jpz6311whu
--  发布时间:8/20/2006 3:55:00 PM

--  
OntModel在com.hp.hpl.jena.ontology包下面,楼主的程序中没有显示的import语句
--  作者:jp2107
--  发布时间:8/22/2006 4:47:00 PM

--  
支持
--  作者:shdiao
--  发布时间:8/22/2006 5:50:00 PM

--  
引入定义了 OntModel 的JAR包
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms