新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     >>W3CHINA.ORG讨论区<<     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论Semantic Web(语义Web,语义网或语义万维网, Web 3.0)及相关理论,如:Ontology(本体,本体论), OWL(Web Ontology Langauge,Web本体语言), Description Logic(DL, 描述逻辑),RDFa,Ontology Engineering等。
    [返回] W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWLW3CHINA.ORG讨论区 - Web新技术讨论『 Semantic Web(语义Web)/描述逻辑/本体 』 → 能看下到底是什么出问题么? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 18642 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 能看下到底是什么出问题么? 举报  打印  推荐  IE收藏夹 
       本主题类别: Ontology Language | RDF/RDFS | DOM    
     ehuangjiazi 美女呀,离线,快来找我吧!
      
      
      等级:大一(高数修炼中)
      文章:32
      积分:164
      门派:XML.ORG.CN
      注册:2010/11/23

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给ehuangjiazi发送一个短消息 把ehuangjiazi加入好友 查看ehuangjiazi的个人资料 搜索ehuangjiazi在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看ehuangjiazi的博客楼主
    发贴心情 能看下到底是什么出问题么?

    前段时间按照论坛上的保存本体的办法保存了一下,并且把信息改成我的,但是运行不成功,能帮忙看一下嘛?代码如下

    import java.io.*;
    import java.sql.SQLException;
    import com.hp.hpl.jena.db.*;
    import com.hp.hpl.jena.rdf.model.*;

    public class Persistent {
     public static final String strDriver = "com.mysql.jdbc.Driver";
     public static final String strURL = "jdbc:mysql://localhost:3306/jena";
     // localhost的后面要直接写冒号,再写3306;
     public static final String strUser = "root";
     public static final String strPassword = "123";
     public static final String strDB = "MySQL";

     public static void main(String[] args) {
      try {
       DBConnection connection = new DBConnection(strURL, strUser,
         strPassword, strDB);
       // 创建连接时,第四个参数需要指定所用的数据库类型;也就是说strDB的值应该是“MySQL”
       try {
        Class.forName("com.mysql.jdbc.Driver");
        System.out.println("驱动程序已经安装。");
       } catch (ClassNotFoundException e) {
        System.out
          .println("ClassNotFoundException, Driver is not available");
       }
       System.out.println("数据库连接成功。");

       // 从此处开始读入一个OWL文件并且存储到数据库中;

       ModelMaker maker = ModelFactory.createModelRDBMaker(connection);
       // 使用数据库连接参数创建一个模型制造器
       Model defModel = maker.createModel("Animal");
       // 创建一个默认模型,命名为Costume,因为我要存入的OWL文件名是Costume

       FileInputStream read = null;
       try {
        File file = new File("E:/Program Files/Protege_3.4.4/Animal.owl");
        read = new FileInputStream(file);
       } catch (FileNotFoundException e) {
        e.printStackTrace();
        System.out.println("未找到要存储的本体文件,请检查文件地址及名称");
       }
       System.out.println("已将本体文件转换为字节流文件。");

       InputStreamReader in = null;
       try {
        in = new InputStreamReader((FileInputStream) read, "UTF-8");
       } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
        System.out.println("不支持上述字符集。");
       }
       System.out.println("已将字节流文件转换为UTF-8编码。");

       defModel.read(in, null);
       try {
        in.close();
       } catch (IOException e) {
        e.printStackTrace();
        System.out.println("无法关闭字节流文件。");
       }
       System.out.println("已将字节流文件关闭。");

       defModel.commit();
       System.out.println("数据转换执行完毕,已将本体文件存入数据库。");
       try {
        connection.close();
       } catch (SQLException e) {
        e.printStackTrace();
        System.out.println("文件无法关闭。");
       }
      } catch (RDFRDBException e) {
       System.out.println("出现异常");
      }
      System.out.println("已将本体文件持久化到数据库中");
     }
    }


    运行的时候出现的错误是
    驱动程序已经安装。
    数据库连接成功。
    已将本体文件转换为字节流文件。
    已将字节流文件转换为UTF-8编码。
    Exception in thread "main" java.lang.NoSuchMethodError: com.ibm.icu.text.Normalizer.isNormalized(Ljava/lang/String;Lcom/ibm/icu/text/Normalizer$Mode;I)Z
     at com.hp.hpl.jena.rdf.arp.impl.CharacterModel.isNormalFormC(CharacterModel.java:26)
     at com.hp.hpl.jena.rdf.arp.impl.ParserSupport.checkString(ParserSupport.java:117)
     at com.hp.hpl.jena.rdf.arp.impl.ARPDatatypeLiteral.<init>(ARPDatatypeLiteral.java:24)
     at com.hp.hpl.jena.rdf.arp.states.WantTypedLiteral.endElement(WantTypedLiteral.java:31)
     at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.endElement(XMLHandler.java:140)
     at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
     at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown Source)
     at org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
     at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:106)
     at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:197)
     at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:184)
     at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:222)
     at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:187)
     at Persistent.main(Persistent.java:54)


       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    加油啊~~鸭梨好大~~~~~~

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2011/3/21 15:50:00
     
     ehuangjiazi 美女呀,离线,快来找我吧!
      
      
      等级:大一(高数修炼中)
      文章:32
      积分:164
      门派:XML.ORG.CN
      注册:2010/11/23

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给ehuangjiazi发送一个短消息 把ehuangjiazi加入好友 查看ehuangjiazi的个人资料 搜索ehuangjiazi在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看ehuangjiazi的博客2
    发贴心情 
    我想知道导入jar包除了build path之外,还有什么方法啊?

    ----------------------------------------------
    加油啊~~鸭梨好大~~~~~~

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2011/3/21 17:01:00
     
     ccc689 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:82
      门派:XML.ORG.CN
      注册:2008/6/15

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给ccc689发送一个短消息 把ccc689加入好友 查看ccc689的个人资料 搜索ccc689在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看ccc689的博客3
    发贴心情 
    ★★★中国医学论文下载中心http://www.yixue68.com/index.php  
    医学论文发表:http://www.jiaoyu68.com/sitemap.xml
    医学期刊检索:http://www.yixue68.com/xyfm/class/
    医药卫生杂志 医药管理杂志 医学教育杂志 预防医学杂志 基础医学杂志 临床医学杂志 中西医结合杂志  呼吸系统杂志 消化系统杂志 中医学杂志 中药学杂志 内分泌腺杂志 泌尿科杂志 传染病与皮肤病杂志 妇产杂志 心脑血管杂志 儿科杂志 外科杂志 眼科与耳鼻喉杂志 口腔杂志 肿瘤杂志 护理杂志 神经病杂志 生物医学杂志  影像学杂志 药学杂志 畜牧兽医杂志
    儿科学论文:http://www.yixue68.com/erke/class/?108.html  
    护理学论文:http://www.yixue68.com/huli/class/?124.html  
    妇科学论文:http://www.yixue68.com/fuchanke/class/?107.html  
    产科学论文:http://www.yixue68.com/fuchanke/class/?132.html  
    孕育学论文:http://www.yixue68.com/fuchanke/class/?133.html   
    乳腺学论文:http://www.yixue68.com/fuchanke/class/?182.html  
    肺学论文:http://www.yixue68.com/huxi/class/?103.html  
    呼吸道学论文:http://www.yixue68.com/huxi/class/?162.html   
    胆囊学论文:http://www.yixue68.com/zhongyao/class/?175.html  
    胰腺学论文:http://www.yixue68.com/zhongyao/class/?176.html  
    心脏学论文:http://www.yixue68.com/xinxueguan/class/?129.html  
    血液学论文:http://www.yixue68.com/xinxueguan/class/?128.html  
    血管学论文:http://www.yixue68.com/xinxueguan/class/?121.html  
    肝脏学论文:http://www.yixue68.com/zhongyao/class/?119.html  
    胃学论文:http://www.yixue68.com/xiaohua/class/?117.html  
    消化腺学论文:http://www.yixue68.com/xiaohua/class/?151.html  
    肛肠学论文:http://www.yixue68.com/xiaohua/class/?171.html  
    肾脏学论文:http://www.yixue68.com/miniao/class/?178.html  
    糖尿病学论文:http://www.yixue68.com/miniao/class/?118.html  
    男科学论文:http://www.yixue68.com/miniao/class/?186.html  
    肾上腺学论文:http://www.yixue68.com/miniao/class/?183.html  
    耳鼻喉学论文:http://www.yixue68.com/wuguan/class/?109.html  
    口腔学论文:http://www.yixue68.com/kouqiang/class/?123.html  
    眼科学论文:http://www.yixue68.com/wuguan/class/?131.html  
    牙科学论文:http://www.yixue68.com/kouqiang/class/?152.html  
    皮肤病学论文:http://www.yixue68.com/pifu/class/?120.html  
    美容学论文:http://www.yixue68.com/pifu/class/?136.html  
    整形学论文:http://www.yixue68.com/pifu/class/?135.html   
    性病学论文:http://www.yixue68.com/pifu/class/?148.html  
    临床医学论文:http://www.yixue68.com/linchuang/class/?102.html  
    中医内科学论文:http://www.yixue68.com/zhongyi/class/?104.html  
    中医外科学论文:http://www.yixue68.com/zhongyi/class/?138.html  
    中西医学论文:http://www.yixue68.com/zhongxi/class/?116.html   
    针灸学论文:http://www.yixue68.com/zhongyi/class/?174.html   
    西药学论文:http://www.yixue68.com/yao/class/?113.html   
    中药学论文:http://www.yixue68.com/yao/class/?146.html  
    医药管理学论文:http://www.yixue68.com/news/class/?2.html  
    生物医学论文:http://www.yixue68.com/shengwu/class/?112.html  
    医药文献论文:http://www.yixue68.com/news/class/?161.html  
    医学教育学论文:http://www.yixue68.com/jiaoyu/class/?114.html  
    医学心理学论文:http://www.yixue68.com/jiaoyu/class/?147.html  
    病理学论文:http://www.yixue68.com/jichu/class/?115.html  
    老年保健论文:http://www.yixue68.com/yufang/class/?101.html  
    免疫学论文:http://www.yixue68.com/yufang/class/?137.html  
    甲状腺学论文:http://www.yixue68.com/yufang/class/?184.html  
    传染病学论文:http://www.yixue68.com/yufang/class/?188.html  
    肿瘤学论文:http://www.yixue68.com/zhongliu/class/?110.html  
    理疗学论文:http://www.yixue68.com/tezhong/class/?166.html  
    放疗学论文:http://www.yixue68.com/zhongliu/class/?169.html  
    医学信息学论文:http://www.yixue68.com/jiaoan/class/?187.html  
    医疗器械学论文:http://www.yixue68.com/jiaoan/class/?4.html  
    检验学论文:http://www.yixue68.com/tezhong/class/?126.html  
    心电学论文:http://www.yixue68.com/xinxueguan/class/?170.html  
    CT 学论文:http://www.yixue68.com/tezhong/class/?164.html  
    核医学论文:http://www.yixue68.com/tezhong/class/?165.html   
    超声学论文:http://www.yixue68.com/tezhong/class/?168.html  
    骨科学论文:http://www.yixue68.com/waike/class/?150.html  
    创伤学论文:http://www.yixue68.com/waike/class/?122.html  
    器官移植学论文:http://www.yixue68.com/zhongyao/class/?153.html  
    药理学论文:http://www.yixue68.com/jichu/class/?160.html  
    麻醉学论文:http://www.yixue68.com/waike/class/?177.html  
    手术解剖学论文:http://www.yixue68.com/waike/class/?172.html   
    脑外科学论文:http://www.yixue68.com/xinxueguan/class/?130.html  
    脊神经学论文:http://www.yixue68.com/shengjing/class/?180.html  
    脑神经学论文:http://www.yixue68.com/shengjing/class/?111.html  
    植物神经学论文:http://www.yixue68.com/shengjing/class/?181.html  
    垂体学论文:http://www.yixue68.com/shengjing/class/?185.html  
    精神病学论文:http://www.yixue68.com/shengjing/class/?179.html  
    兽医学论文:http://www.yixue68.com/xumushouyi/class/?191.html  
    禽医学论文:http://www.yixue68.com/xumushouyi/class/?192.html
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2011/8/19 17:37:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/3/28 17:46:26

    本主题贴数3,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    78.125ms