当前位置: 首页 > 网络学院 > XML相关教程 > RDF > RDF Schema

RDF
RDF 介绍
RDF 规则
RDF 实例
RDF 元素
RDF 容器
RDF 集合
RDF Schema
RDF 都柏林核心
RDF 参考
RDF OWL

RDF Schema


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 573 ::
收藏到网摘: n/a

RDF Schema (RDFS) is an extension to RDF.
RDF Schema (RDFS) 是对 RDF 的一种扩展。


RDF Schema and Application Classes
RDF Schema 和 应用程序的类

RDF describes resources with classes, properties, and values.
RDF 通过类、属性和值来描述资源。

In addition, RDF also need a way to define application-specific classes and properties. Application-specific classes and properties must be defined using extensions to RDF
此外,RDF 还需要一种定义应用程序专业的类和属性的方法。应用程序专用的类和属性必须使用对 RDF 的扩展来定义。

One such extension is RDF Schema.
RDF Schema 就是这样一种扩展。


RDF Schema (RDFS)
RDF Schema (RDFS)

RDF Schema does not provide actual application-specific classes and properties,Instead RDF Schema provides the framework to describe application-specific classes and propertiesRDF Schema 不提供实际的应用程序专用的类和属性,而是提供了描述应用程序专用的类和属性的框架。

Classes in RDF Schema is much like classes in object oriented programming languages. This allows resources to be defined as instances of classes, and subclasses of classes.
RDF Schema 中的类与面向对象编程语言中的类非常相似。这就使得资源能够作为类的实例和类的子类来被定义。


RDFS Example
RDFS 实例

The following example demonstrates some of the RDFS facilities:
下面的实例演示了 RDFS 的能力的某些方面:

<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base= "http://www.animals.fake/animals#">
<rdf:Description rdf:ID="animal">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>

</rdf:Description>
<rdf:Description rdf:ID="horse">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#animal"/>
</rdf:Description>
</rdf:RDF>

In the example above, the resource "horse" is a subclass of the class "animal".
在上面的例子中,资源 "horse" 是类 "animal" 的子类。


Example Abbreviated
简化的例子

Since an RDFS class is an RDF resource we can abbreviate the example above by using rdfs:Class instead of rdf:Description, and drop the rdf:type information:
由于一个 RDFS 类就是一个 RDF 资源,我们可以通过使用 rdfs:Class 取代 rdf:Description,并去掉 rdf:type 信息,来把上面的例子简写一下:

<?xml version="1.0"?>
<rdf:RDF 
xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base= "http://www.animals.fake/animals#">
<rdfs:Class rdf:ID="animal" />
<rdfs:Class rdf:ID="horse">

<rdfs:subClassOf rdf:resource="#animal"/>
</rdfs:Class>
</rdf:RDF>

That's it!
就是这样的!

评论 (0) All

登陆 | 还没注册?