本体开发日记05-努力理解SWRL(RDF Concrete Syntax)

RDF Concrete SyntaxRDF 具体语法

SWRL 的 RDF 模式是 swrl.rdf。SWRL 的 OWL 本体是 swrl.owl。每一个都只提供了 SWRL 语法的部分描述;OWL 本体比 RDF Schema 更完整。通过扩展OWL XML 表示语法 [ OWL XML ]的XSLT 转换,可以轻松完成从 XML 具体语法到 RDF/XML 的 转换。

swrl.rdf

<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE rdf:RDF [
         <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns'>
         <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema'>
	 <!ENTITY owl 'http://www.w3.org/2002/07/owl'>
	 <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema'>
         <!ENTITY ruleml 'http://www.w3.org/2003/11/swrl'>
         <!ENTITY swrl 'http://www.w3.org/2003/11/swrl'>
]>

<rdf:RDF
  xmlns:rdf ="&rdf;#"
  xmlns:rdfs="&rdfs;#"
  xmlns:owl ="&owl;#"
  xmlns:ruleml="&ruleml;#"
  xmlns:swrl="&swrl;#"
  xml:base  ="&swrl;"
>

<rdf:Description rdf:about="">
  <rdfs:comment>RDF Schema definition of the RDF Concrete Syntax for the Semantic Web Rule Language</rdfs:comment>
  <owl:versionInfo>$Id: swrl.rdf,v 1.11 2004/04/30 11:05:00 mdean Exp $</owl:versionInfo>
</rdf:Description>

<rdfs:Class rdf:ID="Imp">
  <rdfs:comment>implication (rule)</rdfs:comment>
</rdfs:Class>

<rdf:Property rdf:ID="head">
  <rdfs:domain rdf:resource="#Imp"/>
  <rdfs:range rdf:resource="&rdf;#List"/>
  <rdfs:comment>rule head (consequent):  List of Atom</rdfs:comment>
</rdf:Property>

<rdf:Property rdf:ID="body">
  <rdfs:domain rdf:resource="#Imp"/>
  <rdfs:range rdf:resource="&rdf;#List"/>
  <rdfs:comment>rule body (antecedent):  List of Atom</rdfs:comment>
</rdf:Property>

<rdfs:Class rdf:ID="Variable">
  <rdfs:comment>indicate that a URI is being used as a variable</rdfs:comment>
</rdfs:Class>

<rdfs:Class rdf:ID="Atom">
  <rdfs:comment>common superclass</rdfs:comment>
</rdfs:Class>

<rdf:Property rdf:ID="argument1">
  <rdfs:domain rdf:resource="#Atom"/>
  <rdfs:range rdf:resource="&rdfs;#Resource"/>
</rdf:Property>

<rdf:Property rdf:ID="argument2">
  <rdfs:domain rdf:resource="#Atom"/>
  <rdfs:comment>can be a Literal or Resource</rdfs:comment>
</rdf:Property>

<rdfs:Class rdf:ID="ClassAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of a classPredicate and argument1</rdfs:comment>
</rdfs:Class>

<rdf:Property rdf:ID="classPredicate">
  <rdfs:domain rdf:resource="#ClassAtom"/>
  <rdfs:range rdf:resource="&rdfs;#Class"/>
</rdf:Property>

<rdfs:Class rdf:ID="IndividualPropertyAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of a propertyPredicate (owl:ObjectProperty), argument1 (owl:Thing), and argument2 (owl:Thing)</rdfs:comment>
</rdfs:Class>

<rdf:Property rdf:ID="propertyPredicate">
  <rdfs:domain rdf:resource="#Atom"/>
  <rdfs:range rdf:resource="&rdf;#Property"/>
</rdf:Property>

<rdfs:Class rdf:ID="DatavaluedPropertyAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of a propertyPredicate (owl:DatatypeProperty), argument1 (owl:Thing), and argument2 (rdfs:Literal)</rdfs:comment>
</rdfs:Class>

<rdfs:Class rdf:ID="SameIndividualAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of argument1 (owl:Thing) and argument2 (owl:Thing)</rdfs:comment>
</rdfs:Class>

<rdfs:Class rdf:ID="DifferentIndividualsAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of argument1 (owl:Thing) and argument2 (owl:Thing)</rdfs:comment>
</rdfs:Class>

<rdfs:Class rdf:ID="BuiltinAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of a builtin and a List of arguments</rdfs:comment>
</rdfs:Class>

<rdfs:Class rdf:ID="Builtin"/>

<!-- enumerate Builtins -->

<rdf:Property rdf:ID="builtin">
  <rdfs:domain rdf:resource="#BuiltinAtom"/>
  <rdfs:range rdf:resource="#Builtin"/>
</rdf:Property>

<rdf:Property rdf:ID="arguments">
  <rdfs:domain rdf:resource="#BuiltinAtom"/>
  <rdfs:range rdf:resource="&rdf;#List"/>
</rdf:Property>

<rdfs:Class rdf:ID="DataRangeAtom">
  <rdfs:subClassOf rdf:resource="#Atom"/>
  <rdfs:comment>consists of a dataRange and argument1</rdfs:comment>
</rdfs:Class>

<rdf:Property rdf:ID="dataRange">
  <rdfs:domain rdf:resource="#DataRangeAtom"/>
  <rdfs:range rdf:resource="&owl;#DataRange"/>
</rdf:Property>

</rdf:RDF>

swrl.owl

<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE rdf:RDF [
         <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns'>
         <!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema'>
	 <!ENTITY owl 'http://www.w3.org/2002/07/owl'>
	 <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema'>
         <!ENTITY ruleml 'http://www.w3.org/2003/11/swrl'>
         <!ENTITY swrl 'http://www.w3.org/2003/11/swrl'>
]>

<rdf:RDF
  xmlns:rdf ="&rdf;#"
  xmlns:rdfs="&rdfs;#"
  xmlns:owl ="&owl;#"
  xmlns:ruleml="&ruleml;#"
  xmlns:swrl="&swrl;#"
  xml:base  ="&swrl;"
>

<owl:Ontology rdf:about="">
  <rdfs:comment>OWL definition of the RDF Concrete Syntax for the Semantic Web Rule Language</rdfs:comment>
  <owl:versionInfo>$Id: swrl.owl,v 1.15 2004/11/09 11:58:28 mdean Exp $</owl:versionInfo>
</owl:Ontology>

<owl:Class rdf:ID="Imp">
  <rdfs:comment>implication (rule)</rdfs:comment>
  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值