以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Web Services & Semantic Web Services 』  (http://bbs.xml.org.cn/list.asp?boardid=10)
----  关于rfds命名空间的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=10&rootid=&id=86265)


--  作者:孤单一剑
--  发布时间:8/13/2010 2:02:00 PM

--  关于rfds命名空间的问题
最近在做关于本体开发的项目,需要自己根据业务关系书写SWRL规则,并完成推理功能。我的rule.rules规则文件中的代码片段如下:
@prefix fa: <http://www.owl-ontologies.com/OntologySWRL.owl#>.
@prefix xmlns: <http://www.owl-ontologies.com/OntologySWRL.owl#>.
@prefix rdfs: <xmlns:http://www.w3.org/2000/01/rdf-schema#>.
@include <RDFS>.
@include <OWL>.
[rule1: (?a rdfs:Individual fa:Person)(?b rdfs:Individual fa:Person)(?a fa:HasFather ?b)->(?b fa:Older true)]
下面是owl文件中的有关命名空间的部分信息
<rdf:RDF
    xmlns:temporal="http://swrl.stanford.edu/ontologies/built-ins/3.3/temporal.owl#"
    xmlns:swrla="http://swrl.stanford.edu/ontologies/3.3/swrla.owl#"
    xmlns="http://www.owl-ontologies.com/OntologySWRL.owl#"
    xmlns:swrl="http://www.w3.org/2003/11/swrl#"
    xmlns:swrlx="http://swrl.stanford.edu/ontologies/built-ins/3.3/swrlx.owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:swrlm="http://swrl.stanford.edu/ontologies/built-ins/3.4/swrlm.owl#"
    xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"
    xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
    xmlns:abox="http://swrl.stanford.edu/ontologies/built-ins/3.3/abox.owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:sqwrl="http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl#"
    xmlns:tbox="http://swrl.stanford.edu/ontologies/built-ins/3.3/tbox.owl#"
  xml:base="http://www.owl-ontologies.com/OntologySWRL.owl">
  <owl:Ontology rdf:about="">
    <owl:imports rdf:resource="http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl"/>
    <owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/built-ins/3.3/temporal.owl"/>
    <owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/built-ins/3.4/swrlm.owl"/>
    <owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/built-ins/3.3/abox.owl"/>
    <owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/built-ins/3.3/tbox.owl"/>
    <owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/built-ins/3.3/swrlx.owl"/>
    <owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/3.3/swrla.owl"/>
  </owl:Ontology>
我的规则文件中rdfs中的名称空间信息是根据owl文件中的命名空间信息写的,但是这样写好像有问题,xmlns本身是一个名称空间,rfds是在这个命名空间下面的一个命名空间就是一个嵌套关系,我上面的写法是有问题,程序在调用上面的规则运行时有异常,若有同志知道上面的问题,不妨交流一下,欢迎大家讨论,加QQ:498676231祥聊
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms