本体开发日记05-努力理解SWRL(下)

五、XML 具体语法XML Concrete Syntax

XML 具体语法是 OWL Web Ontology Language XML Presentation Syntax [ OWL XML ] 与 RuleML XML 语法 [ RuleML ] 的组合。

  • 任意 OWL 类(例如,描述)可以用作规则中的谓词
  • 规则和本体公理可以自由混合
  • 现有的 XSLT 样式表 ( owlxml2rdf.xsl ) 可以很容易地扩展以提供到 RDF 图的映射,从而扩展了 OWL RDF/XML 交换语法
  • 简化了 OWL 和 RuleML 之间的互操作性,现有的 RuleML 工具可以适应 SWRL,并且是附加规则表达功能的进化扩展路径。

SWRL XML 具体语法的 XML 模式是 swrlx.xsd。 swrlx.xsd 当前引用了 OWL XML 表示语法的 XML 模式的本地副本,该副本已修改为允许对其多个元素和属性进行外部引用,并定义 owlx:datarange,这似乎是 OWL XML 表示语法的一个缺失部分。

swrlx.xsd

可直接复制!

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:owlx="http://www.w3.org/2003/05/owl-xml" xmlns:swrlx="http://www.w3.org/2003/11/swrlx" xmlns:ruleml="http://www.w3.org/2003/11/ruleml" targetNamespace="http://www.w3.org/2003/11/swrlx" elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2003/05/owl-xml" schemaLocation="owlx/schema/owl1-dl.xsd"/>
<xsd:import namespace="http://www.w3.org/2003/11/ruleml" schemaLocation="ruleml.xsd"/>
<xsd:annotation>
<xsd:documentation> XML Schema driver for SWRL 0.6 The root element of SWRL documents for the XML Concrete Syntax must be the Ontology element. </xsd:documentation>
</xsd:annotation>
<xsd:element name="Ontology">
<xsd:annotation>
<xsd:documentation> This is the root element of SWRL documents in the XML Concrete Syntax. It extends owlx:Ontology </xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:choice>
<!--  Header elements  -->
<xsd:element ref="owlx:VersionInfo"/>
<xsd:element ref="owlx:PriorVersion"/>
<xsd:element ref="owlx:BackwardCompatibleWith"/>
<xsd:element ref="owlx:IncompatibleWith"/>
<xsd:element ref="owlx:Imports"/>
<xsd:element ref="owlx:Annotation"/>
<!--  Class elements  -->
<xsd:element ref="owlx:Class"/>
<xsd:group ref="owlx:classElements"/>
<!--  Property elements  -->
<xsd:element ref="owlx:DatatypeProperty"/>
<xsd:element ref="owlx:ObjectProperty"/>
<xsd:element ref="owlx:SubPropertyOf"/>
<xsd:element ref="owlx:EquivalentProperties"/>
<!--  Instances  -->
<xsd:element ref="owlx:Individual"/>
<xsd:element ref="owlx:SameIndividual"/>
<xsd:element ref="owlx:DifferentIndividuals"/>
<!--  SWRL extensions  -->
<xsd:element ref="ruleml:imp"/>
<xsd:element ref="ruleml:var"/>
</xsd:choice>
</xsd:sequence>
</xsd:sequence>
<xsd:attribute ref="owlx:name"/>
</xsd:complexType>
<!--  XXX:  clone for rule names, etc.  -->
<xsd:unique name="classNameUniqueness">
<xsd:annotation>
<xsd:documentation> This constraint ensures that every class name is unique in a single OWL document. </xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="owlx:Class"/>
<xsd:field xpath="@owlx:name"/>
</xsd:unique>
</xsd:element>
<xsd:group name="atom">
<xsd:choice>
<xsd:element ref="swrlx:classAtom"/>
<xsd:element ref="swrlx:datarangeAtom"/>
<xsd:element ref="swrlx:individualPropertyAtom"/>
<xsd:element ref="swrlx:datavaluedPropertyAtom"/>
<xsd:element ref="swrlx:sameIndividualAtom"/>
<xsd:element ref="swrlx:differentIndividualsAtom"/>
<xsd:element ref="swrlx:builtinAtom"/>
</xsd:choice>
</xsd:group>
<xsd:element name="classAtom">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="owlx:description"/>
<xsd:group ref="swrlx:iObject"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="datarangeAtom">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="owlx:datarange"/>
<xsd:group ref="swrlx:dObject"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="individualPropertyAtom">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="swrlx:iObject"/>
<xsd:group ref="swrlx:iObject"/>
</xsd:sequence>
<xsd:attribute name="property" type="owlx:IndividualPropertyName" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="datavaluedPropertyAtom">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="swrlx:iObject"/>
<xsd:group ref="swrlx:dObject"/>
</xsd:sequence>
<xsd:attribute name="property" type="owlx:DataPropertyName" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="sameIndividualAtom">
<xsd:complexType>
<xsd:sequence minOccurs="2" maxOccurs="2">
<xsd:group ref="swrlx:iObject"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="differentIndividualsAtom">
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值