新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   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)/描述逻辑/本体 』 → 如何在ontModel上合用owl自带规则和自定义规则 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4042 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 如何在ontModel上合用owl自带规则和自定义规则 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     anzhiruosu 帅哥哟,离线,有人找我吗?
      
      
      等级:大二(研究C++)
      文章:54
      积分:286
      门派:XML.ORG.CN
      注册:2007/7/18

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给anzhiruosu发送一个短消息 把anzhiruosu加入好友 查看anzhiruosu的个人资料 搜索anzhiruosu在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看anzhiruosu的博客楼主
    发贴心情 如何在ontModel上合用owl自带规则和自定义规则

    看了jena中有关推理的文档,好像如果想应用自定义规则的话,只能建立一个infmodel,这样的话infmodel就不包含owl语言自带的规则,比如那些transtive,functional规则。我现在想直接建立一个ontmodel,这样可以用ontModelSpec.OWL_MEN_RULE_INF来设置这个模型,然后我还想在上面运用自定义规则。请问该如何操作才能达到这个目的?

       收藏   分享  
    顶(0)
      




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

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jpz6311whu发送一个短消息 把jpz6311whu加入好友 查看jpz6311whu的个人资料 搜索jpz6311whu在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jpz6311whu的博客2
    发贴心情 
    Combining RDFS/OWL with custom rules
    Sometimes one wishes to write generic inference rules but combine them with some RDFS or OWL infernece. With the current Jena architecture limited forms of this is possible but you need to be aware of the limitations.

    There are two ways of achieving this sort of configuration within Jena (not counting using an external engine that already supports such a combination).

    Firstly, it is possible to cascade reasoners, i.e. to construct one InfModel using another InfModel as the base data. The strength of this appoach is that the two inference processes are separate and so can be of different sorts. For example one could create a GenericRuleReasoner whose base model is an external OWL reasoner. The chief weakness of the approach is that it is "layered" - the outer InfModel can see the results of the inner InfModel but not vice versa. For some applications that layering is fine and it is clear which way the inference should be layered, for some it is not. A second possible weakness is performance. A query to an InfModel is generally expensive and involves lots of queries to the data. The outer InfModel in our layered case will typically issue a lot of queries to the inner model, each of which may trigger more inferenece. If the inner model caches all of its inferences (e.g. a forward rule engine) then there may not be very much redundancy there but if not then performance can suffer dramatically.

    Secondly, one can create a single GenericRuleReasoner whose rules combine rules for RDFS or OWL and custom rules. At first glance this looks like it gets round the layering limitation. However, the default Jena RDFS and OWL rulesets use the Hybrid rule engine. The hybrid engine is itself layered, forward rules do not see the results of any backward rules. Thus layering is still present though you have finer grain control - all your inferences you want the RDFS/OWL rules to see should be forward, all the inferences which need all of the results of the RDFS/OWL rules should be backward. Note that the RDFS and OWL rulesets assume certain settings for the GenericRuleReasoner so a typical configuration is:

      Model data = FileManager.get().loadModel("file:data.n3");
      
      List rules = Rule.rulesFromURL("myrules.rules");
      
      GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
      reasoner.setOWLTranslation(true);               // not needed in RDFS case
      reasoner.setTransitiveClosureCaching(true);
      
      InfModel inf = ModelFactory.createInfModel(reasoner, data);

    Where the myrules.rules file will use @include to include one of the RDFS or OWL rule sets.

    One useful variant on this option, at least in simple cases, is to manually include a pure (non-hybrid) ruleset for the RDFS/OWL fragment you want so that there is no layering problem. [The reason the default rulesets use the hybrid mode is a performance tradeoff - trying to balance the better performance of forward reasoning with the cost of computing all possible answers when an application might only want a few.]

    A simple example of this is that the interesting bits of RDFS can be captured by enabled TranstiveClosureCaching and including just the four core rules:

    [rdfs2:  (?x ?p ?y), (?p rdfs:domain ?c) -> (?x rdf:type ?c)]
    [rdfs3:  (?x ?p ?y), (?p rdfs:range ?c) -> (?y rdf:type ?c)]
    [rdfs6:  (?a ?p ?b), (?p rdfs:subPropertyOf ?q) -> (?a ?q ?b)]
    [rdfs9:  (?x rdfs:subClassOf ?y), (?a rdf:type ?x) -> (?a rdf:type ?y)]

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/10/13 15:35:00
     
     bzbc 帅哥哟,离线,有人找我吗?
      
      
      等级:大三暑假(TOFEL考了660分!)
      文章:151
      积分:921
      门派:XML.ORG.CN
      注册:2006/4/15

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给bzbc发送一个短消息 把bzbc加入好友 查看bzbc的个人资料 搜索bzbc在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看bzbc的博客3
    发贴心情 
    楼上你说后面的那几个规则是意思呢?
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/10/15 17:37:00
     
     jpz6311whu 帅哥哟,离线,有人找我吗?
      
      
      
      威望:9
      等级:研三(收到微软亚洲研究院的Offer了)(版主)
      文章:1718
      积分:10610
      门派:W3CHINA.ORG
      注册:2005/4/12

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jpz6311whu发送一个短消息 把jpz6311whu加入好友 查看jpz6311whu的个人资料 搜索jpz6311whu在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jpz6311whu的博客4
    发贴心情 
    关于rdfs2,rdfs3...这些规则在w3c官方网站上的RDF Semantic文档中有介绍:
    http://www.w3.org/TR/rdf-mt/
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/10/15 22:26:00
     
     hunterdong 帅哥哟,离线,有人找我吗?
      
      
      等级:大三(研究MFC有点眉目了!)
      文章:86
      积分:641
      门派:XML.ORG.CN
      注册:2006/10/16

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

    居然出自 Jena Inference support而我没看到,汗一个。。。

    OWL_MEN_RULE_INF这个东东好像只有api里有。。网上没任何介绍

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/11/14 16:09:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 Semantic Web(语义Web)/描述逻辑/本体 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/3 1:45:41

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

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