当前位置: 首页 > 网络学院 > XML相关教程 > RDF > RDF 元素
The main elements of RDF are the root element, <RDF>, and the <Description> element, which identifies a resource.
RDF 的主要元素是 <RDF> 以及可表示某个资源的 <Description> 元素。
<rdf:RDF> is the root element of an RDF document. It defines the XML document to be an RDF document. It also contains a reference to the RDF namespace:
<rdf:RDF> 是一个 RDF 文档的根源苏。它把 XML 文档定义为一个 RDF 文档。它也包含了对 RDF 命名空间的引用:
<?xml version="1.0"?> <rdf:RDF |
The <rdf:Description> element identifies a resource with the about attribute.
<rdf:Description> 元素可通过 about 属性标识一个资源。
The <rdf:Description> element contains elements that describe the resource:
<rdf:Description> 元素可包含描述资源的那些元素:
<?xml version="1.0"?> <rdf:RDF <rdf:Description </rdf:RDF> |
The elements, artist, country, company, price, and year, are defined in the http://www.recshop.fake/cd# namespace. This namespace is outside RDF (and not a part of RDF). RDF defines only the framework. The elements, artist, country, company, price, and year, must be defined by someone else (company, organization, person, etc).
artist、country、company、price 以及 year 这些元素被定义在命名空间 http://www.recshop.fake/cd# 中。此命名空间在 RDF 之外(并非 RDF 的组成部分)。RDF 仅仅定义了这个框架。而 artist、country、company、price 以及 year 这些元素必须被其他人(公司、组织或个人等)进行定义。
The property elements can also be defined as attributes (instead of elements):
属性元素(property elements)也可作为属性(attributes)来被定义(取代元素):
<?xml version="1.0"?> <rdf:RDF <rdf:Description </rdf:RDF> |
The property elements can also be defined as resources:
属性元素(property elements)也可被作为资源(resources)来被定义:
<?xml version="1.0"?> <rdf:RDF <rdf:Description </rdf:RDF> |
In the example above, the property artist does not have a value, but a reference to a resource containing information about the artist.
在上面的例子中,属性 artist 没有值,但是却引用了一个对包含有关艺术家的信息的资源。