新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   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等。
    [返回] 中文XML论坛 - 专业的XML技术讨论区W3CHINA.ORG讨论区 - Web新技术讨论『 Semantic Web(语义Web)/描述逻辑/本体 』 → 检查本体一致性 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 3314 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 检查本体一致性 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     ybziwen 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:30
      积分:164
      门派:XML.ORG.CN
      注册:2008/3/22

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给ybziwen发送一个短消息 把ybziwen加入好友 查看ybziwen的个人资料 搜索ybziwen在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看ybziwen的博客楼主
    发贴心情 检查本体一致性

    我现在使用的是jena,只能做一些简单的推理,我而我想检查本体的一致性,读取一个本体文件,检查是否有逻辑错误。我看jena中没有类似的例子,哪位高手能指点一下啊?

       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/7/17 11:39:00
     
     jpz6311whu 帅哥哟,离线,有人找我吗?
      
      
      
      威望:9
      等级:研三(收到微软亚洲研究院的Offer了)(版主)
      文章:1718
      积分:10610
      门派:W3CHINA.ORG
      注册:2005/4/12

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jpz6311whu发送一个短消息 把jpz6311whu加入好友 查看jpz6311whu的个人资料 搜索jpz6311whu在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jpz6311whu的博客2
    发贴心情 
    Validation
    The most common reasoner operation which can't be exposed through additional triples in the inference model is that of validation. Typically the ontology languages used with the semantic web allow constraints to be expressed, the validation interface is used to detect when such constraints are violated by some data set.

    A simple but typical example is that of datatype ranges in RDFS. RDFS allows us to specify the range of a property as lying within the value space of some datatype. If an RDF statement asserts an object value for that property which lies outside the given value space there is an inconsistency.

    To test for inconsistencies with a data set using a reasoner we use the InfModel.validate() interface. This performs a global check across the schema and instance data looking for inconsistencies. The result is a ValidityReport object which comprises a simple pass/fail flag (ValidityReport.isValid()) together with a list of specific reports (instances of the ValidityReport.Report interface) which detail any detected inconsistencies. At a minimum the individual reports should be printable descriptions of the problem but they can also contain an arbitrary reasoner-specific object which can be used to pass additional information which can be used for programmatic handling of the violations.

    For example, to check a data set and list any problems one could do something like:

        Model data = FileManager.get().loadModel(fname);
        InfModel infmodel = ModelFactory.createRDFSModel(data);
        ValidityReport validity = infmodel.validate();
        if (validity.isValid()) {
            System.out.println("OK");
        } else {
            System.out.println("Conflicts");
            for (Iterator i = validity.getReports(); i.hasNext(); ) {
                System.out.println(" - " + i.next());
            }
        }

    The file testing/reasoners/rdfs/dttest2.nt declares a property bar with range xsd:integer and attaches a bar value to some resource with the value "25.5"^^xsd:decimal. If we run the above sample code on this file we see:

    Conflicts
    - Error (dtRange): Property http://www.hpl.hp.com/semweb/2003/eg#bar has a typed range Datatype[http://www.w3.org/2001/XMLSchema#integer -> class java.math.BigInteger]that is not compatible with 25.5:http://www.w3.org/2001/XMLSchema#decimal

    Whereas the file testing/reasoners/rdfs/dttest3.nt uses the value "25"^^xsd:decimal instead, which is a valid integer and so passes.

    Note that the individual validation records can include warnings as well as errors. A warning does not affect the overall isValid() status but may indicate some issue the application may wish to be aware of. For example, it would be possible to develop a modification to the RDFS reasoner which warned about use of a property on a resource that is not explicitly declared to have the type of the domain of the property.

    A particular case of this arises in the case of OWL. In the Description Logic community a class which cannot have an instance is regarded as "inconsistent". That term is used because it generally arises from an error in the ontology. However, it is not a logical inconsistency - i.e. something giving rise to a contradiction. Having an instance of such a class is, clearly a logical error. In the Jena 2.2 release we clarified the semantics of isValid(). An ontology which is logically consistent but contains empty classes is regarded as valid (that is isValid() is false only if there is a logical inconsistency). Class expressions which cannot be instantiated are treated as warnings rather than errors. To make it easier to test for this case there is an additional method Report.isClean() which returns true if the ontology is both valid (logically consistent) and generated no warnings (such as inconsistent classes).

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/7/19 18:57:00
     
     ybziwen 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:30
      积分:164
      门派:XML.ORG.CN
      注册:2008/3/22

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给ybziwen发送一个短消息 把ybziwen加入好友 查看ybziwen的个人资料 搜索ybziwen在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看ybziwen的博客3
    发贴心情 
    我想检查的两种错误都没能检查出来。

    一,属性hasc,是类B到类C的。类B的约束为 hasc<=1 and hasc >=2。也就是说B不可能有实例。
    二,类B的约束为hasc>=1,同时有一个B的实例b,b没有hasc的属性值。b与类B的定义矛盾。

    您能帮解答一下吗?谢谢。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/7/21 10:16:00
     
     jpz6311whu 帅哥哟,离线,有人找我吗?
      
      
      
      威望:9
      等级:研三(收到微软亚洲研究院的Offer了)(版主)
      文章:1718
      积分:10610
      门派:W3CHINA.ORG
      注册:2005/4/12

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jpz6311whu发送一个短消息 把jpz6311whu加入好友 查看jpz6311whu的个人资料 搜索jpz6311whu在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jpz6311whu的博客4
    发贴心情 
    请楼主把你程序源代码贴出来看看
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/7/27 14:05:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2025/10/6 14:46:58

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

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