RDF入门 推荐标准

TransWiki - W3CHINA.ORG开放翻译计划(OTP)


译文 RDF入门 推荐标准http://wiki.w3china.org/rdfprimer.htm (http://wiki.w3china.org/rdfprimer.htm)
原文 RDF Primer Recommendation(http://www.w3.org/TR/rdf-primer/ (http://www.w3.org/TR/rdf-primer/)
说明
  • 本文档是根据2004年2月10日发布的http://www.w3.org/TR/rdf-primer/ RDF Primer推荐标准 (http://www.w3.org/TR/rdf-primer/)进行翻译的。
  • 本文档的http://www.w3.org/TR/rdf-primer/ 英文版 (http://www.w3.org/TR/rdf-primer/)是唯一的正式版本。
  • 虽然译者已为翻译之精确付出努力,不足之处仍难免存在。欢迎指正 (http://zh.transwiki.org/cn/rdfprimer-edit.htm)
  • 译注的内容是非正式的,仅代表译者个人观点。
  • 著作权声明位于:

http://www.w3.org/Consortium/Legal/copyright-documents.html
Copyright  © 1998 W3C® (MIT, INRIA, Keio ), All Rights

Reserved. W3C liability, trademark, document use and software licensing rules apply.

  • 中文版的版权声明:转载本文,请注明译者、原链接及出处为“W3CHINA.ORG 开放翻译计划(OTP)”。
译者
  • 朱礼军 (http://bbs.w3china.org/dispuser.asp?name=trevol)(Lijun Zhu), zhulj<at>w3china.org:工作组主席。翻译第5节、6.4节,校对第3节,并负责全文的统稿和翻译中的协调与裁决工作。
  • 刘升平 (http://bbs.w3china.org/dispuser.asp?name=orangebench)(Shengping Liu),lsp<at>w3china.org:翻译第4节、5.3-5.5节、6.7节和第7节,校对第1-2节、6.1-6.3节、6.5-6.6节和附录,并负责工作组的组织与翻译工作的统筹。
  • 徐涵 (http://bbs.w3china.org/dispuser.asp?name=admin)(Collin Hsu),webmaster<at>w3china.org:翻译目录、第1节、第3节和附录,校对第5节和6.7节。
  • 詹子鹏 (http://bbs.w3china.org/dispuser.asp?name=forwar)(Zipeng Zhan):翻译摘要、第2节和6.2节。
  • 倪跃 (http://bbs.w3china.org/dispuser.asp?name=nybon)(nybon@163.com):翻译6.5和6.6节。
  • Ontoweb (http://bbs.w3china.org/dispuser.asp?name=Ontoweb)(zhao608<at>yahoo.com.cn):翻译6.1节。
  • 暴雨 (http://bbs.w3china.org/dispuser.asp?name=weekend)(weekend256@yahoo.com.cn):翻译6.3节。
  • 汪鹏 (http://bbs.w3china.org/dispuser.asp?name=npubird)(npu007@263.net):校对第4节。
  • 张钋 (http://bbs.w3china.org/dispuser.asp?name=monbit)(zhangpo217217@sina.com):校对6.4节。

关于本文档翻译工作的说明、任务分配及进展情况,请参见http://bbs.xml.org.cn/dispbbs.asp?boardid=2&id=8689&star=1#8689 (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&id=8689&star=1#8689)

致谢
特别感谢orangebench,他在翻译过程中所提出口号——“一日一段不懈怠”成为了鞭策小组成员持之以恒、不断努力的座右铭。还要特别感谢由W3CHINA.ORG (http://www.w3china.org/)主办的开放翻译计划(OTP) (http://wiki.w3china.org/)为本次翻译计划提供翻译与讨论平台。最后感谢工作组其它成员Admin、ForWar、Nybon、Weekend、OntoWeb等积极参与该次翻译活动,并就有关的翻译问题进行了热烈讨论。


目录

1 RDF入门

建议翻译时保留英文原文,以便于复查和修改。

尽量使用段落编辑(即点击要编辑段落右上方的[编辑]字样)


http://www.w3.org/Icons/w3c_home (http://www.w3.org/)

RDF入门



W3C 推荐标准 2004年02月10日


This version:
当前版本:
http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/)

Latest version:
最新版本:
http://www.w3.org/TR/rdf-primer/ (http://www.w3.org/TR/rdf-primer/)

Previous version:
上一版本:
http://www.w3.org/TR/2003/PR-rdf-primer-20031215/ (http://www.w3.org/TR/2003/PR-rdf-primer-20031215/)

Editors:
编者:
Frank Manola, fmanola@acm.org (mailto:fmanola@acm.org)

Eric Miller, W3C, em@w3.org (mailto:em@w3.org)


Series Editor:

系列文档编者:

Brian McBride, Hewlett-Packard Laboratories, bwm@hplb.hpl.hp.com (mailto:bwm@hplb.hpl.hp.com)



Please refer to the errata (http://www.w3.org/2001/sw/RDFCore/errata#rdf-primer) for this document, which may include some normative corrections.
阅读时请参照本文档的勘误表 (http://www.w3.org/2001/sw/RDFCore/errata#rdf-primer),其中可能会包含一些规范性的修正。


See also translations (http://www.w3.org/2001/sw/RDFCore/translation/rdf-primer).
也要留意译文 (http://www.w3.org/2001/sw/RDFCore/translation/rdf-primer)

Copyright (http://www.w3.org/Consortium/Legal/ipr-notice#Copyright)? 2004 W3C? (MIT, ERCIM, Keio (http://www.keio.ac.jp/)), All Rights Reserved. W3C liability (http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer), trademark (http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks), document use (http://www.w3.org/Consortium/Legal/copyright-documents) and software licensing (http://www.w3.org/Consortium/Legal/copyright-software) rules apply.





Abstract


摘要


The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web.
This Primer is designed to provide the reader with the basic knowledge required to effectively use RDF.

It introduces the basic concepts of RDF and describes its XML syntax.
It describes how to define RDF vocabularies using the RDF Vocabulary Description Language,
and gives an overview of some deployed RDF applications.
It also describes the content and purpose of other RDF specification documents.

资源描述框架 (RDF) 是用来表现万维网上各类资源的信息的一种语言,为了帮助读者了解一些必备的基础知识后能有效地使用 RDF,特编写此基础入门教程。本书介绍了RDF的一些基本概念以及RDF基于XML(可扩展标记语言)的语法。本书还讨论了如何用RDF词汇描述语言来定义RDF词汇集,并总结了目前所部署的一些基于RDF的应用。最后,本文介绍了其他RDF规范文档的内容和用途。




Status of this Document


本文档的状态


This document has been reviewed by W3C Members and other interested parties, 阿and it has been endorsed by the Director as a W3C Recommendation (http://www.w3.org/2003/06/Process-20030618/tr.html#RecsW3C).W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

本文档已被W3C成员及其他相关方面审阅,并已被W3C总监(W3C Director)[译注//Director是W3C组织的最高行政职位,目前由Tim Berners-Lee担任。]批准为W3C推荐标准(W3C Recommendation) (http://www.w3.org/2003/06/Process-20030618/tr.html#RecsW3C)。W3C 制定推荐标准的任务是使之受到关注,并促使其被广泛应用。这将增强Web的功能性(functionality)与互操作性(interoperablity)。

This is one document in a set of six (http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-Introduction) (Primer (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/), Concepts (http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/), Syntax (http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/), Semantics (http://www.w3.org/TR/2004/REC-rdf-mt-20040210/), Vocabulary (http://www.w3.org/TR/2004/REC-rdf-schema-20040210/), and Test Cases (http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/)) intended to jointly replace the original Resource Description Framework specifications, RDF Model and Syntax (1999 Recommendation) (http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/) and RDF Schema (2000 Candidate Recommendation) (http://www.w3.org/TR/2000/CR-rdf-schema-20000327/). It has been developed by the RDF Core Working Group (http://www.w3.org/2001/sw/RDFCore/) as part of the W3C Semantic Web Activity (http://www.w3.org/2001/sw/) (Activity Statement (http://www.w3.org/2001/sw/Activity), Group Charter (http://www.w3.org/2002/11/swv2/charters/RDFCoreWGCharter)) for publication on 10 February 2004.

本文档是一套文档系列 (http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-Introduction)中的一份,该文档系列 (http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-Introduction)共六份,他们分别是:入门 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/)概念 (http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/)语法 (http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/)语义 (http://www.w3.org/TR/2004/REC-rdf-mt-20040210/)词汇表 (http://www.w3.org/TR/2004/REC-rdf-schema-20040210/)测试用例 (http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/))之中的一份。该文档系列将替换原有的资源描述框架规范(Resource Description Framework specifications)、RDF的模型与语法 推荐标准 (http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/)RDF Schema 推荐标准 (http://www.w3.org/TR/2000/CR-rdf-schema-20000327/)。 本文档由RDF核心工作组(RDF Core Working Group) (http://www.w3.org/2001/sw/RDFCore/)制定,它是W3C语义网行动组(W3C Semantic Web Activity) (http://www.w3.org/2001/sw/)的一部分(行动组声明 (http://www.w3.org/2001/sw/Activity)工作组章程 (http://www.w3.org/2002/11/swv2/charters/RDFCoreWGCharter))的一部份,被定于在2004年2月10日发布。

Changes to this document since the Proposed Recommendation Working Draft are detailed in the change log.
自建议推荐标准以来的修改已被详细记录在更改日志中。

The public is invited to send comments to www-rdf-comments@w3.org (mailto:www-rdf-comments@w3.org) (archive (http://lists.w3.org/Archives/Public/www-rdf-comments/)) and to participate in general discussion of related technology on www-rdf-interest@w3.org (archive).
欢迎大家将意见发送至www-rdf-comments@w3.org (mailto:www-rdf-comments@w3.org)存档文件 (http://lists.w3.org/Archives/Public/www-rdf-comments/))并积极参与www-rdf-interest@w3.org (mailto:www-rdf-interest@w3.org)(存档文件 (http://lists.w3.org/Archives/Public/www-rdf-interest/))上的相关技术讨论。

A list of implementations (http://www.w3.org/2001/sw/RDFCore/impls) is available.
一个RDF的实现列表可通过http://www.w3.org/2001/sw/RDFCore/impls (http://www.w3.org/2001/sw/RDFCore/impls)获得。

The W3C maintains a list of any patent disclosures related to this work.
W3C维护着一个有关这项工作的已公开专利列表 (http://www.w3.org/2001/sw/RDFCore/ipr-statements)

This section describes the status of this document at the time of its publication.
本节描述了本文档在发布时的状态。本文档有可能被其他本文档所替代。W3C推荐标准及其他技术文档(technical document)的最新列表可从以下网址获得:http://www.w3.org/TR (http://www.w3.org/TR)

 Other documents may supersede this document. 

其他资料可能替代这份文献。
A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index (http://www.w3.org/TR/) at http://www.w3.org/TR/.
一份当前W3C的最新出版物的目录和这个技术报告的最新版本可以在W3C的技术报告网站的W3C technical reports 首页 (http://www.w3.org/TR/) ,在http://www.w3.org/TR/上找到。

目录


  1. 介绍(Introduction) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#intro)
  2. 关于资源的陈述(Making Statements About Resources) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#statements)
      2.1 基本概念(Basic Concepts) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts)
      2.2 RDF模型(The RDF Model) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfmodel)
      2.3 结构化属性值与空白节点(Structured Property Values and Blank Nodes) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties)
      2.4 类型文字(Typed Literals) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals)
      2.5 总结(Concepts Summary) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#conceptsummary)
  3. RDF/XML - 一种用于RDF的XML语法(An XML Syntax for RDF: RDF/XML) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml)
      3.1 基本原理(Basic Principles) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicprinciples)
      3.2 简化和组织RDF URIrefs(Abbreviating and Organizing RDF URIrefs) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)
      3.3 总结(RDF/XML Summary) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxmlsummary)
  4. 其它RDF表达能力(Other RDF Capabilities) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#othercapabilities)
      4.1 RDF容器(RDF Containers) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#containers)
      4.2 RDF集合(RDF Collections) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#collections)
      4.3 RDF具体化(RDF Reification) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#reification)
      4.4 关于结构化值(rdf:value)的更多信息(More on Structured Values: rdf:value) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfvalue)
      4.5 XML文字(Literal)(XML Literals) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#xmlliterals)
  5. RDF Schema - 定义RDF的词汇表(Defining RDF Vocabularies: RDF Schema) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)
      5.1 描述类(Class)(Describing Classes) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#schemaclasses)
      5.2 描述属性(Property)(Describing Properties) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#properties)
      5.3 理解RDF Schema声明(Interpreting RDF Schema Declarations) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#interpretingschema)
      5.4 其它关于Schema的信息(Other Schema Information) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#otherschema)
      5.5 更丰富的Schema语言(Richer Schema Languages) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)
  6. 一些RDF的应用:具体领域中的RDF(Some RDF Applications: RDF in the Field) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#applications)
      6.1 都柏林核心元数据倡议(Dublin Core Metadata Initiative) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#dublincore)
      6.2 PRISM (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#prism)
      6.3 XPackage (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#xpackage)
      6.4 RSS 1.0:RDF站点汇总(RSS 1.0: RDF Site Summary) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rss)
      6.5 CIM/XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#cimxml)
      6.6 基因本体协会(Gene Ontology Consortium) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#geneont)
      6.7 描述设备性能与用户偏好(Describing Device Capabilities and User Preferences) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#devcap)
  7. RDF规范的其它部分(Other Parts of the RDF Specification) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#otherparts)
      7.1 RDF语义(RDF Semantics) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#semantics)
      7.2 测试用例(Test Cases) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#testcases)
  8. 参考文献(References) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#references)
      8.1 规范性参考文献(Normative References) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#normative-references)
      8.2 参考性资料(Informational References) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#informational-references)
  9. 致谢(Acknowledgments) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#acknowledgements)


附录


  A. 关于URI的更多信息(More on Uniform Resource Identifiers (URIs)) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers)
  B. 关于XML的更多信息(More on the Extensible Markup Language (XML)) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)
  C. 改动记录(Changes) (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#changes)




1. 介绍(Introduction)

The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web. It is particularly intended for representing metadata about Web resources, such as the title, author, and modification date of a Web page, copyright and licensing information about a Web document, or the availability schedule for some shared resource. However, by generalizing the concept of a "Web resource", RDF can also be used to represent information about things that can be identified on the Web, even when they cannot be directly retrieved on the Web. Examples include information about items available from on-line shopping facilities (e.g., information about specifications, prices, and availability), or the description of a Web user's preferences for information delivery.

资源描述框架(Resource Description Framework, 简称 RDF)是一个用于表达关于万维网(World Wide Web)上的资源信息的语言. 它专门用于表达关于Web资源的元数据, 比如Web页面的标题、作者和修改时间,Web文档的版权和许可信息,某个共享资源的可用时间表等。然而,将“Web资源(Web resource)”这一概念一般化后,RDF可被用于表达关于任何在Web上可被标识的事物的信息,即使有时不能直接从Web上获取。比如关于一个在线购物机构的某项产品的信息(例如关于规格、价格和可用性信息),或者是关于一个Web用户在信息递送方面的偏好的描述。

RDF is intended for situations in which this information needs to be processed by applications, rather than being only displayed to people. RDF provides a common framework for expressing this information so it can be exchanged between applications without loss of meaning. Since it is a common framework, application designers can leverage the availability of common RDF parsers and processing tools. The ability to exchange information between different applications means that the information may be made available to applications other than those for which it was originally created.

RDF用于信息需要被应用程序处理的场合而不是仅仅显示给人观看。RDF提供了一种用于表达这一信息、并使其能在应用程序间交换而不丧失语义的通用框架。既然是通用框架,应用程序设计者可以利用现成的通用RDF解析器(RDF parser)以及通用处理工具。能够在不同的应用程序间交换信息意味对于那些并非信息最初创建者的应用程序也可利用这些信息。

RDF is based on the idea of identifying things using Web identifiers (called Uniform Resource Identifiers, or URIs), and describing resources in terms of simple properties and property values. This enables RDF to represent simple statements about resources as a graph of nodes and arcs representing the resources, and their properties and values. To make this discussion somewhat more concrete as soon as possible, the group of statements "there is a Person identified by http://www.w3.org/People/EM/contact#me, whose name is Eric Miller, whose email address is em@w3.org, and whose title is Dr." could be represented as the RDF graph in Figure 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1):

RDF基于这样的思想:使用Web标识符(称作统一资源标识符Uniform Resource IdentifiersURIs)来标识事物,用简单的属性(property)及属性值来描述资源。这使得RDF可以将一个或多个关于资源的简单陈述表示为由结点和弧组成的图(graph),其中的结点和弧代表资源、属性和属性值。为了让讨论显得尽量具体一些,下面的这组陈述“有一个人由http://www.w3.org/People/EM/contact#me 所标识, 他的名字是Eric Miller, 他的电子邮件地址是em@w3.org,他的头衔是Dr.”可以表示为图1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1)所示的图:

fig1dec16.png 图1:一个描述Eric Miller的RDF图

Figure 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1) illustrates that RDF uses URIs to identify:

图1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1)展示了RDF用URIs来标识:

RDF also provides an XML-based syntax (called RDF/XML) for recording and exchanging these graphs. Example 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example1) is a small chunk of RDF in RDF/XML corresponding to the graph in Figure 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1):

RDF提供了一种基于XML的语法(称为RDF/XML)用于保存和交换RDF图。图1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1)所示的RDF用RDF/XML来书写的话就像下面的例1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example1)这样:

例1:一段描述Eric Miller的RDF/XML

 <?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#">
<contact:Person rdf:about="http://www.w3.org/People/EM/contact#me">
<contact:fullName>Eric Miller</contact:fullName>
<contact:mailbox rdf:resource="mailto:em@w3.org"/>
<contact:personalTitle>Dr.</contact:personalTitle>
</contact:Person>
</rdf:RDF>

Note that this RDF/XML also contains URIs, as well as properties like mailbox and fullName (in an abbreviated form), and their respective values em@w3.org, and Eric Miller.

注意:上述RDF/XML也包含URIs,同样地还包含简略形式的属性(比如mailbox和fullName)及各个属性的值(em@w3.org和Eric Miller)。

Like HTML, this RDF/XML is machine processable and, using URIs, can link pieces of information across the Web. However, unlike conventional hypertext, RDF URIs can refer to any identifiable thing, including things that may not be directly retrievable on the Web (such as the person Eric Miller). The result is that in addition to describing such things as Web pages, RDF can also describe cars, businesses, people, news events, etc. In addition, RDF properties themselves have URIs, to precisely identify the relationships that exist between the linked items.

和HTML一样,RDF/XML也可被机器处理,使用URIs,可以链接Web上的各类信息。然而与传统超文本不同,RDF URIs可以引用任何可标识的事物,包括那些不能直接从Web上获取的事物(比如Eric Miller这个人)。结果是,RDF除了描述网页这类事物以外,还可以描述汽车,商业活动,人类,新闻事件等等。此外,RDF中属性本身拥有URIs,用来准确标识被链接项目之间的关系。

The following documents contribute to the specification of RDF:

下列文档都属于RDF规范的一部分:

This Primer is intended to provide an introduction to RDF and describe some existing RDF applications, to help information system designers and application developers understand the features of RDF and how to use them. In particular, the Primer is intended to answer such questions as:

本文档旨在提供一个关于RDF的介绍,并描述一些已有的RDF应用,帮助信息系统设计者及应用程序开发者理解RDF的特性和如何使用这些特性。特别地,本文档旨在对下列这类问题做出回答:

  • What does RDF look like?
  • RDF看起来是怎样的?
  • What information can RDF represent?
  • RDF可以表达什么信息?
  • How is RDF information created, accessed, and processed?
  • RDF信息是如何被创建、访问和处理的?
  • How can existing information be combined with RDF?
  • 现有信息如何与RDF结合?

The Primer is a non-normative document, which means that it does not provide a definitive specification of RDF. The examples and other explanatory material in the Primer are provided to help readers understand RDF, but they may not always provide definitive or fully-complete answers. In such cases, the relevant normative parts of the RDF specification should be consulted. To help in doing this, the Primer describes the roles these other documents play in the complete specification of RDF, and provides links pointing to the relevant parts of the normative specifications, at appropriate places in the discussion.

本文档是一个非规范性(non-normative)文档,也就是说它并不是RDF的权威性规范。本文档中的例子和其他解释性资料用于帮助读者理解RDF,但是它们并不总是能提供权威或充分完善的回答。在这些情况下,请参考RDF规范中相关的规范性文档。为此,本文档描述了RDF规范中的其他文档所担任的角色,并在适当的地方提供了指向规范性文档中相关部分的链接。

It should also be noted that these RDF documents update and clarify previously-published RDF specifications, the Resource Description Framework (RDF) Model and Syntax Specification (http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/) [RDF-MS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdfms)] and the Resource Description Framework (RDF) Schema Specification 1.0 (http://www.w3.org/TR/2000/CR-rdf-schema-20000327/) [RDF-S (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-s)]. As a result, there have been some changes in terminology, syntax, and concepts. This Primer reflects the newer set of RDF specifications given in the bulleted list of RDF documents cited above. Hence, readers familiar with the older specifications, and with earlier tutorial and introductory articles based on them, should be aware that there may be differences between the current specifications and those previous documents. The RDF Issue Tracking (http://www.w3.org/2000/03/rdf-tracking/) document [RDFISSUE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-issue)] can be consulted for a list of issues raised concerning the previous RDF specifications, and their resolution in the current specifications.

需要注意的是,上述RDF文档更新并更清晰地解释了先前发布的一些RDF规范,资源描述框架(RDF)的模型和语法规范 (http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/) [RDF-MS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdfms)]和资源描述框架模式(RDF Schema)规范1.0 (http://www.w3.org/TR/2000/CR-rdf-schema-20000327/)[RDF-S (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-s)]。所以,一些术语、语法和概念已经稍有变化。本文档反映的是在上面的列表中给出的新版本RDF规范。因此,对于熟悉旧规范或基于旧规范的教程、入门读物的读者,应留意当前版本的规范与先前版本的一些差异。关于先前版本的RDF中出现的一些问题以及它们在当前版本中的解决方案的列表,请参见[http://www.w3.org/2000/03/rdf-tracking/ RDF问题跟踪(Issue Tracking)。


2. Making Statements About Resources

2. 关于资源的陈述

RDF is intended to provide a simple way to make statements about Web resources, e.g., Web pages. This section describes the basic ideas behind the way RDF provides these capabilities (the normative specification describing these concepts is RDF Concepts and Abstract Syntax (http://www.w3.org/TR/rdf-concepts/) [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]).
RDF是用以提供一种发表关于Web资源(如网页)的陈述的简单方法的。这部分描述了RDF提供这些能力(描述这些概念的规范标准就是RDF概念和抽象语法 (http://www.w3.org/TR/rdf-concepts/)[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)])背后的基本思想。

2.1 Basic Concepts

2.1 基本概念


Imagine trying to state that someone named John Smith created a particular Web page. A straightforward way to state this in a natural language such as English would be in the form of a simple statement such as:
试想一下这样的情形:有一个叫John Smith的人创建了某个网页。如果用自然语言(比如英语)来陈述该事实,一种简洁明了的方式是采用下面这种简单陈述的形式:

http://www.example.org/index.html has a creator whose value is John Smith

Parts of this statement are emphasized to illustrate that, in order to describe the properties of something, there need to be ways to name, or identify, a number of things:
强调该陈述的各个部分是为了强调:为了描述某事物的特性,需要某些方法来命名或标识多种事物:

  • the thing the statement describes (the Web page, in this case)
  • 陈述所描述的事物(譬如此例中John Smith所创建的网页)
  • a specific property (creator, in this case) of the thing the statement describes
  • 陈述所描述事物的具体属性(property)(譬如本例中的creator)
  • the thing the statement says is the value of this property (who the creator is), for the thing the statement describes
  • 陈述所描述的作为该属性(陈述所描述事物对应的)的值的事物(如这个网页的creator是谁)。

In this statement, the Web page's URL (Uniform Resource Locator) is used to identify it. In addition, the word "creator" is used to identify the property, and the two words "John Smith" to identify the thing (a person) that is the value of this property.
在上面的陈述中,网页用它的URL(Uniform Resource Locator,统一资源定位符)来标识。另外,单词“creator”被用来标识事物的属性(property),短语“John Smith”被用来标识作为属性(property)的值的事物(一个人)。

Other properties of this Web page could be described by writing additional English statements of the same general form, using the URL to identify the page, and words (or other expressions) to identify the properties and their values. For example, the date the page was created, and the language in which the page is written, could be described using the additional statements:
该网页的其他属性(property)可以通过书写其他具有相同形式的英文陈述来描述:用URL标识该网页,用单词(或其他表达式)来标识网页的属性(properties)及其值。例如:这个网页的创建日期和所用的语种可以由下列陈述来描述:

http://www.example.org/index.html has a creation-date whose value is August 16, 1999
http://www.example.org/index.html has a language whose value is English

RDF is based on the idea that the things being described have properties (http://www.w3.org/TR/rdf-concepts/#dfn-property) which have values, and that resources can be described by making statements, similar to those above, that specify those properties and values. RDF uses a particular terminology for talking about the various parts of statements. Specifically, the part that identifies the thing the statement is about (the Web page in this example) is called the subject (http://www.w3.org/TR/rdf-concepts/#dfn-subject). The part that identifies the property or characteristic of the subject that the statement specifies (creator, creation-date, or language in these examples) is called the predicate (http://www.w3.org/TR/rdf-concepts/#dfn-predicate), and the part that identifies the value of that property is called the object (http://www.w3.org/TR/rdf-concepts/#dfn-object). So, taking the English statement
RDF是基于这一思想的:被描述的事物具有一些属性 (http://www.w3.org/TR/rdf-concepts/#dfn-property) (properties),而这些属性各有其值(values);对资源的描述可以通过对它作出指定了上述属性及值的陈述(statement)来进行(就像上面例子中的那样)。RDF用一套特定的术语来表达陈述中的各个部分。确切地说,关于事物(譬如上例中的网页)的陈述中用于识别事物的那部分就叫做主体 (http://www.w3.org/TR/rdf-concepts/#dfn-subject),而用于区分陈述对象主语的各个不同属性(譬如:作者,创建日期,语种等等)的那部分就叫做谓词 (http://www.w3.org/TR/rdf-concepts/#dfn-predicate),陈述中用于区分各个属性的值的那部分叫做客体 (http://www.w3.org/TR/rdf-concepts/#dfn-object)。因此,考虑英文陈述:

http://www.example.org/index.html has a creator whose value is John Smith

the RDF terms for the various parts of the statement are:
这个陈述里的不同部分用RDF术语来说就是:

However, while English is good for communicating between (English-speaking) humans, RDF is about making machine-processable statements. To make these kinds of statements suitable for processing by machines, two things are needed:
正如英语是作为(用英语沟通的)人们之间很好沟通工具一样,RDF是用来做出机器可处理的声明的工具。那么,如果想做出这种适合机器处理的声明,还需要两件事:

  • a system of machine-processable identifiers for identifying a subject, predicate, or object in a statement without any possibility of confusion with a similar-looking identifier that might be used by someone else on the Web.
  • 一个可用来区分标识一个陈述中的主体,谓词,客体的机器可处理的标识符系统,同时这个标识符系统不会和其他人可能在Web上使用的相似的标识符系统混淆;
  • a machine-processable language for representing these statements and exchanging them between machines.
  • 一种用以表示这些陈述并让这些陈述可在机器间交流的机器可处理的语言;

Fortunately, the existing Web architecture provides both these necessary facilities.
幸运地是,现有的Web体系结构提供了这两个必需的工具。

As illustrated earlier, the Web already provides one form of identifier, the Uniform Resource Locator (URL). A URL was used in the original example to identify the Web page that John Smith created. A URL is a character string that identifies a Web resource by representing its primary access mechanism (essentially, its network "location"). However, it is also important to be able to record information about many things that, unlike Web pages, do not have network locations or URLs.
正如前面所描述的,Web已经提供了一种形式的标识符-URL(Uniform Resource Locator,同一资源定位符)。在第一个例子中,就采用了一个URL来标识John Smith所创建的网页。URL是标识(identify)Web资源(Web resource)的字符串,这是通过标识资源的首选访问机制来实现的(本质上,即资源的网络“位置”)。然而,对于许多不具有网络地址或URL的资源(这一点与网页是不同的),能够记录关于它们的信息也是同等重要。

The Web provides a more general form of identifier for these purposes, called the Uniform Resource Identifier (http://www.isi.edu/in-notes/rfc2396.txt) (URI). URLs are a particular kind of URI. All URIs share the property that different persons or organizations can independently create them, and use them to identify things. However, URIs are not limited to identifying things that have network locations, or use other computer access mechanisms. In fact, a URI can be created to refer to anything that needs to be referred to in a statement, including
Web提供了一套更通用的标识符形式,称为统一资源标识符 (http://www.isi.edu/in-notes/rfc2396.txt)(Uniform Resource Identifier,URI)。URL是URI的一种具体形式。所有URI都具有共同的特征:即不同的人或组织可以彼此独立地创建并使用URI来标识事物。但是,URI并不局限于标识具有网络地址或其他计算机访问机制的资源。实际上,我们可以创建URI来引用陈述中需要被标识的任何资源,包括:

  • network-accessible things, such as an electronic document, an image, a service (e.g., "today's weather report for Los Angeles"), or a group of other resources.
  • 网络可访问资源,譬如,一份电子文档、一个图片、一个服务(例如,“洛山矶的今日天气预报”)或是一组其他的资源;
  • things that are not network-accessible, such as human beings, corporations, and bound books in a library.
  • 非网络可访问资源,譬如,人、公司、在图书馆装订成册的书籍;
  • abstract concepts that do not physically exist, such as the concept of a "creator".
  • 不物理存在的抽象概念,如“作者(creator)”这个概念;

Because of this generality, RDF uses URIs as the basis of its mechanism for identifying the subjects, predicates, and objects in statements. To be more precise, RDF uses URI references (http://www.w3.org/TR/rdf-concepts/#dfn-URI-reference) [URIS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uri)]. A URI reference (or URIref) is a URI, together with an optional fragment identifier at the end. For example, the URI reference http://www.example.org/index.html#section2 consists of the URI http://www.example.org/index.html and (separated by the "#" character) the fragment identifier Section2. RDF URIrefs can contain Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] characters (see [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]), allowing many languages to be reflected in URIrefs. RDF defines a resource as anything that is identifiable by a URI reference, so using URIrefs allows RDF to describe practically anything, and to state relationships between such things as well. URIrefs and fragment identifiers are discussed further in Appendix A (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers), and in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)].

由于上述通用性,RDF用URIs作为其标识机制(用于标识陈述中的主体、谓词和客体)的基础。更准确地说,RDF使用的是URI引用(URI references) (http://www.w3.org/TR/rdf-concepts/#dfn-URI-reference) [URIS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uri)]。一个URI引用(或“URIref”)是一个在尾部附加了可选的“片段识别符(fragment identifier)”的URI。比如,URI引用(URIref) http://www.example.org/index.html# 由URI http://www.example.org/index.html 和(由符号#分隔的)的section2 (片段标识符)组成。RDF URIrefs可以包含Unicode[UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)]字符(参见[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]),这就允许在URIrefs中使用多种语言。RDF将“资源(resource)”定义任何可被为URI引用(URIref)标识的事物。因此,使用URIrefs,RDF实际上可以描述任何事物,并陈述这些事物之间的关系。URIrefs和片段标识符将在Appendix A (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers)[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]中作进一步的阐述。

To represent RDF statements in a machine-processable way, RDF uses the Extensible Markup Language (http://www.w3.org/TR/2000/REC-xml-20001006) [XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)]. XML was designed to allow anyone to design their own document format and then write a document in that format. RDF defines a specific XML markup language, referred to as RDF/XML, for use in representing RDF information, and for exchanging it between machines. An example of RDF/XML was given in Section 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#intro). That example (Example 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example1)) used tags such as <contact:fullName> and <contact:personalTitle> to delimit the text content Eric Miller and Dr., respectively. Such tags allow programs written with an understanding of what the tags mean to properly interpret that content. Both XML content and (with certain exceptions) tags can contain Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] characters, allowing information from many languages to be directly represented. Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents) provides further background on XML in general. The specific RDF/XML syntax used for RDF is described in more detail in Section 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml), and is normatively defined in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]

为了用一种机器可处理的(machine-processable)方式来表示RDF陈述(RDF statements),RDF采用了可扩展标记语言(Extensible Markup Language) (http://www.w3.org/TR/2000/REC-xml-20001006)[XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)]。XML被设计成允许任何人来设计他们自己的文档格式,并可用这种格式书写文档。RDF定义了一个特殊的XML标记语言(称为RDF/XML)来表示RDF信息和在机器间交换这些信息。在第一节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#intro)中有一个关于RDF/XML的例子。这个例子(例 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example1) )使用了一些诸如<contact:fullName>和<contact:personalTitle>这样的标签来相应地区分Eric Miller和Dr这些文本内容。这些标签能让那些理解这些标签含义的程序正确地解释文本内容。XML的内容和标签(除了一些特例)能够包含统一字符编码[UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] 的字符,这就允许了来自各种语言的信息可以被直接显示出来。附录 B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)大体上给出了关于XML进一步的背景知识。关于RDF的RDF/XML专用语法在第三节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml)中有更详细的描述,且定义在规范[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]中。

2.2 The RDF Model

2.2 RDF模型


Section 2.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts) has introduced RDF's basic statement concepts, the idea of using URI references to identify the things referred to in RDF statements, and RDF/XML as a machine-processable way to represent RDF statements. With that background, this section describes how RDF uses URIs to make statements about resources. The introduction said that RDF was based on the idea of expressing simple statements about resources, where each statement consists of a subject, a predicate, and an object. In RDF, the English statement:
2.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts) 中阐述了以下内容:RDF陈述的基本概念,用URIref标识RDF陈述中涉及的事物的方法,以及用RDF/XML作为一种机器可处理的方式来表示RDF陈述。基于这些铺垫,这节将描述RDF是如何用URIs发表关于资源的陈述的。在介绍(第1节)中已经说明了,RDF的基本思想是:表达简单的资源陈述,其中每个陈述都是由主体(subject),谓词(predicate),客体(object)组成的。在RDF中,如下的英文陈述:


http://www.example.org/index.html has a creator whose value is John Smith

could be represented by an RDF statement having:

http://www.example.org/index.html 有一个作者其值为 John Smith

可以由RDF陈述来表示:



Note how URIrefs are used to identify not only the subject of the original statement, but also the predicate and object, instead of using the words "creator" and "John Smith", respectively (some of the effects of using URIrefs in this way will be discussed later in this section).
请注意是如何用URIrefs不仅标识了陈述的主体,还标识了谓词和客体,而不分别用单词“作者”和“John Smith”(这样使用URIrefs的效果将会在这节的稍后部分做论述)。


RDF models statements as nodes and arcs in a graph. RDF's graph model (http://www.w3.org/TR/rdf-concepts/#section-data-model) is defined in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]. In this notation, a statement is represented by:
RDF把图中的节点和弧作为陈述的模型。RDF的图模型 (http://www.w3.org/TR/rdf-concepts/#section-data-model)已在[RDF概念 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]里有过详细说明。在这个表示法(图示法)中,一个陈述可表示为:



  • a node for the subject
  • 一个表示主体的节点;
  • a node for the object
  • 一个表示客体的节点;
  • an arc for the predicate, directed from the subject node to the object node.
  • 一个由主体节点指向客体节点的表示谓词的弧;


So the RDF statement above would be represented by the graph shown in Figure 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure2):
因此以上的RDF陈述可以描述为如图2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure2)所示的那样:
fig2dec16.png
Figure 2: A Simple RDF Statement
图2:一个简单的RDF陈述
Groups of statements are represented by corresponding groups of nodes and arcs. So, to reflect the additional English statements

http://www.example.org/index.html has a creation-date whose value is August 16, 1999
http://www.example.org/index.html has a language whose value is English

in the RDF graph, the graph shown in Figure 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) could be used (using suitable URIrefs to name the properties "creation-date" and "language"):

一组陈述相应地被一组节点和弧表示。所以,为了在RDF中表示其他的英文陈述: http://www.example.org/index.html有一个 creation-date 属性,其值为 August 16, 1999
http://www.example.org/index.html 有一个 language 属性,其值为English
可以用图3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3)所示的图(用合适的URIrefs标识属性"creation-date" 和 "language"):
fig3nov19.png
Figure 3: Several Statements About the Same Resource
图3:关于同一资源的多个陈述:


Figure 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) illustrates that objects in RDF statements may be either URIrefs, or constant values (called literals (http://www.w3.org/TR/rdf-concepts/#section-Literals)) represented by character strings, in order to represent certain kinds of property values. (In the case of the predicate http://purl.org/dc/elements/1.1/language the literal is an international standard two-letter code for English.) Literals may not be used as subjects or predicates in RDF statements. In drawing RDF graphs, nodes that are URIrefs are shown as ellipses, while nodes that are literals are shown as boxes. (The simple character string literals used in these examples are called plain literals (http://www.w3.org/TR/rdf-concepts/#dfn-plain-literal), to distinguish them from the typed literals (http://www.w3.org/TR/rdf-concepts/#dfn-typed-literal) to be introduced in Section 2.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals). The various kinds of literals that can be used in RDF statements are defined in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]. Both plain and typed literals can contain Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] characters, allowing information from many languages to be directly represented.)
图3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) 说明了RDF陈述中的客体可以是URIrefs,也可以是常量值(称作文字),即用于表示某种属性值的字符串。

图 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3)显示了:为了表示多种类型的属性值,RDF陈述中的客体可能是URIrefs或字符串表示的常数(称为文字 (http://www.w3.org/TR/rdf-concepts/#section-Literals),literal)。 (比如在以“http://purl.org/dc/elements/1.1/language”为谓词的例子中,那个文字就是一个英文的国际标准双字母码。) 在RDF的陈述中,文字(literal)可能不被用作主体或者谓词。在画RDF图时,节点为URIrefs的用椭圆来表示,而节点为文字的则用方框来表示(这个例子中的简单字符串文字叫做平凡文字 (http://www.w3.org/TR/rdf-concepts/#dfn-plain-literal),它与将会在2.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals)做介绍的类型文字 (http://www.w3.org/TR/rdf-concepts/#dfn-typed-literal)(typed literals)是不同的。在[[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]中详细说明了各种不同的可用于RDF陈述中的文字。平凡文字和类型文字都能容许采统一字符编码[UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)]的字符,即允许信息用多种语言描述。)
Sometimes it is not convenient to draw graphs when discussing them, so an alternative way of writing down the statements, called triples (http://www.w3.org/TR/rdf-concepts/#dfn-rdf-triple), is also used. In the triples notation, each statement in the graph is written as a simple triple of subject, predicate, and object, in that order. For example, the three statements shown in Figure 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) would be written in the triples notation as:
有时在讨论它们的时候画图不太方便,因此也会用到一个替代的书写陈述的方法,称为三元组 (http://www.w3.org/TR/rdf-concepts/#dfn-rdf-triple)。在三元组表示法中,图中的每个陈述都可以写成一个依次为主体,谓词,客体的三元组。如图3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3)所表示的陈述用三元组表示法来写就是:
<http://www.example.org/index.html&gt; <http://purl.org/dc/elements/1.1/creator&gt; <http://www.example.org/staffid/85740&gt; .

<http://www.example.org/index.html&gt; <http://www.example.org/terms/creation-date&gt; "August 16, 1999" .

<http://www.example.org/index.html&gt; <http://purl.org/dc/elements/1.1/language&gt; "en" .


Each triple corresponds to a single arc in the graph, complete with the arc's beginning and ending nodes (the subject and object of the statement). Unlike the drawn graph (but like the original statements), the triples notation requires that a node be separately identified for each statement it appears in. So, for example, http://www.example.org/index.html appears three times (once in each triple) in the triples representation of the graph, but only once in the drawn graph. However, the triples represent exactly the same information as the drawn graph, and this is a key point: what is fundamental to RDF is the graph model of the statements. The notation used to represent or depict the graph is secondary.
每一个三元组均对应于图中的一条弧,且这个弧的起始节点和终止节点分别是陈述中的主体和客体。和图形表示法不同(倒像是原先的陈述),三元组表示法要求一个节点在它出现的每个陈述中都要有标识。因此,例如, “http://www.example.org/index.html” 在三元组表示法中共出现了三次(在每个三元组中均出现一次),而在图形表示法中只出现了一次。但是,三元组表示法和图示法描述了完全相同的信息,这揭示了一个要点:RDF的基础是陈述的图模型,而用于表示或描述这个图的表示法则是次要的。
The full triples notation requires that URI references be written out completely, in angle brackets, which, as the example above illustrates, can result in very long lines on a page. For convenience, the Primer uses a shorthand way of writing triples (the same shorthand is also used in other RDF specifications). This shorthand substitutes an XML qualified name (or QName) without angle brackets as an abbreviation for a full URI reference (QNames are discussed further in Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)). A QName contains a prefix that has been assigned to a namespace URI, followed by a colon, and then a local name. The full URIref is formed from the QName by appending the local name to the namespace URI assigned to the prefix. So, for example, if the QName prefix foo is assigned to the namespace URI http://example.org/somewhere/, then the QName foo:bar is shorthand for the URIref http://example.org/somewhere/bar. Primer examples will also use several "well-known" QName prefixes (without explicitly specifying them each time), defined as follows:

完全的三元组表示法要求写出完整的URIref(括在尖刮号中),正如上面例子那样,所以导致了在一页中有很多长句。为方便起见,本文档用一种简写法(也在其他的RDF规范里使用)来书写三元组。在这种简写法中, 一个不用尖刮号的XML限定名(QName)作为一个完整的URIref 的缩写形式 (QName 会在附录 B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)进一步讨论)。一个QName包括一个被赋为命名空间URI的前缀,其后是一个冒号,然后是个"局部名称"(local name)。由QName可以生成完整的URIref,即将局部名称添加到已经赋了命名空间URI的前缀。因此,例如,如果将命名空间URI“http://example.org/somewhere/”赋值给QName前缀foo,那么QName “foo:bar”就是URIref“http://example.org/somewhere/bar”的缩写。在本文档的例子中也会用一些“公认的”QName前缀(这些前缀无需说明就可使用),定义如下:

prefix rdf:, namespace URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#
prefix rdfs:, namespace URI: http://www.w3.org/2000/01/rdf-schema#
prefix dc:, namespace URI: http://purl.org/dc/elements/1.1/
prefix owl:, namespace URI: http://www.w3.org/2002/07/owl#
prefix ex:, namespace URI: http://www.example.org/ (or http://www.example.com/)
prefix xsd:, namespace URI: http://www.w3.org/2001/XMLSchema#

前缀 rdf:, 命名空间 URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#
前缀 rdfs:, 命名空间 URI: http://www.w3.org/2000/01/rdf-schema#
前缀 dc:, 命名空间 URI: http://purl.org/dc/elements/1.1/
前缀 owl:, 命名空间 URI: http://www.w3.org/2002/07/owl#
前缀 ex:, 命名空间 URI: http://www.example.org/ (or http://www.example.com/)
前缀 xsd:, 命名空间 URI: http://www.w3.org/2001/XMLSchema#

Obvious variations on the "example" prefix ex: will also be used as needed in the examples, for instance,
显然,“example”的前缀 “ex:”的变形在需要时也会用在示例中,例如:

prefix exterms:, namespace URI: http://www.example.org/terms/ (for terms used by an example organization),
prefix exstaff:, namespace URI: http://www.example.org/staffid/ (for the example organization's staff identifiers),
prefix ex2:, namespace URI: http://www.domain2.example.org/ (for a second example organization), and so on.

前缀 exterms:, 命名空间 URI: http://www.example.org/terms/ (作为示例的组织中的词汇),
前缀 exstaff:, 命名空间 URI: http://www.example.org/staffid/ (作为示例的组织中的雇员标识),
前缀 ex2:, 命名空间 URI: http://www.domain2.example.org/ (作为示例的第二个组织中的词汇), and so on.

Using this new shorthand, the previous set of triples can be written as:
用这种简写法,先前的三元组可以写成:

ex:index.html dc:creator exstaff:85740 .
ex:index.html exterms:creation-date "August 16, 1999" .
ex:index.html dc:language "en" .

Since RDF uses URIrefs instead of words to name things in statements, RDF refers to a set of URIrefs (particularly a set intended for a specific purpose) as a vocabulary. Often, the URIrefs in such vocabularies are organized so that they can be represented as a set of QNames using a common prefix. That is, a common namespace URIref will be chosen for all terms in a vocabulary, typically a URIref under the control of whoever is defining the vocabulary. URIrefs that are contained in the vocabulary are formed by appending individual local names to the end of the common URIref. This forms a set of URIrefs with a common prefix. For instance, as illustrated by the previous examples, an organization such as example.org might define a vocabulary consisting of URIrefs starting with the prefix http://www.example.org/terms/ for terms it uses in its business, such as "creation-date" or "product", and another vocabulary of URIrefs starting with http://www.example.org/staffid/ to identify its employees. RDF uses this same approach to define its own vocabulary of terms with special meanings in RDF. The URIrefs in this RDF vocabulary all begin with http://www.w3.org/1999/02/22-rdf-syntax-ns#, conventionally associated with the QName prefix rdf:. The RDF Vocabulary Description Language (described in Section 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)) defines an additional set of terms having URIrefs that begin with http://www.w3.org/2000/01/rdf-schema#, conventionally associated with the QName prefix rdfs:. (Where a specific QName prefix is commonly used in connection with a given set of terms in this way, the QName prefix itself is sometimes used as the name of the vocabulary. For example, someone might refer to "the rdfs: vocabulary".)

因为RDF用URIref替代词语来命名陈述中的事物,RDF称一个URIref的集合(特别是为了某个目的集合)为词汇表(vocabulary)。通常,这些词汇表中的URIrefs被组织为一个有相同前缀的QName的集合。也就是说,一个词汇表中的所有术语都有一个相同的命名空间URIref,通常这个URIref(无论是谁控制)定义了这个词汇表。 包含在词汇表里的URIrefs是通过在公用的URIref的末端加上局部名称形成的,这样就构成了一套有着公用前缀的URIrefs。譬如:正像前面的例子展示的那样,一个组织,比方说是example.org,可能定义一个由前缀全部为http://www.example.org/terms/ 的URIrefs构成的词汇表,用来表示这个组织在业务中用到的术语(例如:“创建日期”,“产品”等),同时也会定义一个全部由http://www.example.org/staffid/ 开头的URIrefs词汇表来标识这个组织的雇员。RDF用相同的方法来定义它自己的术语的词汇表,这些术语在在RDF中有着特定的含义。RDF 词汇表中的 URIrefs 都以 “http://www.w3.org/1999/02/22-rdf-syntax-ns# ”开头,通常情况下,其QName用前缀“rdf:”来表示。RDF词汇描述语言(将会在 第五节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)做阐述)定义了另一套都以http://www.w3.org/2000/01/rdf-schema# 开头的URIrefs的术语集合,其QName用前缀“rdfs:”来表示。(当一个特定的QName前缀以这种方式与一个已给定的术语集相关联的时候,那么这个QName前缀有时会用以作为这个词汇表的名称,比如,有人可能说“rdfs: 词汇”)。

Using common URI prefixes provides a convenient way to organize the URIrefs for a related set of terms. However, this is just a convention. The RDF model only recognizes full URIrefs; it does not "look inside" URIrefs or use any knowledge about their structure. In particular, RDF does not assume there is any relationship between URIrefs just because they have a common leading prefix (see Appendix A (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers) for further discussion). Moreover, there is nothing that says that URIrefs with different leading prefixes cannot be considered part of the same vocabulary. A particular organization, process, tool, etc. can define a vocabulary that is significant for it, using URIrefs from any number of other vocabularies as part of its vocabulary.

使用公用的URI前缀提供了一种便捷的方法来组织一套相关的术语集URIrefs,然而,这仅仅只是一种约定。RDF模型只认可完整的URIrefs;它不会去看URIrefs的具体内容或使用任何关于它们结构的知识。特别地,RDF不会仅仅因为URIrefs有一个公用的前缀而认定这些URIrefs之间有联系(更深入的探讨请看附录A (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers) )。当 URIrefs 带有不同的前缀时,并没有规定说,这些URIrefs就不能被认为属于同一个词汇表。 某个特定的组织、过程(process)或者工具等可以根据自己的需要,来定义词汇。这些词汇的 URIrefs可以来自于任何其它的词汇,数目不受限制。


In addition, sometimes an organization will use a vocabulary's namespace URIref as the URL of a Web resource that provides further information about that vocabulary. For example, as noted earlier, the QName prefix dc: will be used in Primer examples, associated with the namespace URIref http://purl.org/dc/elements/1.1/. In fact, this refers to the Dublin Core vocabulary described in Section 6.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#dublincore). Accessing this namespace URIref in a Web browser will retrieve additional information about the Dublin Core vocabulary (specifically, an RDF schema). However, this is also just a convention. RDF does not assume that a namespace URI identifies a retrievable Web resource (see Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents) for further discussion).
另外,有时一个组织将使用词汇表的URIref命名空间用作是提供关于该词汇表的详细资料这种Web资源所在地的URL。例如:像著名的QName前缀dc: 将会在本文档的例子中用到,它是和命名空间URIref http://purl.org/dc/elements/1.1/ 相关联的。事实上,这指在6.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#dublincore)阐述的都柏林核心词汇表。通过在网页浏览器中访问这个URIref命名空间就能获得关于都柏林核心词汇表(明确地说,是一个RDF Schema)的其他一些信息。然而,这也仅仅只是一种约定。RDF不会认为每个URI命名空间都能确定一个可获取的Web资源(更深入的探讨请看附录B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents) )。


In the rest of the Primer, the term vocabulary will be used when referring to a set of URIrefs defined for some specific purpose, such as the set of URIrefs defined by RDF for its own use, or the set of URIrefs defined by example.org to identify its employees. The term namespace will be used only when referring specifically to the syntactic concept of an XML namespace (or in describing the URI assigned to a prefix in a QName).
在这个入门文档的其余部分里,当涉及到一些为特殊目而定义的一套URIref,比如供RDF自身的使用而定义的各种URIref ,或者是example.org定义的用来标识它雇员的一套URIref,时都将会用到术语“词汇表”。术语“命名空间”只是在特指XML命名空间这个语法概念的时候才会使用(或者用来描述 QName中的URI前缀)。

URIrefs from different vocabularies can be freely mixed in RDF graphs. For example, the graph in Figure 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) uses URIrefs from the exterms:, exstaff:, and dc: vocabularies. Also, RDF imposes no restrictions on how many statements using a given URIref as predicate can appear in a graph to describe the same resource. For example, if the resource ex:index.html had been created by the cooperative efforts of several staff members in addition to John Smith, example.org might have written the statements:
ex:index.html dc:creator exstaff:85740 .
ex:index.html dc:creator exstaff:27354 .
ex:index.html dc:creator exstaff:00816 .
在RDF图中可以自由混合来自不同词汇表的URIrefs。譬如:在图 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) 中用到了分别采用了exterms:,exstaff:,dc:词汇表的URIref。在RDF图中,RDF也没有限制能用多少个具有同一谓词URIref的陈述描述同一个资源。例如:如果资源ex:index.html是由约翰·史密斯和其他几名工作人员努力合作创造的话,那么example.org可能写以下陈述:
ex:index.html dc:creator exstaff:85740 .
ex:index.html dc:creator exstaff:27354 .
ex:index.html dc:creator exstaff:00816 .


These examples of RDF statements begin to illustrate some of the advantages of using URIrefs as RDF's basic way of identifying things. For instance, in the first statement, instead of identifying the creator of the Web page by the character string "John Smith", he has been assigned a URIref, in this case (using a URIref based on his employee number) http://www.example.org/staffid/85740 . An advantage of using a URIref in this case is that the identification of the statement's subject can be more precise. That is, the creator of the page is not the character string "John Smith", or any one of the thousands of people named John Smith, but the particular John Smith associated with that URIref (whoever created the URIref defines the association). Moreover, since there is a URIref to refer to John Smith, he is a full-fledged resource, and additional information can be recorded about him, simply by adding additional RDF statements with John's URIref as the subject. For example, Figure 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure4) shows some additional statements giving John's name and age.
这些RDF陈述的例子开始展现一些使用URIref作为RDF标识事物的基本方式的优势所在。譬如:在第一个陈述中,不用字符串“John Smith”来作为网页的制作者,而是把一个URIref(使用基于他的雇员号码的URIref)http://www.example.org/staffid/85740赋予给他。这样使用URIref的一个优点就是陈述主体可以被更加精确的标识出来。就是说,这个网页的制作者不是字符串“John Smith”,也不是数以千计的名叫John Smith的人中的一个,而是与那个URIref(且不管是谁创建了定义了这种关系的URIref)相关的那个特殊的John Smith。而且,因为一个指向John Smith的URIref,他就成为一个成熟的资源,并且仅仅通过增加其他主体为John的 URIref的RDF陈述,就可以记录他的一些其他信息。例如:图 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure4)展示了可给出关于John的姓名和年龄的一些陈述。


fig4dec16.png
Figure 4: More Information About John Smith
图4:更多关于John Smith的信息
These examples also illustrate that RDF uses URIrefs as predicates in RDF statements. That is, rather than using character strings (or words) such as "creator" or "name" to identify properties, RDF uses URIrefs. Using URIrefs to identify properties is important for a number of reasons. First, it distinguishes the properties one person may use from different properties someone else may use that would otherwise be identified by the same character string. For instance, in the example in Figure 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure4), example.org uses "name" to mean someone's full name written out as a character string literal (e.g., "John Smith"), but someone else may intend "name" to mean something different (e.g., the name of a variable in a piece of program text). A program encountering "name" as a property identifier on the Web (or merging data from multiple sources) would not necessarily be able to distinguish these uses. However, if example.org writes http://www.example.org/terms/name for its "name" property, and the other person writes http://www.domain2.example.org/genealogy/terms/name for hers, it is clear that there are distinct properties involved (even if a program cannot automatically determine the distinct meanings). Also, using URIrefs to identify properties enables the properties to be treated as resources themselves. Since properties are resources, additional information can be recorded about them (e.g., the English description of what example.org means by "name"), simply by adding additional RDF statements with the property's URIref as the subject.
这些例子也说明了RDF在RDF陈述中用URIref作为谓词。就是说,RDF使用URIrefs标识属性,而不是使用像“creator”或者“name”那样的字符串(或词组)。用URIref来标识属性的重要性是基于很多原因的。第一,它可以把一个人用的属性和其他人用的属性区别开来,尽管他们可能用相同的字符串来表示属性。例如:在图4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure4)中的例子,example.org使用"name"想要使写出的某人的全名作为一个字符串文字(譬如:“John Smith”),但是其他人可能想要使"name"代表某些不同的事物(譬如:在一个程序段中的变量名)。当一段程序遇到“name”作为一个Web上的属性标识符(或者当合并来自多个数据源的数据)时将不一定能区分这些使用方法。但是,如果example.org用“http://www.example.org/terms/name”当作它定义的“name”的值,并且其他人用“http://www.domain2.example.org/genealogy/terms/name”当作他们定义的“name”的值,那么显然不同的“name”包含着不同的值(即使一个程序不能自动确定它们的具体含义)。此外,使用URIrefs来区分属性能使属性被看成是资源本身。因为属性也是资源,仅仅通过增加主体为属性的URIref的RDF陈述,就能记录关于属性的信息(譬如:example.org 所用的“name”属性的含义的英文描述)。
Using URIrefs as subjects, predicates, and objects in RDF statements supports the development and use of shared vocabularies on the Web, since people can discover and begin using vocabularies already used by others to describe things, reflecting a shared understanding of those concepts. For example, in the triple
用URIref作为RDF陈述的主体,谓词,客体支持了Web上的共享词汇表的使用和发展,因为人们可以发现并开始使用已经在用的词汇表来描述事物,这反映了人们对那些概念的共享理解。例如:在三元组“ex:index.html dc:creator exstaff:85740 ”中:
ex:index.html dc:creator exstaff:85740 .


the predicate dc:creator, when fully expanded as a URIref, is an unambiguous reference to the "creator" attribute in the Dublin Core metadata attribute set (discussed further in Section 6.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#dublincore)), a widely-used set of attributes (properties) for describing information of all kinds. The writer of this triple is effectively saying that the relationship between the Web page (identified by http://www.example.org/index.html ) and the creator of the page (a distinct person, identified by http://www.example.org/staffid/85740 ) is exactly the concept identified by http://purl.org/dc/elements/1.1/creator. Another person familiar with the Dublin Core vocabulary, or who finds out what dc:creator means (say by looking up its definition on the Web) will know what is meant by this relationship. In addition, based on this understanding, people can write programs to behave in accordance with that meaning when processing triples containing the predicate dc:creator.
当谓词“dc:crearot”完全展开为一个URIref时,就明确的指向了Dublin Core元数据属性集(一个广泛使用的描述各种各样信息的一套属性集,将在6.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#dublincore)中做深入的讨论)中的“creator”的属性。这个三元组的作者有效地说明了网页(由http://www.example.org/index.html 所标识)和网页的作者(一个独一无二的人,由http://www.example.org/staffid/85740 所标识)之间的关系正是一个由http://purl.org/dc/elements/1.1/creator 标识的概念。另一个熟悉Dublin Core词汇的人,或是查明了“dc:creator”确切含义(通过在Web上查找的它的定义)的人,将会明白这个关系的含义。另外,在这种理解的基础上,在处理含有谓词“dc:creator”的三元组时,人们就能编写出行为与这个含义一致的程序来。

Of course, this depends on increasing the general use of URIrefs to refer to things instead of using literals; e.g., using URIrefs like exstaff:85740 and dc:creator instead of character string literals like John Smith and creator. Even then, RDF's use of URIrefs does not solve all identification problems because, for example, people can still use different URIrefs to refer to the same thing. For this reason, it is a good idea to try to use terms from existing vocabularies (such as the Dublin Core) where possible, rather than making up new terms that might overlap with those of some other vocabulary. Appropriate vocabularies for use in specific application areas are being developed all the time, as illustrated by the applications described in Section 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#applications). However, even when synonyms are created, the fact that these different URIrefs are used in the commonly-accessible "Web space" provides the opportunity both to identify equivalences among these different references, and to migrate toward the use of common references.
当然,这有赖于越来越普遍地使用URIref而不是用文字来指代事物;譬如:用URIref像“exstaff:85740”和“dc:creator”来代替字符串文字像“John Smith”和“creator”。即使是那样,RDF对URIre的使用仍不能解决所有的标识问题,因为例如:人们仍然能够用不同的URIref来指代同一个事物。由于这个原因,尽量使用现有的词汇表(比如Dublin Core)的术语,而不发明可能与其他词汇表中术语重复的术语,这是个不错的想法。 正如在第6节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#applications)描述的应用展示的那样,在特定领域里适用的词汇表一直都在完善中。然而,即使同义词被建立了,在普遍可访问的“Web 空间”中使用不同的URIref,即提供了在这些URIref中识别等价关系的机遇,也提供了转向使用通用词汇表的机遇。

In addition, it is important to distinguish between any meaning that RDF itself associates with terms (such as dc:creator in the previous example) used in RDF statements and additional, externally-defined meaning that people (or programs written by those people) might associate with those terms. As a language, RDF directly defines only the graph syntax of subject, predicate, and object triples, certain meanings associated with URIrefs in the rdf: vocabulary, and certain other concepts to be described later. These things are normatively defined in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)] and [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]. However, RDF does not define the meanings of terms from other vocabularies, such as dc:creator, that might be used in RDF statements. Specific vocabularies will be created, with specific meanings assigned to the URIrefs defined in them, externally to RDF. RDF statements using URIrefs from these vocabularies may convey the specific meanings associated with those terms to people familiar with these vocabularies, or to RDF applications written to process these vocabularies, without conveying any of these meanings to an arbitrary RDF application not specifically written to process these vocabularies.
另外,重要的是,要区分RDF本身赋予RDF陈述中的词汇(比如在先前例子里的dc:creator)的含义与人们(或人编写的程序)可能赋予这些词汇的其他外部定义的含义。作为一门语言,RDF直接定义的只有主体,谓词,客体三元组的图示语法,在rdf:词汇表中的URIrefs的某些含义,和稍后会做介绍的某些其他概念。这些事物在[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]和[RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]有规范的定义。不过,RDF没有定义在RDF陈述中使用的其他词汇表中的术语的含义,比如:dc:creator。特定的词汇表会被创建且其中的URIref会被赋予特定的含义,但这是在RDF之外的。使用了这些词汇表中的URIref的RDF陈述可能会把那些术语的特定含义传达给熟悉这些词汇表的人,或是处理这些词汇表的RDF应用程序,而不会把这些含义传达给不是特意处理这些词汇表的通用RDF应用程序。
For example, people can associate meaning with a triple such as

ex:index.html dc:creator exstaff:85740 .

based on the meaning they associate with the appearance of the word "creator" as part of the URIref dc:creator, or based on their understanding of the specific definition of dc:creator in the Dublin Core vocabulary. However, as far as an arbitrary RDF application is concerned the triple might as well be something like

例如,人们可以给一个三元组如:
ex:index.html dc:creator exstaff:85740 .

赋予一定的含义,这是基于单词“creator”作为URIref“dc:creator”的一部分出现所表示的含义,或者基于在他们理解了“dc:creator”在Dublin Core词汇表中的确切定义。 不过,就通用的RDF应用程序而言,这个三元组和下面的三元组在内在的含义上是一样的:
fy:joefy.iunm ed:dsfbups fytubgg:85740 .


as far as any built-in meaning is concerned. Similarly, any natural language text describing the meaning of dc:creator that might be found on the Web provides no additional meaning that an arbitrary RDF application can directly use.
与此类似,任何可能在Web上找到的描述“dc:creator”含义的自然语言文本都无法为一个通用的RDF应用程序提供其直接可用的额外的含义信息。
Of course, URIrefs from a particular vocabulary can be used in RDF statements even though a given application may not be able to associate any special meanings with them. For example, generic RDF software would recognize that the above expression is an RDF statement, that ed:dsfbups is the predicate, and so on. It will simply not associate with the triple any special meaning that the vocabulary developer might have associated with a URIref like ed:dsfbups. Moreover, based on their understanding of a given vocabulary, people can write RDF applications to behave in accordance with the special meanings assigned to URIrefs from that vocabulary, even though that meaning will not be accessible to RDF applications not written in that way.
当然,来自一个特定词汇表的URIrefs可以在RDF陈述中被使用,尽管给定的应用程序可能不能把任何特定的含义赋予他们。例如,通用的RDF软件会识别出上述表达式是一个RDF陈述,其中“ed:dsfbups”是一个谓词,等等。它不会把词汇表开发人员赋予给一个URIref(比如 ed:dsfbups)的任何特定含义赋给这个三元组。 此外,基于他们对一个给定的词汇表的理解,人们仍可以编写出一个与这个词汇表中的URIref的特定含义一致的RDF应用程序,尽管这个含义对不是以这种方式编写的RDF应用程序是无法理解的。
The result of all this is that RDF provides a way to make statements that applications can more easily process. An application cannot actually "understand" such statements, as noted already, any more than a database system "understands" terms like "employee" or "salary" in processing a query like SELECT NAME FROM EMPLOYEE WHERE SALARY > 35000. However, if an application is appropriately written, it can deal with RDF statements in a way that makes it seem like it does understand them, just as a database system and its applications can do useful work in processing employee and payroll information without understanding "employee" and "payroll". For example, a user could search the Web for all book reviews and create an average rating for each book. Then, the user could put that information back on the Web. Another Web site could take that list of book rating averages and create a "Top Ten Highest Rated Books" page. Here, the availability and use of a shared vocabulary about ratings, and a shared group of URIrefs identifying the books they apply to, allows individuals to build a mutually-understood and increasingly-powerful (as additional contributions are made) "information base" about books on the Web. The same principle applies to the vast amounts of information that people create about thousands of subjects every day on the Web.

结果是:RDF提供了一种发表更易被应用程序处理的陈述的方法。一个应用不能真正理解这些陈述,就如当一个数据库系统处理一个查询语句如:SELECT NAME FROM EMPLOYEE WHERE SLALRY > 35000 的时候,数据库系统对像“employee”或“salary”这类的词汇的理解一样。但是, 如果一个应用程序编写的很合理,那么它处理RDF陈述时就好像它确实理解它们一样,这正像是一个数据库系统和它的程序并没有理解什么是“employee”和“payroll”却能在处理雇员和薪水的数据信息时做有用的工作一样。例如:一个人能搜寻Web找到全部书评并且为每本书创建一个平均等级。 然后,这个人就可以把这些关于书的信息放到Web上。 而另一网站能获取这些书平均等级的列表并且创造一个"评价最高的十本书"页面。 这里,一个关于书等级的共享词汇表的可用性和及其使用,以及用于标识那些书的一组共享的URIref,允许个人建造一个在Web上可相互理解和用处日益广泛(或说是做了其他贡献那样)的关于书的“信息库”。相同的原则适用于人们每天在Web上创建的关于数以千计的主题的大量信息。
RDF statements are similar to a number of other formats for recording information, such as:
RDF陈述和很多其他信息记录格式类似,像:

  • entries in a simple record or catalog listing describing the resource in a data processing system.
  • 在一个数据处理系统里,一个简单的记录或是目录清单中的实体,


  • rows in a simple relational database.
  • 一个简单的关系数据库的行,


  • simple assertions in formal logic
  • 形式逻辑的简单断言,


and information in these formats can be treated as RDF statements, allowing RDF to be used to integrate data from many sources.
并且,这些格式的信息都能看成RDF陈述,这使得RDF能用于集成来自多个数据源的数据。


2.3 Structured Property Values and Blank Nodes

2.3 结构化的属性值与空节点

Things would be very simple if the only types of information to be recorded about things were obviously in the form of the simple RDF statements illustrated so far. However, most real-world data involves structures that are more complicated than that, at least on the surface. For instance, in the original example, the date the Web page was created is recorded as a single exterms:creation-date property, with a plain literal as its value. However, suppose the value of the exterms:creation-date property needed to record the month, day, and year as separate pieces of information? Or, in the case of John Smith's personal information, suppose John's address was being described. The whole address could be written out as a plain literal, as in the triple

需要记录的信息,如果用简单的RDF语句的形式来描述就足够了,那么,一切都将变得很简单, 但是,大多数现实世界中的数据,至少表面看起来,要比简单的RDF语句所能描述的形式复杂得多。 例如,在最初的那个例子中,用来记录创建网页的是一个简单的数据:creation-date属性, 这个属性的值是简单的字符型,但是,假设这个creation-date属性的值需要分别记录年、月、日, 或者,在描述John Smith的个人信息的情况下,我们来考虑John的地址,整个的地址可以被 写作一个简单的字符串,或者一个三元组"1501 Grant Avenue, Bedford, Massachusetts 01730"。

exstaff:85740 exterms:address "1501 Grant Avenue, Bedford, Massachusetts 01730" .


However, suppose John's address needed to be recorded as a structure consisting of separate street, city, state, and postal code values? How would this be done in RDF?
然而,设想一下约翰的地址需要记录为由一个街道,城市,州和邮政编码组成的结构,这些在RDF中是如何做到的?
Structured information like this is represented in RDF by considering the aggregate thing to be described (like John Smith's address) as a resource, and then making statements about that new resource. So, in the RDF graph, in order to break up John Smith's address into its component parts, a new node is created to represent the concept of John Smith's address, with a new URIref to identify it, say http://www.example.org/addressid/85740 (abbreviated as exaddressid:85740). RDF statements (additional arcs and nodes) can then be written with that node as the subject, to represent the additional information, producing the graph shown in Figure 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure5):

像这样的结构化的数据信息在RDF中是通过以下方式描述的:把被描述的事物聚集体(比如:John Smith的住址)看成一个资源,然后发表关于这个新资源的陈述。所以,在RDF图中,为了将John Smith住址分解成它的各个组成部分,一个用来描述John Smith住址这一概念的新节点就随之产生了,并用一个新的URIref来标识,如http://www.example.org/addressid/85740 (可缩写为exaddressid:85740)。把这个节点作为主体,RDF陈述(附加的弧和节点)可用来描述附加的信息,如图5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure5)所示:
fig5may19.png Figure 5: Breaking Up John's Address
图5:分解John的住址:
or the triples:
相应的三元组表示如下:
exstaff:85740 exterms:address exaddressid:85740 .
exaddressid:85740 exterms:street "1501 Grant Avenue" .
exaddressid:85740 exterms:city "Bedford" .
exaddressid:85740 exterms:state "Massachusetts" .
exaddressid:85740 exterms:postalCode "01730" .


This way of representing structured information in RDF can involve generating numerous "intermediate" URIrefs such as exaddressid:85740 to represent aggregate concepts such as John's address. Such concepts may never need to be referred to directly from outside a particular graph, and hence may not require "universal" identifiers. In addition, in the drawing of the graph representing the group of statements shown in Figure 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure5), the URIref assigned to identify "John Smith's address" is not really needed, since the graph could just as easily have been drawn as in Figure 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6):
这中描述RDF结构化数据的方法会产生很多的“中间的”URIrefs,比如像描述聚集体概念(如John's address)的URIref exaddressid:85740。这些概念可能从来不会被从RDF图的外部引用,因此可能不需要“通用的”标识符。另外,在用于描述一组陈述的图 图5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure5)中,用来标识“John Smith's address”的URIref并不是真正需要的,因为这个图可以简单地标识为如图6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6)所示:


fig6may19.png
Figure 6: Using a Blank Node
图6:使用一个空节点
Figure 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6), which is a perfectly good RDF graph, uses a node without a URIref to stand for the concept of "John Smith's address". This blank node (http://www.w3.org/TR/rdf-concepts/#dfn-blank-node) serves its purpose in the drawing without needing a URIref, since the node itself provides the necessary connectivity between the various other parts of the graph. (Blank nodes were called anonymous resources in [RDF-MS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdfms)].) However, some form of explicit identifier for that node is needed in order to represent this graph as triples. To see this, trying to write the triples corresponding to what is shown in Figure 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6) would produce something like:

图6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6)是一个近乎完美的RDF图,它使用了一个没有URIref的节点来表示“John Smith's address”这一概念。这个空节点 (http://www.w3.org/TR/rdf-concepts/#dfn-blank-node)虽然没有URIref,但表达了它应该表达的含义,因为这个空节点本身提供了图中各个部分之间必需的连通作用(空节点在[RDF-MS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdfms)]中被称作匿名资源(anonymous resources))。然而,为了把这个图表示为三元组的形式,就需要一个某种形式的能清楚表示那个空节点的标识符。这里试着写出了与图6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6) 所示的内容相应的三元组:


exstaff:85740 exterms:address  ??? .
??? exterms:street "1501 Grant Avenue" .
??? exterms:city "Bedford" .
??? exterms:state "Massachusetts" .
??? exterms:postalCode "01730" .


where ??? stands for something that indicates the presence of the blank node. Since a complex graph might contain more than one blank node, there also needs to be a way to differentiate between these different blank nodes in a triples representation of the graph. As a result, triples use blank node identifiers (http://www.w3.org/TR/rdf-concepts/#dfn-blank-node-id), having the form _:name, to indicate the presence of blank nodes. For instance, in this example a blank node identifier _:johnaddress might be used to refer to the blank node, in which case the resulting triples might be:
“???”出现的地方正是出空节点出现过的地方。因为一个复杂的图包含的空节点可能会不只一个,所以需要一种区分在图的三元组表示法中出现的不同空节点的办法。因此,三元组使用空节点标识符 (http://www.w3.org/TR/rdf-concepts/#dfn-blank-node-id),以“_:name”的形式来表示空节点。例如:在这个例子中,空节点标识符“_:johnaddress”可以用来表示空节点,那么相应的三元组可以写成如下的形式:
exstaff:85740 exterms:address _:johnaddress .
_:johnaddress exterms:street "1501 Grant Avenue" .
_:johnaddress exterms:city "Bedford" .
_:johnaddress exterms:state "Massachusetts" .
_:johnaddress exterms:postalCode "01730" .


In a triples representation of a graph, each distinct blank node in the graph is given a different blank node identifier. Unlike URIrefs and literals, blank node identifiers are not considered to be actual parts of the RDF graph (this can be seen by looking at the drawn graph in Figure 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6) and noting that the blank node has no blank node identifier). Blank node identifiers are just a way of representing the blank nodes in a graph (and distinguishing one blank node from another) when the graph is written in triple form. Blank node identifiers also have significance only within the triples representing a single graph (two different graphs with the same number of blank nodes might independently use the same blank node identifiers to distinguish them, and it would be incorrect to assume that blank nodes from different graphs having the same blank node identifiers are the same). If it is expected that a node in a graph will need to be referenced from outside the graph, a URIref should be assigned to identify it. Finally, because blank node identifiers represent (blank) nodes, rather than arcs, in the triple form of an RDF graph, blank node identifiers may only appear as subjects or objects in triples; blank node identifiers may not be used as predicates in triples.
在表示一个图的三元组中,图中每个不同的空节点都被赋予一个不同的空节点标识符。与URIref和文字不一样,空节点标识符并不被认为是RDF图的一个实际组成部分(这从图6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure6)所示的就可以看出来,并且注意在图中空节点并没有空节点标识符)。空节点标识符仅仅是在把RDF图表示成三元组形式的时候,用来表示图中的空节点的(并且区分不同的空节点)。空节点标识符只是在用三元组表示单一的图的时候才有意义(两个有相同空节点数目的RDF图可能会独自地使用相同的空节点标识符来区别那些空节点,但是如果假设不同RDF图中具有相同标识符的空节点是相同的就不对了)。如果希望图中的一个节点需要从图的外部来引用,那么就应该赋予一个URIref值来标识它。最后,因为空节点标识符表示的是(空)节点而非弧,所以在一个图的三元组表达式中:空节点标识符只能出现在三元组主体和客体的位置上;不能出现在谓词的位置上。
The beginning of this section noted that aggregate structures, like John Smith's address, can be represented by considering the aggregate thing to be described as a separate resource, and then making statements about that new resource. This example illustrates an important aspect of RDF: RDF directly represents only binary relationships, e.g. the relationship between John Smith and the literal representing his address. Representing the relationship between John and the group of separate components of this address involves dealing with an n-ary (n-way) relationship (in this case, n=5) between John and the street, city, state, and postal code components. In order to represent such structures directly in RDF (e.g., considering the address as a group of street, city, state, and postal code components), this n-way relationship must be broken up into a group of separate binary relationships. Blank nodes provide one way to do this. For each n-ary relationship, one of the participants is chosen as the subject of the relationship (John in this case), and a blank node is created to represent the rest of the relationship (John's address in this case). The remaining participants in the relationship (such as the city in this example) are then represented as separate properties of the new resource represented by the blank node.
这一节的开头部分记录了聚集体结构(比如John Smith's address)可以通过如下的方式来描述:聚集体被作为一种资源描述,然后发表关于这个新资源的陈述。这个例子阐明了RDF的一个重要方面:RDF只能直接表示二元关系,例如:John Smith和描述他住址的文字(literal)之间的关系。要描述John和由这个地址的每个单独部分组成的组的关系的时候,就要涉及到处理一个N元(n-ary)关系(在这里N=5),其中这五元分别是John,街区(street),城市(city),州(state),和邮政编码(postal code)。为了要在RDF中直接的描述这种结构(例如:把地址看作是由街区(street),城市(city),州(state),和邮政编码(postal code)这四个部分构成的一个组),就必须把这个N元关系分解为一组二元关系。空节点提供了一种完成这个任务的方法:对于每一个N元关系,选择其中的一元( participant)作为这个关系的主体(比如John),创建一个空节点来描述其余的关系(比如John's address),这个N元关系的其他元(比如city)则被描述成由空节点标识的新资源的各个单独的属性。
Blank nodes also provide a way to more accurately make statements about resources that may not have URIs, but that are described in terms of relationships with other resources that do have URIs. For example, when making statements about a person, say Jane Smith, it may seem natural to use a URI based on that person's email address as her URI, e.g., mailto:jane@example.org. However, this approach can cause problems. For example, it may be necessary to record information both about Jane's mailbox (e.g., the server it is on) as well as about Jane herself (e.g., her current physical address), and using a URIref for Jane based on her email address makes it difficult to know whether it is Jane or her mailbox that is being described. The same problem exists when a company's Web page URL, say http://www.example.com/, is used as the URI of the company itself. Once again, it may be necessary to record information about the Web page itself (e.g., who created it and when) as well as about the company, and using http://www.example.com/ as an identifier for both makes it difficult to know which of these is the actual subject.

有些资源可能没有URI,空节点也同样提供了一种更准确的发表关于这些资源的陈述的方法,但这是通过和那些有URI的资源的关系来描述的。例如:当发表一个关于某人(比如Jane Smith)的陈述的时候,可能会很自然的想到要用基于这人的email地址的URI作为她的URI(mailto:jane@example.org ),但是,这种方法可能会导致一些问题。如果需要同时记录关于Jane(比如她目前的实际住址)和她的邮箱(比如,它所在的服务器)两者的信息,那么,还用基于她邮箱地址的URI作为她的URIref的话,就会很难区分表述的到底是Jane还是她的邮箱。同样的问题也会出现在下面这种情况:当一个公司用它公司的网页URL(比如:http://www.example.com/)作为自己的URI的时候。同样地,当需要同时记录关于网页(比如:是谁于何时创建的)和这个公司两者的信息时,如果还用“http://www.example.com/”作为两者的标识符,就会导致很难区分谁是真正意义上的主体。
The fundamental problem is that using Jane's mailbox as a stand-in for Jane is not really accurate: Jane and her mailbox are not the same thing, and hence they should be identified differently. When Jane herself does not have a URI, a blank node provides a more accurate way of modeling this situation. Jane can be represented by a blank node, and that blank node used as the subject of a statement with exterms:mailbox as the property and the URIref mailto:jane@example.org as its value. The blank node could also be described with an rdf:type property having a value of exterms:Person (types are discussed in more detail in the following sections), an exterms:name property having a value of "Jane Smith", and any other descriptive information that might be useful, as shown in the following triples:
这些问题出现的根本原因就是:用Jane的邮箱来代表Jane是不正确的,因为Jane和她的邮箱根本就是两码事,因此她和它应该区别对待。当Jane自己没有URI时,空节点提供了一条为这种情形更正确的建模方法:Jane可以由一个空节点表示,并且用这个以“exterms:mailbox”为属性的空节点作为陈述的主体,且用URIref“mailto:jane@example.org” 作为它的这个属性的值。这个空节点也可以用以“exterms:Person”为值的一个“rdf:type”属性来表述(类型(type)将在以后章节做更详细的讨论),或者是其他有用的描述性信息,正如下列三元组所示的:
_:jane exterms:mailbox <mailto:jane@example.org&gt; .
_:jane rdf:type exterms:Person .
_:jane exterms:name "Jane Smith" .
_:jane exterms:empID "23748" .
_:jane exterms:age "26" .


(Note that mailto:jane@example.org is written within angle brackets in the first triple. This is because mailto:jane@example.org is a full URIref in the mailto URI scheme, rather than a QName abbreviation, and full URIrefs must be enclosed in angle brackets in the triples notation.)
(注意在第一个三元组中“ mailto:jane@example.org”写在两个尖括号里面,这是因为“mailto:jane@example.org” 在mailto URI模式中是个完整的URIref,而不是一个QName缩写,在三元组表示法里一个完整的URIref必需写在一对尖括号内。)


This says, accurately, that "there is a resource of type exterms:Person, whose electronic mailbox is identified by mailto:jane@example.org, whose name is Jane Smith, etc." That is, the blank node can be read as "there is a resource". Statements with that blank node as subject then provide information about the characteristics of that resource.
这些三元组准确地说明了:“有一个资源,其类型为exterms:Person,其电子邮箱是由“mailto:jane@example.org” 来标识的,其名字是Jane Smith,等等”。就是说,空节点可以读作“有一个资源”。以这个空节点作主体的陈述就提供关于这个资源特性方面的信息。
In practice, using blank nodes instead of URIrefs in these cases does not change the way this kind of information is handled very much. For example, if it is known that an email address uniquely identifies someone at example.org (particularly if the address is unlikely to be reused), that fact can still be used to associate information about that person from multiple sources, even though the email address is not the person's URI. In this case, if some RDF is found on the Web that describes a book, and gives the author's contact information as mailto:jane@example.org, it might be reasonable, combining this new information with the previous set of triples, to conclude that the author's name is Jane Smith. The point is that saying something like "the author of the book is mailto:jane@example.org" is typically a shorthand for "the author of the book is someone whose mailbox is mailto:jane@example.org". Using a blank node to represent this "someone" is just a more accurate way to represent the real world situation. (Incidentally, some RDF-based schema languages allow specifying that certain properties are unique identifiers of the resources they describe. This is discussed further in Section 5.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas).)
实际上,在这些情况下用空节点替代URIref并不会在信息处理方面带来太多改变。例如:人们知道一个email地址唯一确定在example.org里的某人(特别地,如果这个地址不能被重用的话),那么,这个email地址会被用来聚集来自多个数据源的关于这个人的信息。尽管这个email地址不是这人的URI。在这种情况下,如果在Web上找到了一些描述一本书的RDF,并且给出了作者的联系资料如 mailto:jane@example.org,那么把这条新信息和先前的一套三元组结合起来,然后推断作者的名字是Jane Smith,这样做就可能是合理的。这种说法的关键有点像"这书的作者是 mailto:jane@example.org"是“这书的作者是邮箱是mailto:jane@example.org的某人"的一种典型的缩写一样。用一个空节点来表示这个“某人”是一种更准确地来表示真实世界的方法。(顺便说一下,一些基于RDF的模式语言特别指出允许某些属性可以作为它们描述的资源的”唯一标识符“。这些将在5.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)做更深入的探讨。)

Using blank nodes in this way can also help avoid the use of literals in what might be inappropriate situations. For example, in describing Jane's book, lacking a URIref to identify the author, the publisher might have written (using the publisher's own ex2terms: vocabulary):
这种使用空节点的方法也可以帮助人们避免文字(literals)在可能不适当情况下的使用.例如:当描述Jane的书而又缺少一个识别作者的URIref时,出版商就可能这样写(使用出版商自己的ex2terms:词汇表):
ex2terms:book78354 rdf:type ex2terms:Book .
ex2terms:book78354 ex2terms:author "Jane Smith" .


However, the author of the book is not really the character string "Jane Smith", but a person whose name is Jane Smith. The same information might be more accurately given by the publisher using a blank node, as:
但是,书的作者却不是字符串“Jane Smith”,而是一个名叫Jane Smith的人。于是,当出版商用一个空节点时相同的信息就可能会被更准确的表达出来:
ex2terms:book78354 rdf:type ex2terms:Book .
ex2terms:book78354 ex2terms:author _:author78354 .
_:author78354 rdf:type ex2terms:Person .
_:author78354 ex2terms:name "Jane Smith" .


This essentially says "resource ex2terms:book78354 is of type ex2terms:Book, and its author is a resource of type ex2terms:Person, whose name is Jane Smith." Of course, in this particular case the publisher might instead have assigned its own URIrefs to its authors instead of using blank nodes to identify them, in order to encourage external references to its authors.
这实质上说,“ex2terms:book78354”的类型是“ex2terms:book”,并且它的作者是类型为“ex2terms:Person”的一个资源,作者的名字是“Jane Smith”。当然,在这个特例中,出版者为了要鼓励对作者的外部引用,可能对作者指派他自己的URIrefs而不是使用空节点识别他们。


Finally, the example above giving Jane's age as 26 illustrates the fact that sometimes the value of a property may appear to be simple, but actually may be more complex. In this case, Jane's age is actually 26 years, but the units information (years) is not explicitly given. Such information is often omitted in contexts where it can be safely assumed that anyone accessing the property value will understand the units being used. However, in the wider context of the Web, it is generally not safe to make this assumption. For example, a U.S. site might give a weight value in pounds, but someone accessing that data from outside the U.S. might assume that weights are given in kilograms. In general, careful consideration should be given to explicitly representing units and similar information. This issue is discussed further in Section 4.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfvalue), which describes an RDF feature for representing such information as structured values, as well as some other techniques for representing such information.
最后,上面的例子给出了Jane的年龄是26说明了这么一件事实就是:有时一个属性的值可能表面上看来很简单,但实际上可能会更复杂。在这种情况,Jane的年龄实际上是26岁,但是单位量(岁)没有明确给出。当确信某个访问文本中属性值的人由此能推定所使用的单位量时类似的单位量经常被省略。但是,在Web上无际的文本海洋里,这样的“确信”通常是不可靠的,例如:一个美国地址也许给定一个重量单位--磅,但是某个从外部访问这个数据的人可能会推想给定的单位是千克。总的来说,对于单位或是类似的信息应该经过缜密的考虑然后进行明确的表述。这个问题将会在4.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfvalue)做更深入的探讨,在这节中将会讲述能把这样的信息表述成构造值(structured values)是RDF特色之一,同时也会涉及到另外一些用于表述这类信息的技术。



2.4 Typed Literals

2.4 类型文字


The last section described how to handle situations in which property values represented by plain literals had to be broken up into structured values to represent the individual parts of those literals. Using this approach, instead of, say, recording the date a Web page was created as a single exterms:creation-date property, with a single plain literal as its value, the value would be represented as a structure consisting of the month, day, and year as separate pieces of information, using separate plain literals to represent the corresponding values. However, so far, all constant values that serve as objects in RDF statements have been represented by these plain (untyped) literals, even when the intent is probably for the value of the property to be a number (e.g., the value of a year or age property) or some other kind of more specialized value.
上一节讲述了怎样处理如下这种情况:用平凡文字表示的属性值分解为能表示那些文字每个单独部分的构造值。例如:如果要记录一个网页的创建日期的话,这种方法用一个专门的平凡文字作为它的值,这个值会以一个由年,月,日组成的结构体作为资料的各个部分,并分别用平凡文字来表示相应的值,就取代了通过创建一个单独exterms:creation-date属性来记录一个网页创建日期的方法。但是,到目前为止,所有可以在RDF中作为客体的常量值都用这些平凡(非类型)文字表示,甚至当意图是用数字(例如一个年份属性或是年龄属性的值)或者其他更特殊的值当作属性值时。



For example, Figure 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure4) illustrated an RDF graph recording information about John Smith. That graph recorded the value of John Smith's exterms:age property as the plain literal "27", as shown in Figure 7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure7):

例如,如图4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure4) 所示的一个记录关于John Smith资料的RDF图,这个图中记录的John Smith的属性“exterms:age”值为平凡文字“27”,正如图7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure7)所示的那样:
fig7dec16.png
Figure 7: Representing John Smith's Age
fig7dec16.png
图7:表示John Smith的年龄


In this case, the hypothetical organization example.org probably intends for "27" to be interpreted as a number, rather than as the string consisting of the character "2" followed by the character "7" (since the literal represents the value of an "age" property). However, there is no information in Figure 7's graph that explicitly indicates that "27" should be interpreted as a number. Similarly, example.org also probably intends for "27" to be interpreted as a decimal number, i.e., the value twenty seven, rather than, say, as an octal number, i.e., the value twenty three. However, once again there is no information in Figure 7's graph that explicitly indicates this. Specific applications might be written with the understanding that they should interpret values of the exterms:age property as decimal numbers, but this would mean that proper interpretation of this RDF would depend on information not explicitly provided in the RDF graph, and hence on information that would not necessarily be available to other applications that might need to interpret this RDF.

在这个例子中,假设的组织example.org可能想要用一个数字来表示“27”,而不是用由“2”和后面的“7”组成的字符串来表示(因为文字表示了一个属性“age”的值)。但是,图7并没有明确指出“27”应当被解释成一个数字。同样地,example.org可能也想把“27”表示成一个十进制数(比如,一个值为二十七的十进制数),而不是表示成一个八进制数(比如,一个值为二十三的八进制数)。然而,同样地,图7也没有明确指出这些信息。一些特殊的应用程序可能会在编码时把属性exterms:age的值解释成十进制数,但这意味着对这个RDF的正确解释会依赖RDF图中没有明确提供的信息,因而还依赖一些其他需要解释这个RDF的应用程序不一定能获取的信息。
The common practice in programming languages or database systems is to provide this additional information about how to interpret a literal by associating a datatype with the literal, in this case, a datatype like decimal or integer. An application that understands the datatype then knows, for example, whether the literal "10" is intended to represent the number ten, the number two, or the string consisting of the character "1" followed by the character "0", depending on whether the specified datatype is integer, binary, or string. (More specialized datatypes could also be used to include the units information mentioned at the end of Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties), e.g., a datatype integerYears, although the Primer will not elaborate on this idea.) In RDF, typed literals (http://www.w3.org/TR/rdf-concepts/#dfn-typed-literal) are used to provide this kind of information.

在程序设计语言和数据库系统里通常都会提供一个关于如何解释文字的附加信息:即给文字关联一个数据类型,比如在这个例子里,数据类型是小数或者是整数。一个能理解数据类型的应用程序就会知道,比如,把文字“10”表示成数字十,还是数字二,还是由字符“1”和后面的字符“0”组成的一个字符串,取决于指定的数据类型是整数,二进制数,还是字符串。(虽然这本入门文档不会详细说明关于数据类型的概念,但在2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties)的结尾处已经提到过更多可以用来包含单位信息的专门的数据类型,比如:一个为intergerYears数据类型。)在RDF中,类型文字 (http://www.w3.org/TR/rdf-concepts/#dfn-typed-literal) 是用来提供这类信息的。
An RDF typed literal is formed by pairing a string with a URIref that identifies a particular datatype. This results in a single literal node in the RDF graph with the pair as the literal. The value represented by the typed literal is the value that the specified datatype associates with the specified string. For example, using a typed literal, John Smith's age could be described as being the integer number 27 using the triple:
一个RDF类型文字是通过把一个字符串与一个能确定一个特殊数据类型的URIref配对形成的。结果在RDF图中的一个文字节点就是这个配对。类型文字表示的值就是把指定的字符串赋值给指定的数据类型的值。例如,使用一个类型文字,John Smith的年龄将会被表述成在三元组中使用的整数27:
<http://www.example.org/staffid/85740&gt; <http://www.example.org/terms/age&gt; "27"^^<http://www.w3.org/2001/XMLSchema#integer&gt; .
or, using the QName simplification for writing long URIs:
或者,使用QName来简化URI则可写成:


exstaff:85740 exterms:age "27"^^xsd:integer .


or as shown in Figure 8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure8):
或者,如图8所示的:
fig8jul23.png
Figure 8: A Typed Literal for John Smith's Age
图8:一个表示John Smith年龄的类型文字
Similarly, in the graph shown in Figure 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3) describing information about a Web page, the value of the page's exterms:creation-date property was written as the plain literal "August 16, 1999". However, using a typed literal, the creation date of the Web page could be explicitly described as being the date August 16, 1999, using the triple:
同样地,如图3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3)所示它表述了关于一个网页的信息资料,网页的 exterms:creation-date属性值写成了平凡文字“August 16,1999”。然而,如果使用一个类型文字,那么这个网页的创建日期就可以明确的表述成1999年8月16号(August 16, 1999),用三元组表示就是:
ex:index.html exterms:creation-date "1999-08-16"^^xsd:date .

or as shown in Figure 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure9):
或正如图9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure9)所示的那样:
fig9jul23.png
Figure 9: A Typed Literal for a Web Page's Creation Date
图9:一个表示一个网页创建日期的类型文字
Unlike typical programming languages and database systems, RDF has no built-in set of datatypes of its own, such as datatypes for integers, reals, strings, or dates. Instead, RDF typed literals simply provide a way to explicitly indicate, for a given literal, what datatype should be used to interpret it. The datatypes used in typed literals are defined externally to RDF, and identified by their datatype URIs (http://www.w3.org/TR/rdf-concepts/#dfn-datatype-URI). (There is one exception: RDF defines a built-in datatype with the URIref rdf:XMLLiteral to represent XML content as a literal value. This datatype is defined in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)], and its use is described in Section 4.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#xmlliterals).) For instance, the examples in Figure 8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure8) and Figure 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure9) use the datatypes integer and date from the XML Schema datatypes defined in XML Schema Part 2: Datatypes (http://www.w3.org/TR/xmlschema-2/) [XML-SCHEMA2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xmlschema2)]. An advantage of this approach is that it gives RDF the flexibility to directly represent information coming from different sources without the need to perform type conversions between these sources and a native set of RDF datatypes. (Type conversions would still be required when moving information between systems having different sets of datatypes, but RDF would impose no extra conversions into and out of a native set of RDF datatypes.)

不像典型的程序设计语言和数据库系统那样,RDF没有自己的内置数据类型,比如,整型,实型,字符型,或者日期类型。但是,RDF类型文字为一个已给定的文字提供了一种简单的方法来指出应该用什么样的数据类型来说明它。在类型文字中使用的类型在外部定义,并且由它们的数据类型URI (http://www.w3.org/TR/rdf-concepts/#dfn-datatype-URI)来确定。(有一个例外,RDF用URIref“rdf:XMLLiteral”定义了一个内置数据类型用来把XML内容表示成一个文字值。这个数据类型定义在[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)],并在4.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#xmlliterals)讲述的它的使用方法。)例如:图8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure8)图9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure9) 的例子都使用了整数的数据类型和来自XML数据类型的数据,其中,在XML模型的第二部分:数据类型 (http://www.w3.org/TR/xmlschema-2/) [XML-SCHEMA2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xmlschema2)]中定义了XML数据类型。用这种方法的优点之一便是它赋予了RDF直接表述信息的机动灵活性,因为在表述那些来自不同信息源的信息时无需进行信息源和RDF本身的数据类型集之间的转换。(当在不同的数据类型集系统之间移动信息时,还是要进行类型转换的,但当信息在RDF中移入或移出时,RDF无需额外的数据类型转换。)


RDF datatype concepts are based on a conceptual framework from XML Schema datatypes [XML-SCHEMA2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xmlschema2)], as described in RDF Concepts and Abstract Syntax (http://www.w3.org/TR/rdf-concepts/) [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]. This conceptual framework defines a datatype as consisting of:
正如在RDF概念(RDF Concepts)和抽象语法(Abstract Syntax) (http://www.w3.org/TR/rdf-concepts/)[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]中叙述的那样,RDF数据类型概念是基于XML数据类型[XML-SCHEMA2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xmlschema2)]的概念框架上的,这种概念框架定义了包含以下部分的数据类型:


  • A set of values, called the value space, that literals of the datatype are intended to represent. For example, for the XML Schema datatype xsd:date, this set of values is a set of dates.
  • 一个要用数据类型文字表示的值的集合,被称作值空间(value space)。例如,XML模型数据类型xsd:date的值空间就是日期的集合。
 
  • A set of character strings, called the lexical space, that the datatype uses to represent its values. This set determines which character strings can legally be used to represent literals of this datatype. For example, the datatype xsd:date defines 1999-08-16 as being a legal way to write a literal of this type (as opposed, say, to August 16, 1999). As defined in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)], the lexical space of a datatype is a set of Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] strings, allowing information from many languages to be directly represented.

一个数据类型用来表示它的值的字符串的集合,被称作是词法空间(lexical space)。词法空间决定了哪一种字符串能够合乎规则地被用来表示这种数据类型的文字。例如:数据类型xsd:date定义了“1999-08-16”是书写这种类型文字的一种合乎规则的方法(相反的如果写成“August 16,1999”则可认为是不合乎规则的)。正如在[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]中定义的,一种数据类型的词法空间是一个双字节字符[UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)]串集,它允许直接表示来自很多语言的信息。

 
  • A lexical-to-value mapping from the lexical space to the value space. This determines the value that a given character string from the lexical space represents for this particular datatype. For example, the lexical-to-value mapping for datatype xsd:date determines that, for this datatype, the string 1999-08-16 represents the date August 16, 1999. The lexical-to-value mapping is a factor because the same character string may represent different values for different datatypes.

一个从词空间到值空间的“词-值(lexical-to-value)映射”.这决定了这样的一个字符串的值:一个为表示这种特殊数据类型的取自词法空间里的一个特定的字符串。例如:一个映射到数据类型xsd:date的词-值映射,决定了对于这种数据类型,字符串“1999-08-16”表示日期“August 16, 1999”。词-值映射是个重要因素因为相同的字符串可能为不同数据类型表示不同的值。
Not all datatypes are suitable for use in RDF. For a datatype to be suitable for use in RDF, it must conform to the conceptual framework just described. This basically means that, given a character string, the datatype must unambiguously define whether or not the string is in its lexical space, and what value in its value space the string represents. For example, the basic XML Schema datatypes such as xsd:string, xsd:boolean, xsd:date, etc. are suitable for use in RDF. However, some of the built-in XML Schema datatypes are not suitable for use in RDF. For example, xsd:duration does not have a well-defined value space, and xsd:QName requires an enclosing XML document context. Lists of the XML Schema datatypes that are currently considered suitable and unsuitable for use in RDF are given in .


并不是所有数据类型都适和在RDF中使用。一种适和在RDF中使用的数据类型必须符合上述的概念框架。主要意思就是:对于一个特定的字符串,数据类型必须明确地说明这个字符串是否在它的词法空间内,以及这个字符串在它的值空间里所表示的值。例如:基本的XML数据类型(比方说是xsd:string,xsd:boolean,xsd:date等等)就适合用在RDF当中。然而,一些XML内建数据类型就不适合用在RDF当中。例如:xsd:duration没有一个良式定义(well-defined)的值空间,并且xsd:QName需要一个封装的XML文本文档。到目前为止所认为适合和不适合用在RDF中的XML数据类型的清单已经在[RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]中给出了。
Since the value that a given typed literal denotes is defined by the typed literal's datatype, and, with the exception of rdf:XMLLiteral, RDF does not define any datatypes, the actual interpretation of a typed literal appearing in an RDF graph (e.g., determining the value it denotes) must be performed by software that is written to correctly process not only RDF, but the typed literal's datatype as well. Effectively, this software must be written to process an extended language that includes not only RDF, but also the datatype, as part of its built-in vocabulary. This raises the issue of which datatypes will be generally available in RDF software. Generally, the XML Schema datatypes that are listed as suitable for use in RDF in [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] have a "first among equals" status in RDF. As noted already, the examples in Figure 8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure8) and Figure 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure9) used some of these XML Schema datatypes, and the Primer will be using these datatypes in most of its other examples of typed literals as well (for one thing, XML Schema datatypes already have assigned URIrefs that can be used to refer to them, specified in [XML-SCHEMA2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xmlschema2)]). These XML Schema datatypes are treated no differently than any other datatype, but they are expected to be the most widely used, and therefore the most likely to be interoperable among different software. As a result, it is expected that much RDF software will also be written to process these datatypes. However, RDF software could be written to process other sets of datatypes as well, assuming they were determined to be suitable for use with RDF, as described already.

因为一个特定类型文字表示的值是由类型文字的数据类型决定的,且RDF没有定义任一种数据类型(rdf:XMLLiteral是例外),

对一个出现在RDF图中的类型文字的实际解释(例如:决定它所表示的值)必须由那些编写成能正确处理RDF和类型文字的数据类型的软件完成。也就是说,这种软件必须能处理一种RDF的扩展语言,即把RDF和数据类型都作为其内置词汇表的一部分。这使得关于哪种将会在RDF软件中普遍用到的数据类型的争论日益激烈。通常,那些在[RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]罗列出的适合在RDF中使用的XML模型数据类型在RDF中有着“首屈一指”的地位。正如已注明的,图8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure8)图9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure9) 的例子使用了XML数据类型中的一些数据类型,并且这本入门书也将在类型文字的其他例子中使用这些数据类型(另外,XML数据类型已经被赋值为用来查阅它们的URIref了,这一点在[XML-SCHEMA2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xmlschema2)]有详细的说明)。比较起其他的数据类型来这些XML数据类型并没受到区别对待,但人们期望它们能被广泛的应用,因此它们最有可能被不同的软件共同使用。然而,RDF也应该能处理其他的数据类型集,因为正如已经阐述的,它们也是适合使用在RDF中的。


In general, RDF software may be called on to process RDF data that contains references to datatypes that the software has not been written to process, in which case there are some things the software will not be able to do. For one thing, with the exception of rdf:XMLLiteral, RDF itself does not define the URIrefs that identify datatypes. As a result, RDF software, unless it has been written to recognize specific URIrefs, will not be able to determine whether or not a URIref written in a typed literal actually identifies a datatype. Moreover, even when a URIref does identify a datatype, RDF itself does not define the validity of pairing that datatype with a particular literal. This validity can only be determined by software written to correctly process that particular datatype.
通常,RDF软件可能被要求处理一些包含引用了软件不能处理的数据类型 的RDF数据,这样就有些事情软件是无法做到的。一个原因是,除了·rdf:XMLLiteral外,RDF本身不能定义标识数据类型的URIref。因此,除非RDF软件理解特定的URIref,否则将不能决定一个类型文字中的URIref是否实际上标识了一个数据类型。此外,即使一个URIref确实标识了一个数据类型,RDF自身也无法定义这个数据类型和一个特定文字配对的合法性。只有那些能够正确理解这种数据类型的软件才能判断这种合法性。
For example, the typed literal in the triple:
例如,在如下三元组中的类型文字:
exstaff:85740 exterms:age "pumpkin"^^xsd:integer .


or the graph shown in Figure 10 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure10):
或如图10 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure10)所示的那样:
fig10jul23.png
Figure 10: An Invalid Typed Literal for John Smith's Age
图10:一个用作John Smith的年龄的非法类型文字


is valid RDF, but obviously an error as far as the xsd:integer datatype is concerned, since "pumpkin" is not defined as being in the lexical space of xsd:integer. RDF software not written to process the xsd:integer datatype would not be able to recognize this error.
是有效的RDF,但是很明显,一个错误与数据类型xsd:integer有关,因为“pumpkin”没有在xsd:integer的词法空间里定义。不能处理数据类型xsd:integer的RDF软件将不会发现这个错误。


However, proper use of RDF typed literals provides more information about the intended interpretation of literal values, and hence makes RDF statements a better means of information exchange among applications.
然而,适当地使用RDF类型文字可以提供更多关于文字值的解释方面的信息,并因此使得RDF陈述成为一种更好的在应用程序中交换信息的方式。


2.5 Concepts Summary

2.5 总结


Taken as a whole, RDF is basically simple: nodes-and-arcs diagrams interpreted as statements about things identified by URIrefs. This section has presented an introduction to these concepts. As noted earlier, the normative (i.e., definitive) RDF specification describing these concepts is RDF Concepts and Abstract Syntax (http://www.w3.org/TR/rdf-concepts/) [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)], which should be consulted for further information. The formal semantics (meaning) of these concepts is defined in the (normative) RDF Semantics (http://www.w3.org/TR/rdf-mt/) [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] document.
综上所述,基本上说,RDF是比较简单的:由节点和弧构成的图解释说明了有关被URIref识别事物的陈述。在这一部分已经介绍了这些概念。如早先注明的,描述这些概念标准的(即权威的)RDF规范是RDF概念(RDF Concepts)和抽象语法(Abstract Syntax) (http://www.w3.org/TR/rdf-concepts/) [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)],如果做更深入的研究就应当参考它们。在(标准的)RDF语义学 (http://www.w3.org/TR/rdf-mt/) (RDF Semantics)[RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] 文档中详细说明了这些概念的formal semantics(涵义)。
However, in addition to the basic techniques for describing things using RDF statements discussed so far, it should be clear that people or organizations also need a way to describe the vocabularies (terms) they intend to use in those statements, specifically, vocabularies for:

然而,描述事物除了用目前为止所讨论的RDF陈述的基本技术之外,人们或组织也需要一种能够描述他们想要用在那些陈述中的词汇表(术语(term))的方法,显然,如下列的这些词汇表:


  • describing types of things (like exterms:Person)
  • 描述事物类型的词汇表(比如:exterms:Person)
 
  • describing properties (like exterms:age and exterms:creation-date), and
  • 描述事物属性的词汇表(比如:exterms:age和exterms:creation-date)


  • describing the types of things that can serve as the subjects or objects of statements involving those properties (such as specifying that the value of an exterms:age property should always be an xsd:integer).
  • 和牵涉到那些属性并可以作为陈述中的主体和客体的事物的类型的词汇表(比如:通常用xsd:integer词汇表来确定属性“exterms:age”的值)。


The basis for describing such vocabularies in RDF is the RDF Vocabulary Description Language 1.0: RDF Schema (http://www.w3.org/TR/rdf-schema/) [RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)], which will be described in Section 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema).
在RDF中描述这类词汇表是依据RDF Vocabulary Description Language 1.0: RDF Schema (http://www.w3.org/TR/rdf-schema/) ] [RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)],这将在第5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)做介绍。
Additional background on the basic ideas underlying RDF, and its role in providing a general language for describing Web information, can be found in [WEBDATA (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-webdata)]. RDF draws upon ideas from knowledge representation, artificial intelligence, and data management, including Conceptual Graphs, logic-based knowledge representation, frames, and relational databases. Some possible sources of background information on these subjects include [SOWA (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-sowa)], [CG (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-cg)], [KIF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-kif)], [HAYES (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-hayes)], [LUGER (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-luger)], and [GRAY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-gray)].
另外,RDF基本思想的背景知识和它在提供一种能描述Web上信息的语言中扮演的角色,这一点可以在[WEBDATA (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-webdata)]中找到。RDF从知识表示,人工智能和数据管理领域中借鉴了一些思想,具体包括:概念图(Conceptual Graphs),基于逻辑的知识表示(logic-based knowledge representation),框架(frames),关系数据库(relational databases)。关于这些学科的背景知识可能的资料来源包括:[SOWA (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-sowa)],[CG (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-cg)],[KIF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-kif)],[HAYES (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-hayes)],[LUGER (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-luger)], and [GRAY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-gray)]。

3. An XML Syntax for RDF: RDF/XML

3. 表示RDF的XML语法: RDF/XML


As described in Section 2, RDF's conceptual model is a graph. RDF provides an XML syntax for writing down and exchanging RDF graphs, called RDF/XML. Unlike triples, which are intended as a shorthand notation, RDF/XML is the normative syntax for writing RDF. RDF/XML is defined in the RDF/XML Syntax Specification (http://www.w3.org/TR/rdf-syntax-grammar/) [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]. This section describes this RDF/XML syntax.

如第2部分所描述的,RDF的概念模型是一张图(graph)。RDF提供了一种被称为RDF/XML的XML语法来书写和交换RDF图。与RDF的简略记法——三元组(triples)不同,RDF/XML是书写RDF的规范性语法(normative syntax)。RDF/XML定义于RDF/XML语法规范 (http://www.w3.org/TR/rdf-syntax-grammar/)[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]。本节描述RDF/XML的语法。

3.1 Basic Principles

3.1 基本原理


The basic ideas behind the RDF/XML syntax can be illustrated using some of the examples presented already. Take as an example the English statement:

RDF/XML语法的基本思想可以通过前面的一些例子来说明。以下面这句英文为例:

http://www.example.org/index.html has a creation-date whose value is August 16, 1999

The RDF graph for this single statement, after assigning a URIref to the creation-date property, is shown in Figure 11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure11):

上面这个陈述可以用RDF图来表示(其中的creation-date属性已指定了URIref),如图11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure11)所示:

fig11dec16.png

图11: 描述一个网页的创建日期(Creation Date)

with a triple representation of:
用三元组表示就是:

ex:index.html exterms:creation-date "August 16, 1999" .

(Note that a typed literal is not used for the date value in this example. Representing typed literals in RDF/XML will be described later in this section.)

(注意:在这个例子中没有用类型文字(typed literal)作为日期的值。类型文字在RDF/XML中的表示将在后面描述)

例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2) shows the RDF/XML syntax corresponding to the graph in 图11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure11):

例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2) 显示了图11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure11)所对应的RDF/XML语法:

Example 2: RDF/XML for the Web Page's Creation Date
例2:描述网页创建日期的RDF/XML

1. <?xml version="1.0"?>
2. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3. xmlns:exterms="http://www.example.org/terms/">

4. <rdf:Description rdf:about="http://www.example.org/index.html">
5. <exterms:creation-date>August 16, 1999</exterms:creation-date>
6. </rdf:Description>

7. </rdf:RDF>

(Line numbers are added to help in explaining the example.)
(加入行号仅仅是为了便于解释例子,RDF/XML中并不包含行号)

This seems like a lot of overhead. It is easier to understand what is going on by considering each part of this XML in turn (a brief introduction to XML is provided in Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)).

看起来有些摸不着头脑(a lot of overhead),依次考虑该XML的各个部分将利于理解其作用。(附录B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)提供了一个关于XML的简单介绍)。

Line 1, <?xml version="1.0"?>, is the XML declaration, which indicates that the following content is XML, and what version of XML it is.
第1行是XML声明(XML declaration):<?xml version="1.0"?>。它表明以下内容将是XML,XML版本号是1.0。

Line 2 begins an rdf:RDF element. This indicates that the following XML content (starting here and ending with the </rdf:RDF> in line 7) is intended to represent RDF. Following the rdf:RDF on this same line is an XML namespace declaration, represented as an xmlns attribute of the rdf:RDF start-tag. This declaration specifies that all tags in this content prefixed with rdf: are part of the namespace identified by the URIref http://www.w3.org/1999/02/22-rdf-syntax-ns#. URIrefs beginning with the string http://www.w3.org/1999/02/22-rdf-syntax-ns# are used for terms from the RDF vocabulary.

第2行以rdf:RDF元素开始。它表明以下XML内容(从这里开始,直到第7行的</rdf:RDF>为止)用于表达RDF。同一行紧随rdf:RDF其后的是XML命名空间声明(XML namespace declaration),即rdf:RDF首标签的xmlns属性。该声明指明在当前内容中出现的所有前缀为rdf:的标签都属于由下列URIref所标识的命名空间:http://www.w3.org/1999/02/22-rdf-syntax-ns# 。以http://www.w3.org/1999/02/22-rdf-syntax-ns# 打头的URIrefs用于标识来自RDF词汇表中的术语。

Line 3 specifies another XML namespace declaration, this time for the prefix exterms:. This is expressed as another xmlns attribute of the rdf:RDF element, and specifies that the namespace URIref http://www.example.org/terms/ is to be associated with the exterms: prefix. URIrefs beginning with the string http://www.example.org/terms/ are used for terms from the vocabulary defined by the example organization, example.org. The ">" at the end of line 3 indicates the end of the rdf:RDF start-tag. Lines 1-3 are general "housekeeping" necessary to indicate that this is RDF/XML content, and to identify the namespaces being used within the RDF/XML content.

第3行是另一个XML命名空间声明(关于前缀exterms:的)。该声明用rdf:RDF元素的另一个xmlns属性来表示。它指明前缀exterms:与命名空间URIref http://www.example.org/terms/ 关联。以http://www.example.org/terms/ 开始的URIrefs用于由example组织(example.org)[译注:example组织为本文档所举示例]定义的词汇表中的术语。第3行末尾的">"符号表明rdf:RDF首标签的结束。第1至3行是常规的、必备的部分,用以表明当前的内容是RDF/XML,并声明内容中所使用的命名空间。

Lines 4-6 provide the RDF/XML for the specific statement shown in Figure 11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure11). An obvious way to talk about any RDF statement is to say it is a description, and that it is about the subject of the statement (in this case, about http://www.example.org/index.html), and this is the way RDF/XML represents the statement. The rdf:Description start-tag in line 4 indicates the start of a description of a resource, and goes on to identify the resource the statement is about (the subject of the statement) using the rdf:about attribute to specify the URIref of the subject resource. Line 5 provides a property element, with the QName exterms:creation-date as its tag, to represent the predicate and object of the statement. The QName exterms:creation-date is chosen so that appending the local name creation-date to the URIref of the exterms: prefix (http://www.example.org/terms/) gives the statement's predicate URIref http://www.example.org/terms/creation-date. The content of this property element is the object of the statement, the plain literal August 19, 1999 (the value of the creation-date property of the subject resource). The property element is nested within the containing rdf:Description element, indicating that this property applies to the resource specified in the rdf:about attribute of the rdf:Description element. Line 6 indicates the end of this particular rdf:Description element.

第4-6行是Figure 11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure11)中所示陈述的RDF/XML主要部分。谈及RDF陈述时,显而易见,陈述是一种“description(描述)”。并且,它是一种“about(有关)”陈述主体的描述(在本例中,是有关 http://www.example.org/index.html 的描述)。RDF/XML表示陈述的方式正是如此。第4行中rdf:Description的起始标签表明某个资源描述的开始,然后标识了陈述所“about(针对)”的资源(也就是陈述的主体)。RDF/XML采用了 rdf:about 属性来指定主体资源的URIref。第5行用QName exterms:creation-date作为标签,提供了“属性元素(property element)”,来表示谓词以及陈述的客体。选择QName exterms:creation-date,可以将本地名称creation-date 扩展为http://www.example.org/terms/creation-date ,这个属性元素(property element )的内容就是陈述的客体-即平凡文字“August 19, 1999 ”(主体资源的creation-date 属性的值)。属性元素(property element)在rdf:Description 元素所包含内容中以嵌套的形式存在,意味着该属性(property )应用于rdf:Description 元素的rdf:about 属性(attribute)所指定的资源。第6行表明这个rdf:Description 到此结束。

Finally, Line 7 indicates the end of the rdf:RDF element started on line 2. Using an rdf:RDF element to enclose RDF/XML content is optional in situations where the XML can be identified as RDF/XML by context. This is discussed further in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]. However, it does not hurt to provide the rdf:RDF element in any case, and Primer examples will generally (but not always) provide one.

最后,第7行表明从第2行开始的rdf:RDF元素到此结束。在能够通过上下文确定XML内容为RDF/XML的情况下,可以不用rdf:RDF元素来包括RDF/XML的内容。这在[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]中将进一步讨论。但是,使用rdf:RDF元素在任何情况下均没有坏处,本文档中的示例一般都会(但并不总是)使用rdf:RDF元素。

Example 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2) illustrates the basic ideas used by RDF/XML to encode an RDF graph as XML elements, attributes, element content, and attribute values. The URIrefs of predicates (as well as some nodes) are written as XML QNames, consisting of a short prefix denoting a namespace URI, together with a local name denoting a namespace-qualified element or attribute, as described in Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents). The (namespace URIref, local name) pair is chosen so that concatenating them forms the URIref of the original node or predicate. The URIrefs of subject nodes are written as XML attribute values (URIrefs of object nodes may sometimes be written as attribute values as well). Literal nodes (which are always object nodes) become element text content or attribute values. (Many of these options are described later in the Primer; all of these options are described in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].)

例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2)展示了RDF/XML如何把一个RDF图编码为XML元素、属性、元素内容和属性值的基本思想。谓词(以及一些结点)的URIrefs被写作XML QNames,即包含一个简短的前缀(prefix)(代表命名空间URI)和一个内部名(local name)(代表命名空间中的元素或属性)(详见附录B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents))。对于一个(命名空间URIref,内部名)对,将命名空间URIref和内部名连接起来将形成结点或谓词的URIref(像图11中的那样)。主体结点(subject nodes)的URIrefs被写为XML属性值(客体结点(object nodes)的URIrefs有时也可被写为属性值)。文字结点(Literal nodes)(总是客体结点)写为元素的文本内容或属性值。(本文档后面的部分将对这里的部分写法作进一步描述;关于所有写法的描述,请参见[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]。)

An RDF graph consisting of multiple statements can be represented in RDF/XML by using RDF/XML similar to Lines 4-6 in Example 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2) to separately represent each statement. For example, to write the following two statements:

对于包含多个陈述的RDF图可以用下面RDF/XML方式书写:用类似于例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2)中第4至6行的方式分别表示RDF图中的各个陈述。举例来说,对于下面两个陈述:

ex:index.html exterms:creation-date "August 16, 1999" .
ex:index.html dc:language "en" .

the RDF/XML in Example 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3) could be used:

可以用例3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3)中的RDF/XML来表示:

Example 3: RDF/XML for Two Statements
例3: 表达两条陈述的RDF/XML
1. <?xml version="1.0"?>
2. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3. xmlns:dc="http://purl.org/dc/elements/1.1/"
4. xmlns:exterms="http://www.example.org/terms/">

5. <rdf:Description rdf:about="http://www.example.org/index.html">
6. <exterms:creation-date>August 16, 1999</exterms:creation-date>
7. </rdf:Description>

8. <rdf:Description rdf:about="http://www.example.org/index.html">
9. <dc:language>en</dc:language>
10. </rdf:Description>

11. </rdf:RDF>

Example 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3) is the same as Example 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2), with the addition of a second rdf:Description element (in lines 8-10) to represent the second statement. (An additional namespace declaration is also given in line 3 to identify the additional namespace used in this statement.) An arbitrary number of additional statements could be written in the same way, using a separate rdf:Description element for each additional statement. As Example 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3) illustrates, once the overhead of writing the XML and namespace declarations is dealt with, writing each additional RDF statement in RDF/XML is both straightforward and not too complicated.

例3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3)例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2)一样,只是多了一个表达第二条陈述的rdf:Description元素(第8至10行)。(第3行给出了另一个命名空间声明,以标识在第二条陈述中用到的命名空间)。可以用同样的方式添加任意多个陈述,只需对每条陈述分别使用一个rdf:Description元素。如例3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3)所示,一旦完成了书写XML和命名空间声明,RDF/XML中各个RDF陈述的书写将简单明了。

The RDF/XML syntax provides a number of abbreviations to make common uses easier to write. For example, it is typical for the same resource to be described with several properties and values at the same time, as in Example 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3), where the resource ex:index.html is the subject of several statements. To handle such cases, RDF/XML allows multiple property elements representing those properties to be nested within the rdf:Description element that identifies the subject resource. For example, to represent the following group of statements about http://www.example.org/index.html:

RDF/XML语法提供了若干种简略表达形式以便于书写。比如在例3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example3)中,用多个属性和属性值来描述同一资源,这里资源ex:index.html同时作为多个陈述的主体(subject)。在这种情况下,RDF/XML允许在标识该主体的rdf:Description元素下嵌入多个属性元素来表达属性。比如,要表达下列一组关于资源http://www.example.org/index.html的陈述:

ex:index.html dc:creator exstaff:85740 .
ex:index.html exterms:creation-date "August 16, 1999" .
ex:index.html dc:language "en" .

whose graph (the same as Figure 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3)) is shown in Figure 12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure12):
它所对应的RDF图(和图3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure3)相同)如图12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure12)所示:

fig3nov19.png
Figure 12: Several Statements About the Same Resource
图12:关于同一资源的多个陈述

the RDF/XML shown in Example 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example4) could be written:
例4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example4)是它所对应的RDF/XML:

Example 4: Abbreviating Multiple Properties
例4: 简略表达多个属性

1. <?xml version="1.0"?>
2. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3. xmlns:dc="http://purl.org/dc/elements/1.1/"
4. xmlns:exterms="http://www.example.org/terms/">

5. <rdf:Description rdf:about="http://www.example.org/index.html">
6. <exterms:creation-date>August 16, 1999</exterms:creation-date>
7. <dc:language>en</dc:language>
8. <dc:creator rdf:resource="http://www.example.org/staffid/85740"/>
9. </rdf:Description>

10. </rdf:RDF>

Compared with the previous two examples, Example 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example4) adds an additional dc:creator property element (in line 8). In addition, the property elements for the three properties whose subject is http://www.example.org/index.html are nested within a single rdf:Description element identifying that subject, rather than writing a separate rdf:Description element for each statement.

与前面两个例子相比,例4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example4)中多了一个dc:creator属性元素(在第8行)[译注//属性元素(property element)指表示RDF中的属性(property)的XML元素(XML element)]。另外,三个属性元素(表达主体http://www.example.org/index.html的三个属性)都嵌在同一个rdf:Description元素(标识主体http://www.example.org/index.html)里,而不是为各个陈述单独写一个rdf:Description元素。

Line 8 also introduces a new form of property element. The dc:language element in line 7 is similar to the exterms:creation-date element used in Example 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2). Both these elements represent properties with plain literals as property values, and such elements are written by enclosing the literal within start- and end-tags corresponding to the property name. However, the dc:creator element on line 8 represents a property whose value is another resource, rather than a literal. If the URIref of this resource were written as a plain literal within start- and end-tags in the same way as the literal values of the other elements, this would say that the value of the dc:creator element was the character string http://www.example.org/staffid/85740, rather than the resource identified by that literal interpreted as a URIref. In order to indicate the difference, the dc:creator element is written using what XML calls an empty-element tag (it has no separate end-tag), and the property value is written using an rdf:resource attribute within that empty element. The rdf:resource attribute indicates that the property element's value is another resource, identified by its URIref. Because the URIref is being used as an attribute value, RDF/XML requires the URIref to be written out (as an absolute or relative URIref), rather than abbreviating it as a QName as was done in writing element and attribute names (absolute and relative URIrefs are discussed in Appendix A (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers)).

第8行引入了一种新的属性元素形式。第7行中的dc:language元素与例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2)中的exterms:creation-date元素类似,他们都是用平凡文字(plain literal)来表示属性的值,并且都用与属性名称(property name)对应的首标签(start-tag)和尾标签(end-tag)将上述文字括起来。然而,第8行中的dc:creator元素表示一个属性值为另一个资源(而不是平凡文字)的属性。如果把该资源的URIref写成被括在首标签和尾标签中的平凡文字(像前两个元素那样),这将表示dc:creator元素的值是字符串http://www.example.org/staffid/85740,而不是由该字符串代表的URIref所标识的资源。为了表明这一区别,dc:creator元素被写成空元素标签(empty-element tag)(即没有尾标签)的形式,同时用一个rdf:resource属性(attribute)来表达属性的值(property value)。rdf:resource属性(attribute)表明属性元素(property element)的值是另一个用URIref标识资源(resource)。由于该URIref要作为属性(attribute),RDF/XML要求这个URIref必须被写成绝对URIref或相对URIref的形式,而不能像写元素(element name)或属性(attribute name)那样被简略为QName(关于绝对URIref和相对URIref,请参见附录A (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#identifiers))。

It is important to understand that the RDF/XML in Example 4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example4) is an abbreviation. The RDF/XML in Example 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example5), in which each statement is written separately, describes exactly the same RDF graph (the graph of Figure 12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure12)):

例4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example4)中的RDF/XML是一种简略形式,理解这一点很重要。例5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example5)是描述同一个RDF图(图12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure12))的RDF/XML,其中各个陈述被分开书写:

Example 5: Writing Example 4 as Separate Statements
例5:用分开的陈述书写例4

 <?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:exterms="http://www.example.org/terms/">
   <rdf:Description rdf:about="http://www.example.org/index.html">
<exterms:creation-date>August 16, 1999</exterms:creation-date>
</rdf:Description>
   <rdf:Description rdf:about="http://www.example.org/index.html">
<dc:language>en</dc:language>
</rdf:Description>
   <rdf:Description rdf:about="http://www.example.org/index.html">
<dc:creator rdf:resource="http://www.example.org/staffid/85740"/>
</rdf:Description>
 </rdf:RDF>

The following sections will describe a few additional RDF/XML abbreviations. [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)] provides a more thorough description of the abbreviations that are available.
下面部分将描述另外一些RDF/XML简略形式。[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]提供了关于所有简略形式的更全面的描述

RDF/XML can also represent graphs that include nodes that have no URIrefs, i.e., the blank nodes described in Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties). For example, Figure 13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure13) (taken from [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]) shows a graph saying "the document 'http://www.w3.org/TR/rdf-syntax-grammar' has a title 'RDF/XML Syntax Specification (Revised)' and has an editor, the editor has a name 'Dave Beckett' and a home page 'http://purl.org/net/dajobe/' ".
RDF/XML同样可以表示包含空白结点(blank node)(即没有URIref的结点,详见2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties))的图。比如,图13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure13)(取自[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)])显示了一个表达下列信息的图:“文档'http://www.w3.org/TR/rdf-syntax-grammar'有一个title(标题)('RDF/XML Syntax Specification (Revised)')和一个editor(编者),而editor的name(姓名)为'Dave Beckett'、home page(主页)为'http://purl.org/net/dajobe/'”。

fig13dec16.png
Figure 13: A Graph Containing a Blank Node
图13:一个包含空白结点的图

This illustrates an idea discussed in Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties): the use of a blank node to represent something that does not have a URIref, but can be described in terms of other information. In this case, the blank node represents a person, the editor of the document, and the person is described by his name and home page.
上面的例子展示了2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties)中曾讨论过的想法,即用一个空白结点(blank node)来表示某个没有URIref、但可用其它信息来描述的事物。在上面的例子中,该空白结点表示一个人,即文档的editor(编者),这个人是用他的name(姓名)和homepage(主页)来描述的。

RDF/XML provides several ways to represent graphs containing blank nodes. These are all described in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]. The approach illustrated here, which is the most direct approach, is to assign a blank node identifier to each blank node. A blank node identifier serves to identify a blank node within a particular RDF/XML document but, unlike a URIref, is unknown outside the document in which it is assigned. A blank node is referred to in RDF/XML using an rdf:nodeID attribute, with a blank node identifier as its value, in places where the URIref of a resource would otherwise appear. Specifically, a statement with a blank node as its subject can be written in RDF/XML using an rdf:Description element with an rdf:nodeID attribute instead of an rdf:about attribute. Similarly, a statement with a blank node as its object can be written using a property element with an rdf:nodeID attribute instead of an rdf:resource attribute. Using rdf:nodeID, Example 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example6) shows the RDF/XML corresponding to Figure 13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure13):
RDF/XML提供了多种方式来表示包含空白结点的图。[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]描述了所有这些方式。这里所描述的方式是其中最直接的一种,即为各个空白结点指定一个空白结点标识符(blank node identifier)。空白结点标识符用于标识某个特定RDF/XML文档内部的一个空白结点。但是与URIref不同,空白结点标识符在所属文档外部是不可识别的[译注//即仅在它被指定为空白结点标识符的那个文档内有效]。在RDF/XML中,所有可以出现资源URIref的地方都可以用rdf:nodeID属性(attribute)来引用空白结点(用一个空白结点标识符作为该属性的值)。 具体地,一个以空白结点为主体的陈述,在RDF/XML中可以用一个拥有rdf:nodeID(而不是rdf:about)属性(attribute)的rdf:Description元素来描述。同样地,一个以空白结点为客体的陈述可以用一个拥有rdf:nodeID(而不是rdf:resource)属性(attribute)的属性元素(property element)来描述。例6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example6)展示了如何用rdf:nodeID来描述图13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure13)对应的RDF/XML:

Example 6: RDF/XML Describing a Blank Node
例6:描述空白结点的RDF/XML

1. <?xml version="1.0"?>
2. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3. xmlns:dc="http://purl.org/dc/elements/1.1/"
4. xmlns:exterms="http://example.org/stuff/1.0/">

5. <rdf:Description rdf:about="http://www.w3.org/TR/rdf-syntax-grammar">
6. <dc:title>RDF/XML Syntax Specification (Revised)</dc:title>
7. <exterms:editor rdf:nodeID="abc"/>
8. </rdf:Description>

9. <rdf:Description rdf:nodeID="abc">
10. <exterms:fullName>Dave Beckett</exterms:fullName>
11. <exterms:homePage rdf:resource="http://purl.org/net/dajobe/"/>
12. </rdf:Description>

13. </rdf:RDF>

In Example 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example6), the blank node identifier abc is used in line 9 to identify the blank node as the subject of several statements, and is used in line 7 to indicate that the blank node is the value of a resource's exterms:editor property. The advantage of using a blank node identifier over some of the other approaches described in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)] is that using a blank node identifier allows the same blank node to be referred to in more than one place in the same RDF/XML document.

例6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example6)中,第9行使用空白结点标识符abc来标识作为多个陈述的主体的空白结点,然后在第7行中利用该空白结点标识符来表明它所对应的空白结点是某个资源的exterms:editor属性(property)。相对于[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]中描述的其它方式而言,使用空白结点标识符的优点是可以在一个RDF/XML文档中多次引用同一个空白结点


Finally, the typed literals described in Section 2.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals) may be used as property values instead of the plain literals used in the examples so far. A typed literal is represented in RDF/XML by adding an rdf:datatype attribute specifying a datatype URIref to the property element containing the literal.

最后,2.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals)中介绍的类型文字(typed literals)可以替代前面例子中的平凡文字(plain literals)作为属性的值(property values)。类型文字(typed literal)在RDF/XML中的表示方法为:为包含该文字的属性元素(property element)增加一个rdf:datatype属性(attribute),并通过该属性指定数据类型的URIref。

For example, to change the statement in Example 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2) to use a typed literal instead of a plain literal for the exterms:creation-date property, the triple representation would be:
比如,将例2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example2)中的陈述改为用类型文字而不是平凡文字来作为exterms:creation-date属性的值(property values),那么三元组将这样书写:

ex:index.html exterms:creation-date "1999-08-16"^^xsd:date .

它所对应的RDF/XML如例7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7)所示:

Example 7: RDF/XML Using a Typed Literal
例7:使用类型文字的RDF/XML

1. <?xml version="1.0"?>
2. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3. xmlns:exterms="http://www.example.org/terms/">

4. <rdf:Description rdf:about="http://www.example.org/index.html">
5. <exterms:creation-date rdf:datatype=

         "http://www.w3.org/2001/XMLSchema#date">1999-08-16
</exterms:creation-date>

6. </rdf:Description>

7. </rdf:RDF>

In line 5 of Example 7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7), a typed literal is given as the value of the exterms:creation-date property element by adding an rdf:datatype attribute to the element's start-tag to specify the datatype. The value of this attribute is the URIref of the datatype, in this case, the URIref of the XML Schema date datatype. Since this is an attribute value, the URIref must be written out, rather than using the QName abbreviation xsd:date used in the triple. A literal appropriate to this datatype is then written as the element content, in this case, the literal 1999-08-16, which is the literal representation for August 16, 1999 in the XML Schema date datatype.

例7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7)中,在第5行给出的exterms:creation-date属性元素(property element)的值是一个类型文字(而不是平凡文字),这是通过为exterms:creation-date元素的首标签(start-tag)增加一个rdf:datatype属性(attribute)并由此指定数据类型实现的。rdf:datatype属性(attribute)的值应是某个数据类型的URIref,在本例中它是XML Schema中的date数据类型的URIref。作为属性值(attribute value),URIref必须被写全[译注//即写为相对URIref或绝对URIref],而不是像在三元组中那样写出它的QName形式xsd:date。用一个正确的数据类型文字作为元素内容(element content),在本例中是文字1999-08-16,即用XML Schema中的date数据类型表示的一个代表1999年8月16日的文字。

In the rest of the Primer, the examples will use typed literals from appropriate datatypes rather than plain (untyped) literals, in order to emphasize the value of typed literals in conveying more information about the intended interpretation of literal values. (The exceptions will be that plain literals will continue to be used in examples taken from actual applications that do not currently use typed literals, in order to accurately reflect the usage in those applications.) In RDF/XML, both plain and typed literals (and, with certain exceptions, tags) can contain Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] characters, allowing information from many languages to be directly represented.
在本文档下面的示例中,我们将避免使用平凡文字(无类型的),而是使用具有正确数据类型(datatype)的类型文字(typed literals)。这样做的目的在于强调类型文字可以传递更多关于文字值(literal values)解释的信息。(但下列情况例外,即示例取自实际应用,而在该实际应用中没有使用类型文字。在这种情况下,示例将保留原应用中的平凡文字,以精确反映RDF在该应用中的用法。)在RDF/XML中,平凡文字和类型文字(以及某些例外情况下的标签(tag))都可以包含Unicode[UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)]字符,以允许直接表达多语言的信息。

Example 7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7) illustrates that using typed literals requires writing an rdf:datatype attribute with a URIref identifying the datatype for each element whose value is a typed literal. As noted earlier, RDF/XML requires that URIrefs used as attribute values must be written out, rather than abbreviated as a QName. XML entities can be used in RDF/XML to improve readability in such cases, by providing an additional abbreviation facility for URIrefs. Essentially, an XML entity declaration associates a name with a string of characters. When the entity name is referenced elsewhere within an XML document, XML processors replace the reference with the corresponding string. For example, the ENTITY declaration (specified as part of a DOCTYPE declaration at the beginning of the RDF/XML document):

例7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7)举例说明了使用类型文字需要为每一个元素值为类型文字的元素书写一个rdf:datatype属性(attribute),并用一个标识具体数据类型的URIref作为属性值。如前面提到的,RDF/XML要求用作属性值(attribute value)的URIrefs必须书写完整,而不能写成QName形式。在这种情况下,RDF/XML允许使用XML 实体(entities)以提高可读性,即为URIrefs提供一个另外的简写形式。XML实体声明的本质是将一个XML名称(XML name)与一个字符串相关联。如果实体名在XML文档中被引用,XML处理器(XML processors)将用相应的字符串来替换该引用。比如,下列ENTITY声明(被写在RDF/XML文档头部的DOCTYPE声明中):

<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>

defines the entity xsd to be the string representing the namespace URIref for XML Schema datatypes. This declaration allows the full namespace URIref to be abbreviated elsewhere in the XML document by the entity reference &xsd;. Using this abbreviation, Example 7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7) could also be written as shown in Example 8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example8).

把实体xsd定义为一个代表命名空间URIref(对应于XML Schema数据类型的命名空间)的字符串。这一声明使得完整的命名空间URIref可在XML文档中被简略为实体引用&xsd;。在例7 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example7)中使用上述简略形式便可得到例8 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example8).

Example 8: RDF/XML Using a Typed Literal and an XML Entity
例8: 使用类型文字和XML实体的RDF/XML

1. <?xml version="1.0"?>
2. <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>

3. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4. xmlns:exterms="http://www.example.org/terms/">

5. <rdf:Description rdf:about="http://www.example.org/index.html">
6. <exterms:creation-date rdf:datatype="&xsd;date">1999-08-16

       </exterms:creation-date>

7. </rdf:Description>

8. </rdf:RDF>

The DOCTYPE declaration in line 2 defines the entity xsd, which is used in line 6.
第2行中的DOCTYPE声明定义了实体xsd,该实体被用在第6行中。

The use of XML entities as an abbreviation mechanism is optional in RDF/XML, and hence the use of an XML DOCTYPE declaration is also optional in RDF/XML. (For readers familiar with XML, RDF/XML is only required to be "well-formed" XML. RDF/XML is not designed to be validated against a DTD by a validating XML processor. This is discussed more fully in Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents), which provides additional information about XML.)

是否在RDF/XML中用XML实体作为简略机制是可选的,因此是否在RDF/XML中使用XML DOCTYPE声明也是可选的。(对于熟悉XML的读者,RDF/XML只需是“良构的(well-formed)”XML。RDF/XML没有被设计为将用验证型XML处理器(validating XML processor)验证它对于某个DTD的有效性。附录B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)将对此作全面论述,并提供了关于XML的更多信息。 )

For readability purposes, examples in the rest of the Primer will use the XML entity xsd as just described. XML entities are discussed further in Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents). As illustrated in Appendix B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents), other URIrefs (and, more generally, other strings) can also be abbreviated using XML entities. However, the URIrefs for XML Schema datatypes are the only ones that will be abbreviated in this way in Primer examples.

出于可读性考虑,本文剩余部分的示例将使用XML实体xsd(如前面描述的那样)。附录B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)将对XML实体作进一步讨论。如附录B (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#documents)的说明,其他URIrefs(而且更一般地,字符串)也可以被简略为使用XML实体。然而,在本文档的示例中,我们仅对XML Schema数据类型采用这种简略方式。

Although additional abbreviated forms for writing RDF/XML are available, the facilities illustrated so far provide a simple but general way to express graphs in RDF/XML. Using these facilities, an RDF graph is written in RDF/XML as follows:

尽管还有其他用于书写RDF/XML的简略形式,但到目前为止所介绍的方法提供了一种简单而一般的用RDF/XML来表达RDF图的方法。要应用这些方法,一个RDF图可以这样书写RDF/XML:

  • All blank nodes are assigned blank node identifiers.
  • 所有空白结点(blank nodes)被指定空白结点标识符(blank node identifiers)。
  • Each node is listed in turn as the subject of an un-nested rdf:Description element, using an rdf:about attribute if the node has a URIref, or an rdf:nodeID attribute if the node is blank.

For each triple with this node as subject, an appropriate property element is created, with either literal content (possibly empty), an rdf:resource attribute specifying the object of the triple (if the object node has a URIref), or an rdf:nodeID attribute specifying the object of the triple (if the object node is blank).

  • 依次列出各个结点,将它作为一个非嵌套的rdf:Description元素的主体(subject)。若该结点有URIref,则rdf:Description元素使用rdf:about属性(attribute);若该结点是空结点,则rdf:Description元素使用rdf:nodeID属性(attribute)。

对于各个以该结点作为主体(subject)的三元组(triple),创建一个正确的属性元素(property element)。该属性元素或者是元素内容(element content)为文字(literal)(可能为空)、或者是有一个指定该三元组的客体(object)的rdf:resource属性(attribute)(对于客体有URIref的情况)、或者是有一个指定该三元组的客体的rdf:nodeID属性(attribute)(对于客体结点为空结点的情况)。

Compared to some of the more abbreviated approaches described in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)], this simple approach provides the most direct representation of the actual graph structure, and is particularly recommended for applications in which the output RDF/XML is to be used in further RDF processing.
与更多在[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]中描述的简略方法相比,上述这种简单的方式提供了实际图结构的最直接的表示。另外,如果应用中的输出RDF/XML将在进一步的RDF处理中被使用的话,这种方式是特别推荐的。

3.2 Abbreviating and Organizing RDF URIrefs

3.2 简写与组织RDF URIrefs


So far, the examples have assumed that the resources being described have been given URIrefs already. For instance, the initial examples provided descriptive information about example.org's Web page, whose URIref was http://www.example.org/index.html. This resource was identified in RDF/XML using an rdf:about attribute citing its full URIref. Although RDF does not specify or control how URIrefs are assigned to resources, sometimes it is desirable to achieve the effect of assigning URIrefs to resources that are part of an organized group of resources. For example, suppose a sporting goods company, example.com, wanted to provide an RDF-based catalog of its products, such as tents, hiking boots, and so on, as an RDF/XML document, identified by (and located at) http://www.example.com/2002/04/products. In that resource, each product might be given a separate RDF description. This catalog, along with one of these descriptions, the catalog entry for a model of tent called the "Overnighter", might be written in RDF/XML as shown in Example 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9):

到目前为止,所有的示例都假定所描述资源已指派了URIrefs。比如,前面的几个例子提 供了关于example.org网页的描述性信息,该网页的URIref为 http://www.example.org/index.html。在RDF/XML中,这个资源(resource)的标识是通 过使用一个rdf:about属性(attribute)并用资源的URIref作为属性值实现的。尽管RDF并 没有规定或限定如何为资源(resources)指派URIrefs,有时希望为一些有组织的资源指派

URIrefs。比如,设想一个运动产品公司example.com要为它的产品(比如帐篷、旅行鞋等

等)提供一个基于RDF的目录,该目录是一个RDF/XML文档,用

http://www.example.com/2002/04/products来对它进行标识和定位。在该资源中,各个产品 可能会有一个单独的RDF描述。20040210/#example9 例9 (http://www.w3.org/TR/2004/REC-rdf-primer-)所示的RDF/XML描述了这个产品目录和一种型号为 “Overnighter”的帐篷所对应的目录项及其描述:

Example 9: RDF/XML for example.com's Catalog
例9:example.com产品目录的RDF/XML

1. <?xml version="1.0"?>
2. <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
3. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4. xmlns:exterms="http://www.example.com/terms/">

5. <rdf:Description rdf:ID="item10245">
6. <exterms:model rdf:datatype="&xsd;string">Overnighter</exterms:model>
7. <exterms:sleeps rdf:datatype="&xsd;integer">2</exterms:sleeps>
8. <exterms:weight rdf:datatype="&xsd;decimal">2.4</exterms:weight>
9. <exterms:packedSize rdf:datatype="&xsd;integer">784</exterms:packedSize>
10. </rdf:Description>

  ...other product descriptions...

11. </rdf:RDF>

Example 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9) is similar to previous examples in the way it represents the properties (model, sleeping capacity, weight) of the resource (the tent) being described. (The surrounding xml, DOCTYPE, RDF, and namespace information is included in lines 1 through 4, and line 11, but this information would only need to be provided once for the whole catalog, not repeated for each entry in the catalog. Note also that although the datatypes associated with the various property values are given explicitly, the units associated with some of these property values are not, even though this information should be available to properly interpret the values. Representing units and similar information that may be associated with property values is discussed in Section 4.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfvalue). In this example, the value of exterms:sleeps is the number of persons the tent can sleep, the value of exterms:weight is given in kilograms, and the value of exterms:packedSize is given in square centimeters, the area the tent occupies on a backpack.)

例9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9)与前面的例子 类似,它们都表示正被描述的资源(tent)的属性(properties),如型号(model)、大小 (sleeping capacity)、重量(weight)等。(第1至4行及第11行的XML、DOCTYPE、RDF 和命名空间信息等只需要为整个产品目录书写一次,不需要为目录中的各个产品重复书写。 注意:尽管与不同属性的值(property values)关联的数据类型(datatypes)是显 式给出的,但是与一些属性值相关的单位(units)则没有被显示给出,而这些信息对 于正确地解释这些属性值是需要的。20040210/#rdfvalue 4.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-)论述了可与属性的值(property values)关联的表示单元的 (及类似的)信息。在本例中,exterms:sleeps的值表示帐篷能睡下几个人, exterms:weight的值用公斤(kilograms)给出,exterms:packedSize的值用平方厘米 (square centimeters)给出,它表示帐篷在旅行背包中占用的面积。

An important difference from previous examples is that, in line 5, the rdf:Description element has an rdf:ID attribute instead of an rdf:about attribute. Using rdf:ID specifies a fragment identifier, given by the value of the rdf:ID attribute (item10245 in this case, which might be the catalog number assigned by example.com), as an abbreviation of the complete URIref of the resource being described. The fragment identifier item10245 will be interpreted relative to a base URI, in this case, the URI of the containing catalog document. The full URIref for the tent is formed by taking the base URI (of the catalog), and appending the character "#" (to indicate that what follows is a fragment identifier) and then item10245 to it, giving the absolute URIref

http://www.example.com/2002/04/products#item10245.

与前面例子的一个重要区别在于第5行中的rdf:Description元素,它有一个rdf:ID属 性(attribute)而不是rdf:about属性(attribute)。rdf:ID用于指定一个片断标识符 (fragment identifier)作为资源完整URIref的简略形式,该片断标识符在rdf:ID属 性值(attribute)(在本例中为item10245,它可能是由example.com指定的目录号)中 给出。片断标识符item10245的解析是相对于基准URI(base URI)(在本例中,基准 URI为目录文档的URI)。该帐篷的完整URIref是这样形成的:取(目录的) 基准URI,在后面添加字符“#”(表明后面跟随的是片断标识符)和字符串 “item10245”,这样得到了绝对URIref http://www.example.com/2002/04/products#item10245.

The rdf:ID attribute is somewhat similar to the ID attribute in XML and HTML, in that it defines a name which must be unique relative to the current base URI (in this example, that of the catalog). In this case, the rdf:ID attribute appears to be assigning a name (item10245) to this particular kind of tent. Any other RDF/XML within this catalog could refer to the tent by using either the absolute URIref http://www.example.com/2002/04/products#item10245, or the relative URIref #item10245. The relative URIref would be understood as being a URIref defined relative to the base URIref of the catalog. Using a similar abbreviation, the URIref of the tent could also be given by specifying rdf:about="#item10245" in the catalog entry (i.e., by specifying the relative URIref directly) instead of rdf:ID="item10245" . As an abbreviation mechanism, the two forms are essentially synonyms: the full URIref formed by RDF/XML is the same in either case: http://www.example.com/2002/04/products#item10245. However, using rdf:ID provides an additional check when assigning a set of distinct names, since a given value of the rdf:ID attribute can only appear once relative to the same base URI (the catalog document, in this example). Using either form, example.com would be giving the URIref for the tent in a two-stage process, first assigning the URIref for the whole catalog, and then using a relative URIref in the description of the tent in the catalog to indicate the URIref that has been assigned to this particular kind of tent. Moreover, this use of a relative URIref can be thought of either as being an abbreviation for a full URIref that has been assigned to the tent independently of the RDF, or as being the assignment of the URIref to the tent within the catalog.

这里的rdf:ID属性有些类似XML和HTML中的ID属性(attribute),因为它定义了一个相对于当前基

准URI(在本例中,基准URI是目录的基准URI)[译注//其原因参见

XML Base (http://www.w3.org/TR/2001/REC-xmlbase-20010627/)或其简体中文翻译

[http://xmlbase.w3china.org/ ]]必须唯一的名称。在本例中,rdf:ID属性

(attribute)为这种特定的帐篷指派一个名称(item10245)。同一文档中的其他RDF/XML可以

用两种方式来引用这个帐篷:使用绝对URIref

http://www.example.com/2002/04/products#item10245,或使用相对URIref #item10245。

相对URIref可被理解为一个相对目录的基准URIref定义的URIref。使用同样的简略形式,帐篷的

URIref也可以在目录项中通过使用rdf:about="#item10245"来给出(也就是说,直接给出帐篷的

相对URIref),而不是使用rdf:ID="item10245"。作为一种简略机制,这两种方式本质上是相同

的:RDF/XML在这两种方式下形成的完整URIref完全相同,都是

http://www.example.com/2002/04/products#item10245。但是,使用rdf:ID提供了一种机制,可以在指派

一组互不相同的名称集合时进行检测,因为rdf:ID属性(attribute)给定的值在隶属

同一个基准URI的范围(在本例中为产品目录文档)内只能出现一次。如果用另一种方式的话,

example.com将通过两步给出该帐篷的URIref:首先指定整个产品目录的URIref,然后在产品目

录中的帐篷描述中使用一个相对URIref来表明该帐篷被指派的URIref。另外,相对URIref的使用

可被理解为是对RDF中这个帐篷指派的完整URIref的一种简略形式,也可以被认为是对产品目录

中这个帐篷的URIref的指派。

RDF located outside the catalog could refer to this tent by using the full URIref, i.e., by concatenating the relative URIref #item10245 of the tent to the base URI of the catalog, forming the absolute URIref http://www.example.com/2002/04/products#item10245. For example, an outdoor sports Web site exampleRatings.com might use RDF to provide ratings of various tents. The (5-star) rating given to the tent described in Example 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9) might then be represented on exampleRatings.com's Web site as shown in Example 10 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example10):
位于产品目录外部的RDF可以用完整的URIref(通过连接该帐篷的相对URIref #item10245和

产品目录的基准URI形成绝对URIref http://www.example.com/2002/04/products#item10245)

来引用这个帐篷。例如,一个户外运动网站exampleRatings.com也许会用RDF来提供各种帐篷的

排名。例9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9)所描述的帐篷

被给予的等级为(5-star),这一信息可以在exampleRatings.com网站上由

例10 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example10)所示的RDF/XML来表

示:

Example 10: exampleRatings.com's Rating of the Tent
例10: exampleRatings.com给上述帐篷的等级

1. <?xml version="1.0"?>
2. <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
3. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#"
4. xmlns:sportex="http://www.exampleRatings.com/terms/">

5. <rdf:Description rdf:about="http://www.example.com/2002/04/products#item10245">
6. <sportex:ratingBy rdf:datatype="&xsd;string">Richard Roe</sportex:ratingBy>
7. <sportex:numberStars rdf:datatype="&xsd;integer">5</sportex:numberStars>
8. </rdf:Description>
9. </rdf:RDF>

In Example 10 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example10), line 5 uses an rdf:Description element with an rdf:about attribute whose value is the full URIref of the tent. The use of this URIref allows the tent being referred to in the rating to be precisely identified.
例10 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example10)中,第5行使用的

rdf:Description元素带有一个rdf:about属性(attribute),该属性的值为被描述的帐篷的完

整URIref。使用这个URIref可以精确标识被排名所引用的帐篷。

These examples illustrate several points. First, even though RDF does not specify or control how URIrefs are assigned to resources (in this case, the various tents and other items in the catalog), the effect of assigning URIrefs to resources in RDF can be achieved by combining a process (external to RDF) that identifies a single document (the catalog in this case) as the source for descriptions of those resources, with the use of relative URIrefs in descriptions of those resources within that document. For instance, example.com could use this catalog as the central source where its products are described, with the understanding that if a product's item number is not in an entry in this catalog, it is not a product known to example.com. (Note that RDF does not assume any particular relationship exists between two resources just because their URIrefs have the same base, or are otherwise similar. This relationship may be known to example.com, but it is not directly defined by RDF.)
上面这些例子说明了若干要点。首先,尽管RDF没有规定或限定如何为资源(如本例中的各种帐

篷和其他产品)指派URIrefs,但在RDF中可通过下面的方法获得为资源指派URIrefs的效果

:(在RDF之外)标识一个文档(如本例中的产品目录),并将它作为资源描述的来源;

而在该文档中描述各个资源时使用相对URIref[译注//该相对URIref被作为资源在所属文档范围

内的标识符]。比如,example.com可以将这个产品目录作为描述它的产品的总的来源,如果一个

产品的产品号不在产品目录中的任何条目中出现,那么它就不是一个example.com所知道的产品

。(注意:RDF并不会仅根据两个资源的URIrefs有相同的基准(base)或在某些方面相像而假定

它们之间存在任何特定的关系。也许example.com了解这些关系,但它们没有直接在RDF中定义。


These examples also illustrate one of the basic architectural principles of the Web, which is that anyone should be able to freely add information about an existing resource, using any vocabulary they please [BERNERS-LEE98 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-berners-lee98)]. The examples further illustrate that the RDF describing a particular resource does not need to be located all in one place; instead, it may be distributed throughout the Web. This is true not only for situations like this one, in which one organization is rating or commenting on a resource defined by another, but also for situations in which the original definer of a resource (or anyone else) wishes to amplify the description of that resource by providing additional information about it. This may be done by modifying the RDF document in which the resource was originally described, to add the properties and values needed to describe the additional information. Or, as this example illustrates, a separate document could be created, providing the additional properties and values in rdf:Description elements that refer to the original resource via its URIref using rdf:about.
以上的示例说明了Web体系结构的一个基本原则,即任何人都应能够用他们愿意使用的任何

词汇自由地添加关于某一现存资源的信息20040210/#ref-berners-lee98 [BERNERS-LEE98 (http://www.w3.org/TR/2004/REC-rdf-primer-)]。这些例子进一步说明了描述某个特定资源的

RDF不需要全部存放于某一处;相反,它可以被分布于Web上。这一点不仅对上述情形(即一个组

织对其他组织定义的资源给出排名或评论)适用,对于下面这种情形也是适用的,即资源的最初

定义者希望通过增加关于资源(或其他人)的信息来充实资源的描述。这可以通过修改RDF文档

(即资源被最初定义的文档)来实现:即增加为了描述附加信息所必需的属性(properties)和

值。另一种实现方式(如本例所展示的)是:创建一个单独的文档,并在其中通过使用

rdf:Description元素为资源(用rdf:Description元素的rdf:about属性(attribute)的值来标

识)提供附加的属性(properties)和值。

The discussion above indicated that relative URIrefs such as #item10245 will be interpreted relative to a base URI. By default, this base URI would be the URI of the resource in which the relative URIref is used. However, in some cases it is desirable to be able to explicitly specify this base URI. For instance, suppose that in addition to the catalog located at http://www.example.com/2002/04/products, example.org wanted to provide a duplicate catalog on a mirror site, say at http://mirror.example.com/2002/04/products. This could create a problem, since if the catalog was accessed from the mirror site, the URIref for the example tent would be generated from the URI of the containing document, forming http://mirror.example.com/2002/04/products#item10245, rather than http://www.example.com/2002/04/products#item10245, and hence would apparently refer to a different resource than the one intended. Alternatively, example.org might want to assign a base URIref for its set of product URIrefs without publishing a single source document whose location defines the base.
上面的论述表明,相对URIrefs(比如#item10245)的解析将是相对于某个基准URI(base URI

的。缺省情况下,这个基准URI可以是该相对URI所在资源的URI。但是,在某些情况下也许

希望能够显式指定基准URI。比如,设想除位于 http://www.example.com/2002/04/products

产品目录以外,example.org希望在某个镜像站点上提供一个产品目录的副本(比如,位于

http://mirror.example.com/2002/04/products)。这可能会造成一些问题,因为如果是通过镜

像站点获得产品目录的话,帐篷的URIref将会通过产品目录的URI产生,也就是说形成的绝对

URIref为 http://mirror.example.com/2002/04/products#item10245,而不是

http://www.example.com/2002/04/products#item10245。显然,这将引用一个非期望的资

源。作为另一个选择,example.org也许希望为它的产品的URIrefs指定一个基准URIref,而

使用产品目录文档的位置作为基准URIref。

To deal with such cases, RDF/XML supports xmlbase-20010627/ XML Base (http://www.w3.org/TR/2001/REC-) 20040210/#ref-xml-base [XML-BASE (http://www.w3.org/TR/2004/REC-rdf-primer-)], which allows an XML document to specify a base URI other than the URI of the document itself. Example 11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example11) shows how the catalog would be described using XML Base:
为了处理上述情况,RDF/XML支持xmlbase-20010627/ XML Base (http://www.w3.org/TR/2001/REC-) 20040210/#ref-xml-base [XML-BASE (http://www.w3.org/TR/2004/REC-rdf-primer-)]。XML Base允许XML文档指定一个基准URI,而不是将XML

文档本身的URI作为基准URI。20040210/#example11 例11 (http://www.w3.org/TR/2004/REC-rdf-primer-)显示了产品目录是如何用XML Base来描述的:

Example 11: Using XML Base in example.com's Catalog
例11: 在example.com的产品目录中使用XML Base

1. <?xml version="1.0"?>
2. <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
3. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#"
4. xmlns:exterms="http://www.example.com/terms/"
5. xml:base="http://www.example.com/2002/04/products">

6. <rdf:Description rdf:ID="item10245">
7. <exterms:model rdf:datatype="&xsd;string">Overnighter</exterms:model>
8. <exterms:sleeps rdf:datatype="&xsd;integer">2</exterms:sleeps>
9. <exterms:weight rdf:datatype="&xsd;decimal">2.4</exterms:weight>
10. <exterms:packedSize rdf:datatype="&xsd;integer">784</exterms:packedSize>
11. </rdf:Description>

  ...other product descriptions...

12. </rdf:RDF>

In Example 11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example11), the xml:base declaration in line 5 specifies that the base URI for the content within the rdf:RDF element (until another xml:base attribute is specified) is http://www.example.com/2002/04/products, and all relative URIrefs cited within that content will be interpreted relative to that base, no matter what the URI of the containing document is. As a result, the relative URIref of the tent, #item10245, will be interpreted as the same absolute URIref, http://www.example.com/2002/04/products#item10245, no matter what the actual URI of the catalog document is, or whether the base URIref actually identifies a particular document at all.
例11 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example11)中,第5行的

xml:base声明为rdf:RDF元素里的内容指定了基准URI(直到在遇到其他被指定的xml:base为止)

http://www.example.com/2002/04/products。这样,在元素里引用的所有相对URIrefs的解析将

相对于xml:base所指定的基准URI,而与这些相对URIrefs所在文档的URI是什么无关。因此,所

描述帐篷的相对URIref #item10245将被解析为同一个绝对URIref

http://www.example.com/2002/04/products#item10245,不管产品目录文档的实际URI是什么,

也不管基准URIref是否真的标识了某一具体文档。

So far, the examples have used a single product description, a particular model of tent, from example.com's catalog. However, example.com will probably offer several different models of tents, as well as multiple instances of other categories of products, such as backpacks, hiking boots, and so on. This idea of things being classified into different kinds or categories is similar to the programming language concept of objects having different types or classes. RDF supports this concept by providing a predefined property, rdf:type. When an RDF resource is described with an rdf:type property, the value of that property is considered to be a resource that represents a category or class of things, and the subject of that property is considered to be an instance of that category or class. Using rdf:type, Example 12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example12) shows how example.com might indicate that the product description is that of a tent:
到目前为止,所有示例使用的都是同一个产品描述——example.com产品目录中的某个具体型号

的帐篷。然而,example.org也许希望提供多种不同型号的帐篷,同样对旅行背包、旅行鞋等多

个不同类型产品也提供多种选择。把事物划分为不同的种类(kings)类别(categories)这一想法与程

序设计语言里的对象(objects)有不同的类型(types)类(classes)类似。RDF通

过提供预定义属性(property)rdf:type来支持这种概念。当我们用rdf:type属性(property)

来描述一个RDF资源时,该属性的值就是被看作表达这种事物的种类(kings)类别

(categories)的资源。该属性的主体被看作为该种类(kings)类别(categories

的一个实例(instance)。[http://www.w3.org/TR/2004/REC-rdf-primer-

20040210/#example12 例12]展示了example.com是如何使用rdf:type来表达产品描述是关于一个

帐篷的:

Example 12: Describing a Tent with rdf:type
例12: 在帐篷的描述中使用rdf:type

1. <?xml version="1.0"?>
2. <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
3. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#"
4. xmlns:exterms="http://www.example.com/terms/"
5. xml:base="http://www.example.com/2002/04/products">

6. <rdf:Description rdf:ID="item10245">
7. <rdf:type rdf:resource="http://www.example.com/terms/Tent"/>
8. <exterms:model rdf:datatype="&xsd;string">Overnighter</exterms:model>
9. <exterms:sleeps rdf:datatype="&xsd;integer">2</exterms:sleeps>
10. <exterms:weight rdf:datatype="&xsd;decimal">2.4</exterms:weight>
11. <exterms:packedSize rdf:datatype="&xsd;integer">784</exterms:packedSize>
12. </rdf:Description>

  ...other product descriptions...

13. </rdf:RDF>

In Example 12, the rdf:type property in line 7 indicates that the resource being

described is an instance of the class identified by the URIref

http://www.example.com/terms/Tent. This assumes that example.com has described its

classes as part of the same vocabulary that it uses to describe its other terms

(such as the property exterms:weight), so the

absolute URIref of the class is used to refer to it. If example.com had described

these classes as part of the product catalog itself, the relative URIref #Tent could

have been used to refer to it.
例12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example12)中,第7行的

rdf:type属性(property)表示被描述的资源是URLref http://www.example.com/terms/Tent

所标识的类的一个实例(instance)。这假定了example.com已经在某个词汇表中描述了这个类

(class),因此才可以在上面的例子中用该类的绝对URIref来引用它。如果example.com是在产

品目录所在文档中描述了这个类,那么可以用相对URIref #Tent来引用它。

RDF itself does not provide facilities for defining application-specific classes of things, such as Tent in this example, or their properties, such as exterms:weight. Instead, such classes would be described in an RDF schema, using the RDF Schema language discussed in Section 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema). Other such facilities for describing classes can also be defined, such as the DAML+OIL and OWL languages described in Section 5.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas).
RDF本身并没有提供方法来定义特定应用中的类(class),比如本例中的Tent、或它们的属性(

properties)如exterms:weight等。这些类是在RDF schema中使用RDF Schema语言(将

第5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)介绍)来描述的

。其他用于类描述的方法也可以被定义,比如DAML+OILOWL语言(将在 5.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)介绍)


It is fairly common in RDF for resources to have rdf:type properties that describe the resources as instances of specific types or classes. Such resources are called typed nodes in the graph, or typed node elements in the RDF/XML. RDF/XML provides a special abbreviation for describing these typed nodes. In this abbreviation, the rdf:type property and its value are removed, and the rdf:Description element for the node is replaced by an element whose name is the QName corresponding to the value of the removed rdf:type property (a URIref that names a class). Using this abbreviation, example.com's tent from primer-20040210/#example12 Example 12 (http://www.w3.org/TR/2004/REC-rdf-) could also be described as shown in Example 13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13):
在RDF中,为被描述的资源指定rdf:type属性(property)以指明它是某个特定类型或类的实例

是非常普遍的手法。这样的资源在RDF图中被称作有类型结点(typed node),在RDF/XML中

被称作有类型结点元素(typed node elements)。RDF/XML提供了一种特殊的简略形式以描

述这些有类型结点。在这种简略形式中,rdf:type属性及其的值被移去,而结点对应的

rdf:Description元素被替换为一个以QName为名称的元素(QName对应于被移去的那个rdf:type

属性的值,也就是某个类的URIref)。使用这种简略形式,rdf-primer-20040210/#example12 例12 (http://www.w3.org/TR/2004/REC-)中example.com的帐篷也可用

例13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13)所示的RDF/XML来描

述:

Example 13: Abbreviating the Tent's Type
例13:简略帐篷的类型

1. <?xml version="1.0"?>
2. <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
3. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax- ns#"
4. xmlns:exterms="http://www.example.com/terms/"
5. xml:base="http://www.example.com/2002/04/products">

6. <exterms:Tent rdf:ID="item10245">
7. <exterms:model rdf:datatype="&xsd;string">Overnighter</exterms:model>
8. <exterms:sleeps rdf:datatype="&xsd;integer">2</exterms:sleeps>
9. <exterms:weight rdf:datatype="&xsd;decimal">2.4</exterms:weight>
10. <exterms:packedSize rdf:datatype="&xsd;integer">784</exterms:packedSize>
11. </exterms:Tent>

  ...other product descriptions...

12. </rdf:RDF>

Since a resource may be described as an instance of more than one class, a resource may have more than one rdf:type property. However, only one of these rdf:type properties can be abbreviated in this way. The others must be written out using rdf:type properties, in the manner illustrated by the rdf:type property in 20040210/#example12 Example 12 (http://www.w3.org/TR/2004/REC-rdf-primer-).
因为一个资源可能被描述为是多个类的实,因此一个资源可能有多个rdf:type属性。但是,在这

些rdf:type属性中,只有一个可被写为简略形式,其余的必须像

例12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example12)中的那样用

rdf:type属性写出。

In addition to its use in describing instances of user-defined classes such as exterms:Tent, the typed node abbreviation is also commonly used in RDF/XML when describing instances of the built-in RDF classes (such as rdf:Bag) to be described in 20040210/#othercapabilities Section 4 (http://www.w3.org/TR/2004/REC-rdf-primer-), and the built-in RDF Schema classes (such as rdfs:Class) to be described in primer-20040210/#rdfschema Section 5 (http://www.w3.org/TR/2004/REC-rdf-).
有类型结点的简略形式除用于描述用户自定义类(user-defined classes)(比如exterms:Tent

)的实例以外,在描述内建RDF类(built-in RDF classes,将在

第4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#othercapabilities)中介绍)

(比如rdf:Bag)和内建RDF Schema类(built-in RDF Schema classes,将在

第5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)中介绍)(比如

rdfs:Class)时也是被普遍使用的。

Both Example 12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example12) and Example 13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13) illustrate that RDF statements can be written in RDF/XML in a way that closely resembles descriptions that might have been written directly in (non-RDF) XML. This is an important consideration, given the increasing use of XML in all kinds of applications, since it suggests that RDF could be used in these applications without requiring major changes in the way their information is structured.
例12 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example12)

例13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13)展示了一点,即用

RDF/XML写出的RDF陈述可以非常类似直接用XML(而不是RDF)书写的描述。在XML正被使用于越

来越多的应用这一背景下,这是一个重要的考虑,因为这意味着RDF可在这些应用中被使用,而

不需对信息的构造方式作较大改动。

3.3 RDF/XML Summary

3.3 总结

The examples above have illustrated some of the basic ideas behind the RDF/XML syntax. These examples provide enough information to begin writing useful RDF/XML. A more thorough discussion of the principles behind the modeling of RDF statements in XML (known as striping), together with a presentation of the other RDF/XML abbreviations available, and other details and examples about writing RDF in XML, is given in the (normative) RDF/XML Syntax Specification (http://www.w3.org/TR/rdf-syntax-grammar/) [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].
上面的例子已经展现了RDF/XML背后的一些基本思想。这些例子为开始书写有用的RDF/XML提供了足够的信息。关于用XML进行RDF陈述的建模(被称作striping)背后的理论、以及其他可用的RDF/XML简略形式、和其他关于用XML书写RDF的细节和示例,请参见(规范性)文档RDF/XML语法规范 (http://www.w3.org/TR/rdf-syntax-grammar/) [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]。

4. 其他RDF表达能力


RDF provides a number of additional capabilities, such as built-in types and properties for representing groups of resources and RDF statements, and capabilities for representing XML fragments as property values. These additional capabilities are described in the following sections.

RDF提供了一些额外 的表达能力,如内嵌的表示资源组和RDF陈述组的类和属性,还能让XML片断做为属性的值。下面讨论这些额外的表达能力。

4.1 RDF容器


There is often a need to describe groups of things: for example, to say that a book was created by several authors, or to list the students in a course, or the software modules in a package. RDF provides several predefined (built-in) types and properties that can be used to describe such groups.
我们常常需要描述一组事物:例如,说一般书是由多个作者写的,或把上某门课程的学生都列出来,或一个软件包下的所有模块。RDF提供了一些预定义的类型和属性用以描述一组事物。
First, RDF provides a container vocabulary consisting of three predefined types (together with some associated predefined properties). A container is a resource that contains things. The contained things are called members. The members of a container may be resources (including blank nodes) or literals. RDF defines three types of containers:
首先,RDF提供了容器词汇,包括三个预定义的类型,以及他们的一些属性。一个容器是一个包含了一些事物的资源,这些被包含的事物称为成员。容器的成员可能是资源(包括匿名节点)或文字。RDF定义了三种类型的容器:

  • rdf:Bag
  • rdf:Seq
  • rdf:Alt


A Bag (a resource having type rdf:Bag) represents a group of resources or literals, possibly including duplicate members, where there is no significance in the order of the members. For example, a Bag might be used to describe a group of part numbers in which the order of entry or processing of the part numbers does not matter.
一个包(Bag,是类型为rdf:Bag的资源)表示了一组可能包含重复成员的资源或文字,且成员之间是无序的。例如,包可以用来描述对于成员的添加或处理顺序没有特别要求的组。
A Sequence or Seq (a resource having type rdf:Seq) represents a group of resources or literals, possibly including duplicate members, where the order of the members is significant. For example, a Sequence might be used to describe a group that must be maintained in alphabetical order.
一个序列(Sequence,是类型为rdf:Seq的资源)表示了一组资源或文字,其中可能有重复的成员,而且成员之间是有序的。例如,序列可以用来描述一组必须按字母顺序排列的事物。
An Alternative or Alt (a resource having type rdf:Alt) represents a group of resources or literals that are alternatives (typically for a single value of a property). For example, an Alt might be used to describe alternative language translations for the title of a book, or to describe a list of alternative Internet sites at which a resource might be found. An application using a property whose value is an Alt container should be aware that it can choose any one of the members of the group as appropriate.
一个替换(Alternative,是类型为rdf:Alt的资源)表示了一组可以选择的资源或文字(常常是属性的一个值)。例如,序列可以用来描述一组可以互相替换的关于著作的不同语言的翻译,或者描述一个资源可能出现的几个因特网镜像站点。在应用中,如果属性的值是一个替换,这可以选择替换中任意一个合适的成员作为属性的值。
To describe a resource as being one of these types of containers, the resource is given an rdf:type property whose value is one of the predefined resources rdf:Bag, rdf:Seq, or rdf:Alt (whichever is appropriate). The container resource (which may either be a blank node or a resource with a URIref) denotes the group as a whole. The members of the container can be described by defining a container membership property for each member with the container resource as its subject and the member as its object. These container membership properties have names of the form rdf:_n, where n is a decimal integer greater than zero, with no leading zeros, e.g., rdf:_1, rdf:_2, rdf:_3, and so on, and are used specifically for describing the members of containers. Container resources may also have other properties that describe the container, in addition to the container membership properties and the rdf:type property.
为了表示一个资源是一个容器,这个资源必须有个属性rdf:type且值为预定义的三个资源:rdf:Bag, rdf:Seq, or rdf:Alt 之一。这个容器资源(可能是匿名节点或由URIref标识的节点)代表了作为一个整体的一组事物。容器的成员和容器资源之间的关系是由一组专门为此定义的表示成员关系的属性描述的,这些属性的主体是容器资源,客体是其成员。这些成员关系属性的名字形为rdf:_n,其中n是一个大于0的十进制整数,如 rdf:_1, rdf:_2, rdf:_3等等。除了成员关系属性和rdf:type属性外,容器资源还可以有其他的属性。
It is important to understand that while these types of containers are described using predefined RDF types and properties, any special meanings associated with these containers, e.g., that the members of an Alt container are alternative values, are only intended meanings. These specific container types, and their definitions, are provided with the aim of establishing a shared convention among those who need to describe groups of things. All RDF does is provide the types and properties that can be used to construct the RDF graphs to describe each type of container. RDF has no more built-in understanding of what a resource of type rdf:Bag is than it has of what a resource of type ex:Tent (discussed in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)) is. In each case, applications must be written to behave according to the particular meaning involved for each type. This point will be expanded on in the following examples.
很重要的一点是:尽管这些容器可以用预定义的RDF类型和属性定义,但并没有为这些容器提供特定的意义,例如,一个替换容器的成员的值是可替换的,这只是RDF的设计用途。这些容器类型和他们的定义,目的是在需要描述一组事物的时候建立一个大家认同的惯例。RDF所做的只是提供预定以的类型和属性用以构造RDF图来描述各种容器,相对于一个普通的资源如ex:Tent (如 3.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)讨论的),它并没有给作为包的资源更多的内置的解释。在这种情况下,应用程序必须注意到不同类型的容器有不同的含义,这点会在下面的例子中进一步讨论:
A typical use of a container is to indicate that the value of a property is a group of things. For example, to represent the sentence "Course 6.001 has the students Amy, Mohamed, Johann, Maria, and Phuong", the course could be described by giving it a s:students property (from an appropriate vocabulary) whose value is a container of type rdf:Bag (representing the group of students). Then, using the container membership properties, individual students could be identified as being members of that group, as in the RDF graph shown in Figure 14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure14):
容器的一个惯常用法是表明有个属性的值是一组事物。例如,为了表示句子 “参加课程6.001的学生有:Amy, Mohamed, Johann, Maria, 和 Phuong”,可以给课程一个s:students属性(来自一个合适的词汇集),它的值是一个包容器(表示一组学生),然后再用容器成员关系属性,每个学生可以标识为这个组的成员,如RDF图图14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure14)所示:

fig14july12.png
图14:一个简单的包容器描述

Since the value of the s:students property in this example is described as a Bag, there is no intended significance in the order given for the URIrefs of the students, even though the membership properties in the graph have integers in their names. It is up to applications creating and processing graphs that include rdf:Bag containers to ignore any (apparent) order in the names of the membership properties.
因为这个例子中属性s:students的值是一个包,因此学生的URIrefs的顺序是无关紧要的,尽管容器成员属性的名字包含了一些整数。应用程序应该在创建或处理图的时候忽略掉属性名字中显示出来的顺序。
RDF/XML provides some special syntax and abbreviations to make it simpler to describe such containers. For example, Example 14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example14) describes the graph shown in Figure 14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure14):
RDF/XML提供了一些特殊的语法和缩写来简化容器的描述。例如例14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example14)描述了例14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure14)所示的图。

例14:用RDF/XML书写的一个包含学生的包(bag)

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:s="http://example.org/students/vocab#">


   <rdf:Description rdf:about="http://example.org/courses/6.001">
<s:students>
<rdf:Bag>
<rdf:li rdf:resource="http://example.org/students/Amy"/>
<rdf:li rdf:resource="http://example.org/students/Mohamed"/>
<rdf:li rdf:resource="http://example.org/students/Johann"/>
<rdf:li rdf:resource="http://example.org/students/Maria"/>
<rdf:li rdf:resource="http://example.org/students/Phuong"/>
</rdf:Bag>
</s:students>
</rdf:Description>

</rdf:RDF>


Example 14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example14) shows that RDF/XML provides rdf:li as a convenience element to avoid having to explicitly number each membership property. The numbered properties rdf:_1, rdf:_2, and so on are generated from the rdf:li elements in forming the corresponding graph. The element name rdf:li was chosen to be mnemonic with the term "list item" from HTML. Note also the use of a <rdf:Bag> element nested within the <s:students> property element. The <rdf:Bag> element is another example of the abbreviation used in Example 13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13) that replaces both an rdf:Description element and an rdf:type element with a single element when describing an instance of a type (an instance of rdf:Bag in this case). Since no URIref is specified, the Bag is a blank node. Its nesting within the <s:students> property element is an abbreviated way of indicating that the blank node is the value of this property. These abbreviations are described further in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].
例14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example14)展示了RDF/XML用rdf:li作为一个便利元素来避免显式地指定属性的名字。那些标号了的属性,如rdf:_1, rdf:_2是由图中的rdf:li自动生成的。元素名rdf:li是借鉴HTML的列表的。<rdf:Bag>元素又是一个例13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13)演示的缩写的例子,即当描述一个类的实例时,用单个元素替换一个rdf:Description元素和rdf:type元素。因为没有指定URIref,这个包资源是一个匿名节点。另外,它是属性元素<s:students> 的子节点,这也是一种缩写,表示这个匿名节点是属性的值。[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]讲解了更详细的缩写方法。
The graph structure for an rdf:Seq container, and the corresponding RDF/XML, are similar to those for an rdf:Bag (the only difference is in the type, rdf:Seq). Once again, although an rdf:Seq container is intended to describe a sequence, it is up to applications creating and processing the graph to appropriately interpret the sequence of integer-valued property names.
容器rdf:Seq的图结构和对应的RDF/XML写法和rdf:Bag相似(唯一的区别是类型是rdf:Seq)。同样地,虽然rdf:Seq是用来描述序列,但应用程序要负责在创建和处理RDF图时正确解释体现在属性名字中的顺序。
To illustrate an Alt container, the sentence "The source code for X11 may be found at ftp.example.org, ftp1.example.org, or ftp2.example.org" could be expressed in the RDF graph shown in Figure 15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15):
为了演示替换容器的用法,句子“X11的源代码可能可以在网站ftp.example.org, ftp1.example.org, 或 ftp2.example.org上找到”可用如图15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15)所示的图表示:

fig15july12.png
图15:一个简单的替换容器描述

Example 15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example15) shows how the graph in Figure 15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15) could be written in RDF/XML:
图15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15)代表的图可以在RDF/XML中如例15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example15)所示:

例15:用RDF/XML书写的一个替换容器(Alt Container)

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:s="http://example.org/packages/vocab#">


   <rdf:Description rdf:about="http://example.org/packages/X11">
<s:DistributionSite>
<rdf:Alt>
<rdf:li rdf:resource="ftp://ftp.example.org"/>
<rdf:li rdf:resource="ftp://ftp1.example.org"/>
<rdf:li rdf:resource="ftp://ftp2.example.org"/>
</rdf:Alt>
</s:DistributionSite>
</rdf:Description>

</rdf:RDF>


An Alt container is intended to have at least one member, identified by the property rdf:_1. This member is intended to be considered as the default or preferred value. Other than the member identified as rdf:_1, the order of the remaining elements is not significant.
一个替换容器被设计为至少有一个成员,由属性rdf:_1标识。这个成员被认为是属性的缺省值或优先值。除了rdf:_1外,其他剩下的成员的顺序是无关紧要的。
The RDF in Figure 15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15) as written states simply that the value of the s:DistributionSite site property is the Alt container resource itself. Any additional meaning that is to be read into this graph, e.g., that one of the members of the Alt container is to be considered as the value of the s:DistributionSite site property, or that ftp://ftp.example.org is the default or preferred value, must be built into an application's understanding of the intended meaning of an Alt container, and/or into the meaning defined for the particular property (s:DistributionSite in this case), which also must be understood by the application.
图15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15)中的RDF图表示属性s:DistributionSite的值是一个类型是替换容器的资源。关于这个RDF图更多的意义必须由应用程序来解释,例如,替换容器的一个成员可以看成属性s:DistributionSite的值,或者ftp://ftp.example.org是这个属性的缺省值或优先值。
Alt containers are frequently used in conjunction with language tagging. (RDF/XML permits the use of the xml:lang attribute defined in [XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)] to indicate that the element content is in a specified language. The use of xml:lang is described in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)], and illustrated later in Section 6.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#prism).) For example, a work whose title has been translated into several languages might have its title property pointing to an Alt container holding literals representing the titles expressed in each of the language variants.
替换容器常常和语言标记一起使用(RDF/XML允许用在[XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)]定义的属性xml:lang 表示元素节点的内容是用什么语言书写的。 [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]描述了xml:lang的用法, 6.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#prism)也演示它的用法。)。例如,如果一个著作被翻译成了多种语言,这这本著作的标题属性可以是一个替换容器,这个容器包含了用多种语言书写的标题。
The distinction between the intended meanings of a Bag and an Alt can be further illustrated by considering the authorship of the book "Huckleberry Finn". The book has exactly one author, but the author has two names (Mark Twain and Samuel Clemens). Either name is sufficient to specify the author. Thus using an Alt container for the author's names more accurately represents the relationship than using a Bag (which might suggest there are two different authors).
包和替换的用法的区别可以通过以下例子更清楚地看出来。哈克贝里?芬历险记(“Huckleberry Finn”)这本书只有一个作者,但作者有两个名字(马克?吐温是笔名,塞谬尔?克莱门斯是原名),每个名字都可以表示作者。因此,包含这两个名字的替换比包更适合作为作者名这个属性的值,因为包容器隐含了这是两个不同的作者的意思。
Users are free to choose their own ways to describe groups of resources, rather than using the RDF container vocabulary. These RDF containers are merely provided as common definitions that, if generally used, could help make data involving groups of resources more interoperable.
用户可以不用RDF容器词汇,随意选择自己的方式表达一组资源。这些RDF容器只是提供一种通用的方式,如果能得到广泛应用,可以使描述一组资源的数据具有更好的互操作性。
Sometimes there are clear alternatives to using these RDF container types. For example, a relationship between a particular resource and a group of other resources could be indicated by making the first resource the subject of multiple statements using the same property. This is structurally different from the resource being the subject of a single statement whose object is a container containing multiple members. In some cases, these two structures may have equivalent meaning, but in other cases they may not. The choice of which to use in a given situation should be made with this in mind.
有时候,有明显的方法可以代替RDF容器。例如,要描述一个资源和一组资源的关系,可以用多个陈述(属性是相同的)来表示,每个陈述的主体都是第一个资源,客体是一组资源的一个资源。这和用一个陈述表示,主体是第一个资源,客体是包含一组资源的容器的方式在结构上是不同的。有些时候,这两种表示方式有相同的意义,但也有时候不一样。如何在不同的情况下去选择不同的方式要考虑以下问题:
Consider as an example the relationship between a writer and her publications, as in the sentence:
考虑一个例子表示作家和其的作品之间关系的例子,如下面的句子:

Sue has written "Anthology of Time", "Zoological Reasoning", and "Gravitational Reflections".
Sue已经写了"Anthology of Time", "Zoological Reasoning", 和 "Gravitational Reflections"这三本书。
In this case, there are three resources each of which was written independently by the same writer. This could be expressed using repeated properties as:
在这个例子中,有三个资源都是由相同的作者独立完成的,这可以用重复的属性表示如下:
exstaff:Sue exterms:publication ex:AnthologyOfTime .
exstaff:Sue exterms:publication ex:ZoologicalReasoning .
exstaff:Sue exterms:publication ex:GravitationalReflections .


In this example there is no stated relationship between the publications other than that they were written by the same person. Each of the statements is an independent fact, and so using repeated properties would be a reasonable choice. However, this could just as reasonably be represented as a statement about the group of resources written by Sue:
在这个例子中,只说了作品之间的关系是他们由同一个作者写成。每个陈述是一个独立的事实,因为用重复的属性也是合理的选择。当然,用一个关于Sue写的一组书的陈述表示的话,也是合理的。
exstaff:Sue exterms:publication _:z .
_:z rdf:type rdf:Bag .
_:z rdf:_1 ex:AnthologyOfTime .
_:z rdf:_2 ex:ZoologicalReasoning .
_:z rdf:_3 ex:GravitationalReflections .


On the other hand, the sentence:
在另一方面,句子

The resolution was approved by the Rules Committee, having members Fred, Wilma, and Dino.

这个决议被由Fred, Wilma 和 Dino组成的章程委员会批准了。 says that the committee as a whole approved the resolution; it does not necessarily state that each committee member individually voted in favor of the resolution. In this case, it would be potentially misleading to model this sentence as three separate exterms:approvedBy statements, one for each committee member, as shown below:
说这个委员会作为一个整体批准了这个决议;并不是说每个单独的委员会成员都投票同意了这个决议。在这个例子中,如果把这个句子用三个独立的exterms:approvedBy陈述表示,每一个陈述的主体是一个委员会成员, 如下所示,则是不恰当的,
ex:resolution exterms:approvedBy ex:Fred .
ex:resolution exterms:approvedBy ex:Wilma .
ex:resolution exterms:approvedBy ex:Dino .


since these statements say that each member individually approved the resolution.
因为这些陈述是说每个成员都批准了这个决议。
In this case, it would be better to model the sentence as a single exterms:approvedBy statement whose subject is the resolution and whose object is the committee itself. The committee resource could then be described as a Bag whose members are the members of the committee, as in the following triples:
如果将这句话表示为一个陈述,其主体是决议,客体是委员会,则更为恰当。这个委员会可以用一个包含这三个委员会成员的包容器来描述,如下面的这些三元组所示:
ex:resolution exterms:approvedBy ex:rulesCommittee .
ex:rulesCommittee rdf:type rdf:Bag .
ex:rulesCommittee rdf:_1 ex:Fred .
ex:rulesCommittee rdf:_2 ex:Wilma .
ex:rulesCommittee rdf:_3 ex:Dino .


When using RDF containers, it is important to understand that the statements are not constructing containers, as in a programming language data structure. Instead, the statements are describing containers (groups of things) that presumably exist. For instance, in the Rules Committee example just given, the Rules Committee is an unordered group of people, whether it is described in RDF that way or not. Saying that the resource ex:rulesCommittee has type rdf:Bag is not saying that the Rules Committee is a data structure, or constructing a particular data structure to hold the members of the group (the Rules Committee could be described as a Bag without describing any members at all). Instead, it is describing the Rules Committee as having characteristics corresponding to those associated with a Bag container, namely that it has members, and their order of description is not significant. Similarly, using the container membership properties simply describes a container resource as having certain things as members. This does not necessarily say that the things described as members are the only members that exist. For example, the triples given above to describe the Rules Committee say only that Fred, Wilma, and Dino are members of the committee, not that they are the only members of the committee.
当用RDF容器时,要明白这些陈述不是像程序语言中的结构那样在构造容器,而是描述已经存在的容器。在刚给出的章程委员会例子中,章程委员会是一组没有排序的人,不管RDF的描述方式是怎样的。说资源 ex:rulesCommittee 的类型是rdf:Bag,并不等于说章程委员会是一个数据结构,或说构造了一个包含这个组的成员的数据结构(章程委员会可以描述为一个包即使没有描述他的任意成员。反之,它描述了章程委员会和包容器有对应的特点,即有成员且成员之间的序是无关紧要的。类似地,用容器成员属性只是描述了一个容器资源有一些事物作为其成员,并不是说这些事物是容器仅有的成员。例如,上面的三元组只说Fred, Wilma,和 Dino是委员会的成员,但没有说他们是委员会的所有成员。

Also, Example 14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example14) and Example 15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example15) illustrated a common "pattern" in describing containers, regardless of the type of container involved (e.g., use of a blank node with an appropriate rdf:type property to represent the container itself, and use of rdf:li to generate sequentially-numbered container membership properties). However, it is important to understand that RDF does not enforce this particular way of using the RDF container vocabulary, and so it is possible to use this vocabulary in other ways. For example, in some cases it might be appropriate to use a container resource having a URIref rather than using a blank node. Moreover, it is possible to use the container vocabulary in ways that may not describe graphs with the "well-formed" structures shown in the previous examples. For example, Example 16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example16) shows the RDF/XML for a graph similar to the Alt container shown in Figure 15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15), but which writes the container membership properties explicitly, rather than using rdf:li to generate them:
同样,例14 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example14) and 例15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example15)显示了描述容器的一个通用模式。然而,很重要的一点是,RDF并不强制使用RDF容器词汇的方式,因此,可能会有其他使用容器的方式。例如,有时候让容器资源有一个URIref比作为一个匿名节点更为恰当。此外,还可能有不像前面的例子那样格式规范的容器词汇使用方式,例如,例16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example16) 显示了一个用RDF/XML表示的和图15 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure15)中的替换容器类似的图, 但它显式地写出了容器成员属性,而不是由rdf:li自动生成:

例16:一个格式不正确的替换容器的RDF/XML表示

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:s="http://example.org/packages/vocab#"> 

<rdf:Description rdf:about="http://example.org/packages/X11">
<s:DistributionSite>
<rdf:Alt>
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag"/>
<rdf:_2 rdf:resource="ftp://ftp.example.org"/>
<rdf:_2 rdf:resource="ftp://ftp1.example.org"/>
<rdf:_5 rdf:resource="ftp://ftp2.example.org"/>
</rdf:Alt>
</s:DistributionSite>
</rdf:Description>

</rdf:RDF>


As noted in [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)], RDF imposes no "well-formedness" conditions on the use of the container vocabulary, so Example 16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example16) is perfectly legal, even though the container is described as both a Bag and an Alt, it is described as having two distinct values of the rdf:_2 property, and it does not have rdf:_1, rdf:_3, or rdf:_4 properties.
[RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]所说,RDF没有对RDF容器词汇的使用施加格式正确性约束,因此例16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example16)是合法的,尽管这个容器的类型即是包又是替换,属性rdf:_2还具有两个不同的值,还没有属性rdf:_1, rdf:_3, 或 rdf:_4。
As a result, RDF applications that require containers to be "well-formed" should be written to check that the container vocabulary is being used appropriately, in order to be fully robust.
结果是,RDF应用如果需要容器是格式正确的,则为了应用的鲁棒性,应该写代码检查容器词汇的使用恰当与否。

4.2 RDF Collections

4.2 RDF集合


A limitation of the containers described in Section 4.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#containers) is that there is no way to close them, i.e., to say "these are all the members of the container". As noted in Section 4.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#containers), a container only says that certain identified resources are members; it does not say that other members do not exist. Also, while one graph may describe some of the members, there is no way to exclude the possibility that there is another graph somewhere that describes additional members. RDF provides support for describing groups containing only the specified members, in the form of RDF collections. An RDF collection is a group of things represented as a list structure in the RDF graph. This list structure is constructed using a predefined collection vocabulary consisting of the predefined type rdf:List, the predefined properties rdf:first and rdf:rest, and the predefined resource rdf:nil.
4.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#containers)中描述的容器的一个缺点是没有办法封闭它,即没有办法说这些是容器的所有成员。一个容器只说一些有标识的资源是它的成员,无法说没有其他的成员了。而且,如果有一个图描述它的一些成员,我们没法排除在其他地方有图也描述这个容器的其它成员的可能。RDF以RDF集合(collection)的形式提供了对描述特定成员的组的支持。一个RDF集合是用列表结构表示的一组事物,这个列表结构是用一些预定义的集合词汇表示的。RDF的集合词汇包括属性rdf:first 和rdf:rest,和资源rdf:nil.
To illustrate this, the sentence "The students in course 6.001 are Amy, Mohamed, and Johann" could be represented using the graph shown in Figure 16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16):
为了展示这个,句子“上课程6.001的学生有:Amy, Mohamed, 和Johann”可以用图16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16)所示的图表示:

fig16bjuly12.png
图16:一个RDF集合(列表结构)

In this graph, each member of the collection, such as s:Amy, is the object of an rdf:first property whose subject is a resource (a blank node in this example) that represents a list. This list resource is linked to the rest of the list by an rdf:rest property. The end of the list is indicated by the rdf:rest property having as its object the resource rdf:nil (the resource rdf:nil represents the empty list, and is defined as being of type rdf:List). This structure will be familiar to those who know the Lisp programming language. As in Lisp, the rdf:first and rdf:rest properties allow applications to traverse the structure. Each of the blank nodes forming this list structure is implicitly of type rdf:List (that is, each of these nodes implicitly has an rdf:type property whose value is the predefined type rdf:List), although this is not explicitly shown in the graph. The RDF Schema language [RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)] defines the properties rdf:first and rdf:rest as having subjects of type rdf:List, so the information about these nodes being lists can generally be inferred, rather than the corresponding rdf:type triples being written out all the time.
在这个图中,集合中的每个成员,如s:Amy,是属性rdf:first的客体,这个属性的主体是表示一个列表的资源(这个例子中是一个匿名节点)。这个列表通过属性rdf:rest链到列表的剩下的元素,列表的结束用一个值为rdf:nil 的属性rdf:rest表示(rdf:nil表示一个空列表,它的类型是rdf:List)。这种结构和Lisp语言很像,像Lisp一样,属性rdf:first 和rdf:rest允许程序遍历这个结构。组成列表结构的每个匿名节点的类型默认为rdf:List,尽管这没有在图中显示出来。RDF Schema语言[RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)]定义了属性rdf:first 和rdf:rest的主体的类型是rdf:List,因此,这些匿名节点的类型信息可以推导出来,而不用每次都写出来。
RDF/XML provides a special notation to make it easy to describe collections using graphs of this form. In RDF/XML, a collection can be described by a property element that has the attribute rdf:parseType="Collection", and that contains a group of nested elements representing the members of the collection. RDF/XML provides the rdf:parseType attribute to indicate that the contents of an element are to be interpreted in a special way. In this case, the rdf:parseType="Collection" attribute indicates that the enclosed elements are to be used to create the corresponding list structure in the RDF graph (other values of the rdf:parseType attribute will be described in later sections of the Primer).
RDF/XML提供了一种特殊的图的记法使描述集合更为简单。在RDF/XML中,一个集合可以用一个代表属性的元素节点表示,且这个元素节点有个属性节点是rdf:parseType="Collection",这表示元素节点下的内容要以一种特殊的方式解释。在这里,rdf:parseType="Collection"表示包含的元素要用来创建RDF图中(其它的rdf:parseType属性的值将在后面的章节中讲述)。
To illustrate how rdf:parseType="Collection" works, the RDF/XML from Example 17 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example17) would result in the RDF graph shown in Figure 16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16):
为了展示rdf:parseType="Collection"是怎么工作的,例17 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example17) 中的RDF/XML写法对应的图如 图16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16)说示:


Example 17: RDF/XML for a Collection of Students
例17:一个关于学生的集合的 RDF/XML表示

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:s="http://example.org/students/vocab#">


   <rdf:Description rdf:about="http://example.org/courses/6.001">
<s:students rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.org/students/Amy"/>
<rdf:Description rdf:about="http://example.org/students/Mohamed"/>
<rdf:Description rdf:about="http://example.org/students/Johann"/>
</s:students>
</rdf:Description>

</rdf:RDF>


The use of rdf:parseType="Collection" in RDF/XML always defines a list structure like the one shown in Figure 16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16), i.e., a fixed finite list of items with a given length and terminated by rdf:nil, and which uses "new" blank nodes that are unique to the list structure itself. However, RDF does not enforce this particular way of using the RDF collection vocabulary, and so it is possible to use this vocabulary in other ways, some of which may not describe lists or closed collections. To see why, note that the graph shown in Figure 16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16) could also be written in RDF/XML by writing out the same triples "in longhand" (without using rdf:parseType="Collection") using the collection vocabulary, as in Example 18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example18):
在RDF/XML 中用rdf:parseType="Collection" 常定义了一个如 图16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16)所示的列表结构:一个固定有限长度的列表,它用rdf:nil表示列表的结束,还用了一些相对于列表唯一的匿名节点。然后,RDF并没有强制集合词汇只能用于这种方式,因此也可以用于其他方式。有些方式可能没有描述列表或者说封闭的集合。为了知道原因,注意到图16 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure16)所示的图也可以用集合词汇的普通格式(不用rdf:parseType="Collection")写,如例18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example18)所示:

Example 18: RDF/XML for a Collection of Students in "Longhand"
例18:一个关于学生的集合的RDF/XML普通格式表示

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:s="http://example.org/students/vocab#"> 


<rdf:Description rdf:about="http://example.org/courses/6.001">

   <s:students rdf:nodeID="sch1"/>

</rdf:Description>

 

<rdf:Description rdf:nodeID="sch1">

   <rdf:first rdf:resource="http://example.org/students/Amy"/>
<rdf:rest rdf:nodeID="sch2"/>

</rdf:Description>

 

<rdf:Description rdf:nodeID="sch2">

   <rdf:first rdf:resource="http://example.org/students/Mohamed"/>
<rdf:rest rdf:nodeID="sch3"/>

</rdf:Description>

 

<rdf:Description rdf:nodeID="sch3">

   <rdf:first rdf:resource="http://example.org/students/Johann"/>
<rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>

</rdf:Description>
</rdf:RDF>


As noted in [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] (and as was the case for the container vocabulary described in Section 4.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#containers)), RDF imposes no "well-formedness" conditions on the use of the collection vocabulary so, when writing triples in longhand, it is possible to define RDF graphs with structures other than the well-structured graphs that would be automatically generated by using rdf:parseType="Collection". For example, it is not illegal to assert that a given node has two distinct values of the rdf:first property, to create structures that have forked or non-list tails, or to simply omit part of the description of a collection. Also, graphs defined by using the collection vocabulary in longhand could use URIrefs to identify the components of the list instead of blank nodes unique to the list structure. In this case, it would be possible to create triples in other graphs that effectively added elements to the collection, making it non-closed.
注意到在 [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] (和容器词汇相同的情况4.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#containers))中, RDF并没有对集合词汇施加格式正确性约束(well-formedness),因此,当用普通格式写时,有可能写出的列表结构并不像由用rdf:parseType=“collection”自动生成的那样正确,如一个节点的rdf:first属性有两个不同的值是合法的,或列表结构的最后的节点不是空列表,或简单地忽略了结合的某些部分。另外,用普通格式写的集合词汇定义的图可以用URIrefs标识列表中的部分节点,而不是在列表中是唯一的匿名节点,这样,有可能在别的图中有三元组为集合添加元素,而使之不封闭。
As a result, RDF applications that require collections to be well-formed should be written to check that the collection vocabulary is being used appropriately, in order to be fully robust. In addition, languages such as OWL (http://www.w3.org/TR/owl-ref/) [OWL (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-owl)], which can define additional constraints on the structure of RDF graphs, can rule out some of these cases.
结果是,RDF应用如果需要集合是格式正确的,为了应用的鲁棒性,就应该检查集合词汇时被正确的使用。另外,语言 OWL (http://www.w3.org/TR/owl-ref/) [OWL (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-owl)], 能够对RDF图的结构定义额外的限制,可以避免一些集合格式不正确的情况。

4.3 RDF Reification

4.3 RDF具体化



RDF applications sometimes need to describe other RDF statements using RDF, for instance, to record information about when statements were made, who made them, or other similar information (this is sometimes referred to as "provenance" information). For example, Example 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9) in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources) described a particular tent with URIref exproducts:item10245, offered for sale by example.com. One of the triples from that description, describing the weight of the tent, was:

有时候RDF应用需要描述RDF陈述,例如,为了记录RDF陈述发表的时间,作者和其他类似的信息(有时这些信息称为“来源”信息)。在3.2节的例9中,我们描述了一个帐篷,其URIref是exproducts:item10245, 被example.com出售。其中一个三元组描述了帐篷的重量:
exproducts:item10245 exterms:weight "2.4"^^xsd:decimal .


and it might be useful for example.com to record who provided that particular piece of information.
如果能记录是谁提供了这个信息,可能对example.com有用。
RDF provides a built-in vocabulary intended for describing RDF statements. A description of a statement using this vocabulary is called a reification of the statement. The RDF reification vocabulary consists of the type rdf:Statement, and the properties rdf:subject, rdf:predicate, and rdf:object. However, while RDF provides this reification vocabulary, care is needed in using it, because it is easy to imagine that the vocabulary defines some things that are not actually defined. This point will be discussed further later in this section.
RDF提供了用以描述RDF陈述的内置词汇。用这些词汇对一个陈述的描述称为这个陈述的具体化(reification)。RDF具体化词汇包含类rdf:Statement,属性rdf:subject, rdf:predicate, 和 rdf:object。然而,用RDF具体化词汇需要谨慎,因为很容易想到这些词汇定义了一些实际上没有定义事物。这个问题会再这节的后面讨论。
Using the reification vocabulary, a reification of the statement about the tent's weight would be given by assigning the statement a URIref such as exproducts:triple12345 (so statements can be written describing it), and then describing the statement using the statements:
用RDF具体化词汇,关于帐篷重量的陈述的具体化可以通过给这个陈述一个URIref,如exproducts:triple12345(这样可以写陈述去描述它),可以通过以下陈述描述它:
exproducts:triple12345 rdf:type rdf:Statement .
exproducts:triple12345 rdf:subject exproducts:item10245 .
exproducts:triple12345 rdf:predicate exterms:weight .
exproducts:triple12345 rdf:object "2.4"^^xsd:decimal .


These statements say that the resource identified by the URIref exproducts:triple12345 is an RDF statement, that the subject of the statement refers to the resource identified by exproducts:item10245, the predicate of the statement refers to the resource identified by exterms:weight, and the object of the statement refers to the decimal value identified by the typed literal "2.4"^^xsd:decimal. Assuming that the original statement is actually identified by exproducts:triple12345, it should be clear by comparing the original statement with the reification that the reification actually does describe it. The conventional use of the RDF reification vocabulary always involves describing a statement using four statements in this pattern; the four statements are sometimes referred to as a "reification quad" for this reason.

这些陈述是说:由URIref exproducts:triple12345标识的资源是一个RDF陈述,且这个陈述的主体是exproducts:item10245标识的资源,这个陈述的谓词是exterms:weight标识的资源,这个陈述的客体是有类型文字"2.4"^^xsd:decimal标识的小数值。假设原来的陈述的确是被exproducts:triple12345标识的,通过比较原来的陈述和这个陈述的具体化,很清楚具体化的确描述了原来的陈述。RDF具体化词汇的惯用法通常包含了用这个模式描述的四个陈述,因此,这四个陈述有时被称为“具体化四元组”(reification quad)。
Using reification according to this convention, example.com could record the fact that John Smith made the original statement about the tent's weight by first assigning the original statement a URIref (such as exproducts:triple12345 as before), describing that statement using the reification just described, and then adding an additional statement that exproducts:triple12345 was written by John Smith (using a URIref to identify which John Smith is being referred to). The resulting statements would be:
根据这个惯例用RDF具体化,example.com可以这样记录John Smith发表了关于帐篷重量的陈述的事实:首先赋予这个陈述一URIref(如,exproducts:triple12345),用上面描写的具体化描述这个陈述,然后再加一个语句,即exproducts:triple12345 是由John Smith 写的(用一个URIref标识“John Smith”)。结果是:
exproducts:triple12345 rdf:type rdf:Statement .
exproducts:triple12345 rdf:subject exproducts:item10245 .
exproducts:triple12345 rdf:predicate exterms:weight .
exproducts:triple12345 rdf:object "2.4"^^xsd:decimal .
exproducts:triple12345 dc:creator exstaff:85740 .


The original statement, together with the reification and the attribution of the statement to John Smith, forms the graph shown in Figure 17 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure17):
这原来的陈述,和具体化以及作为陈述的作者John Smith形成了如图17所示的图:
reificationFigJul22.png
Figure 17: A Statement, Its Reification, and Its Attribution
图17:一个陈述及其具体化和属性

This graph could be written in RDF/XML as shown in Example 19 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example19):

这个图用RDF/XML的写法如例19所示:
Example 19: RDF/XML for the Reification Example
例19:一个具体化例子的RDF/XML表示

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

            xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:exterms="http://www.example.com/terms/"
xml:base="http://www.example.com/2002/04/products">


  <rdf:Description rdf:ID="item10245">
<exterms:weight rdf:datatype="&xsd;decimal">2.4</exterms:weight>
</rdf:Description>


  <rdf:Statement rdf:about="#triple12345">
<rdf:subject rdf:resource="http://www.example.com/2002/04/products#item10245"/>
<rdf:predicate rdf:resource="http://www.example.com/terms/weight"/>
<rdf:object rdf:datatype="&xsd;decimal">2.4</rdf:object>


     <dc:creator rdf:resource="http://www.example.com/staffid/85740"/>
</rdf:Statement>


</rdf:RDF>


Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources) introduced the use of the rdf:ID attribute in RDF/XML in an rdf:Description element to abbreviate the URIref of the subject of a statement. rdf:ID can also be used in a property element to automatically produce a reification of the triple that the property element generates. Example 20 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example20) shows how this could be used to produce the same graph as Example 19 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example19):

3.2节介绍了使用RDF/XML的rdf:ID属性于rdf:Description元素中来简化称述主体的URIref。rdf:ID也可以用在属性元素节点中,用来自动产生一个属性元素生成的三元组的具体化。例20 显示了这样可以表示和例19同样的图:

Example 20: Generating Reifications using rdf:ID
例20:用rdf:ID 生成具体化表示

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

            xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:exterms="http://www.example.com/terms/"
xml:base="http://www.example.com/2002/04/products">


  <rdf:Description rdf:ID="item10245">
<exterms:weight rdf:ID="triple12345" rdf:datatype="&xsd;decimal">2.4
</exterms:weight>
</rdf:Description>


  <rdf:Description rdf:about="#triple12345">
<dc:creator rdf:resource="http://www.example.com/staffid/85740"/>
</rdf:Description>


</rdf:RDF>


In this case, specifying the attribute rdf:ID="triple12345" in the exterms:weight element results in the original triple describing the tent's weight:
在这种情况下,把属性节点rdf:ID="triple12345"放在exterms:weight元素中,达到与原来描述帐篷重量的三元组同样的效果:
exproducts:item10245 exterms:weight "2.4"^^xsd:decimal .


plus the reification triples:
和一些具体化三元组:
exproducts:triple12345 rdf:type rdf:Statement .
exproducts:triple12345 rdf:subject exproducts:item10245 .
exproducts:triple12345 rdf:predicate exterms:weight .
exproducts:triple12345 rdf:object "2.4"^^xsd:decimal .


The subject of these reification triples is a URIref formed by concatenating the base URI of the document (given in the xml:base declaration), the character "#" (to indicate that what follows is a fragment identifier), and the value of the rdf:ID attribute; that is, the triples have the same subject exproducts:triple12345 as in the previous examples.
这些具体化三元组的主体是一个URIref,它是由文档的基准URI(在xml:base中声明),字符“#“和rdf:ID的值连接而成。也就是说,这些三元组和前面的例子一样,具有相同的主体:exproducts:triple12345。
Note that asserting the reification is not the same as asserting the original statement, and neither implies the other. That is, when someone says that John said something about the weight of a tent, they are not making a statement about the weight of a tent themselves, they are making a statement about something John said. Conversely, when someone describes the weight of a tent, they are not also making a statement about a statement they made (since they may have no intention of talking about things called "statements").
注意:对具体化做断言和对原来的陈述做断言是不同的,并且,它们中的一个成立不能推出另一个成立。也就是说,当有的人说,John说了些关于帐篷重量的东西,他们并不是在陈述一个帐篷的重量,他们是在陈述John说了什么。相反地, 当某人(用一个陈述)描述了一个帐篷的重量,他并没有对这个陈述做出其他的陈述(因为他可能没有兴趣说关于“陈述”的事情)。
The text above deliberately referred in a number of places to "the conventional use of reification". As noted earlier, care is needed when using the RDF reification vocabulary because it is easy to imagine that the vocabulary defines some things that are not actually defined. While there are applications that successfully use reification, they do so by following some conventions, and making some assumptions, that are in addition to the actual meaning that RDF defines for the reification vocabulary, and the actual facilities that RDF provides to support it.
上述说法在一些地方被称为“具体化的惯例用法”。就像前面说到的一样,用RDF具体化词汇的时候要谨慎,因为很容易设想这些词汇定义了一些其实并没有定义的事情。如果有应用程序成功使用具体化词汇,他们是通过遵循某些惯例,做了一些假设做到的,这些惯例和假设都是在RDF为具体化词汇定义的真正意义之外的,也是在RDF为了支持他们而提供的真正辅助之外的。


For one thing, it is important to note that in the conventional use of reification, the subject of the reification triples is assumed to identify a particular instance of a triple in a particular RDF document, rather than some arbitrary triple having the same subject, predicate, and object. This particular convention is used because reification is intended for expressing properties such as dates of composition and source information, as in the examples given already, and these properties need to be applied to specific instances of triples. There could be several triples that have the same subject, predicate, and object and, although a graph is defined as a set of triples, several instances with the same triple structure might occur in different documents. Thus, to fully support this convention, there needs to be some means of associating the subject of the reification triples with an individual triple in some document. However, RDF provides no way to do this.
首先,重要的是,在具体化的惯例用法中,具体化三元组的主体是假设为标识了在一个特定的RDF文档中特定的三元组,而不是一些任意的具有相同的主体,谓词,客体的三元组。使用这个惯例是因为具体化是被设计用于表达一些属性,如书写的日期,RDF数据远信息,就像例子中已经给出的那样,这些属性必须应用于三元组的特定实例。有可能有多个三元组具有相同的主体,谓词,客体,另外,尽管图是定义为一个三元组的“集合”,多个结构相同的三元组实例可能出现在不同的文档中。因此,为了完全支持这个惯例,需要一些方式来将具体化三元组的主体和一些文档中个体三元组关联起来。然而,RDF没有提供办法实现它。
For instance, in the examples above, there is no explicit information in either the triples or the RDF/XML that actually indicates that the original statement describing the tent's weight is the resource exproducts:triple12345, the resource that is the subject of the four reification statements and the statement that John Smith created it. This can be seen by looking at the drawn graph shown in Figure 17 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure17). The original statement is certainly part of this graph, but as far as the information in the graph is concerned, exproducts:triple12345 is a separate resource, rather than identifying that part of the graph. RDF does not provide a built-in way of indicating how a URIref like exproducts:triple12345 is associated with a particular statement or graph, any more than it provides a built-in way of indicating how a URIref like exproducts:item10245 is associated with an actual tent. Associating specific URIrefs with specific resources (statements in this case) must be done using mechanisms outside of RDF.
例如,在上面的例子中,在三元组中和RDF/XML中都没有显式的信息说那个描述帐篷重量的陈述就是资源exproducts:triple12345,它是四个具体化三元组的主体,也是John Smith做出的陈述。这可以从图17 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure17)看出。原来的陈述当然是图的一部分,但就图上的信息而言,exproducts:triple12345是一个单独的资源,而不是标识了图中的那个陈述。RDF没有提供内置的方式来表明一个像exproducts:triple12345的URIref是怎样关联到一个特定的陈述或图的,和没有提供内置的方式来表明一个像exproducts: item10245的URIref是怎样关联到一个具体的帐篷一样。关联特定的URIref到特定的资源(这里是陈述)必须通过RDF以外的机制实现。
Using rdf:ID as shown in Example 20 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example20) generates the reification automatically, and provides a convenient way of indicating the URIref to be used as the subject of the statements in the reification. Moreover, it provides a partial "hook" relating the triples in the reification with the piece of RDF/XML syntax that caused them to be created, since the value triple12345 of the rdf:ID attribute is used to generate the URIref of the subject of the reification triples. However, this relationship is once again outside RDF, since there is nothing in the resulting triples that explicitly says that the original triple had the URIref exproducts:triple12345 (RDF does not assume there is any relationship between a URIref and any RDF/XML that it might have been used or abbreviated in).
用如例20 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example20)所示的rdf:ID能够自动生成具体化三元组,这提供了一种方便的办法来表明用在具体化中的陈述的主体URIref。而且,它提供了一个“窍门”用以把具体化三元组和创建他们的RDF/XML语法部分关联起来,因为rdf:ID属性的值triple12345是用于生成具体化三元组的主体URIref。然而,这个关联还是在RDF之外的,因为生成的三元组中没有任何东西显式地说原来的三元组有个URIref是exproducts:triple12345(RDF并不假设在一个URIref和任何使用了这个URIref或其缩写形式的RDF/XML之间有任何关系)。
The lack of a built-in means for assigning URIrefs to statements does not mean that "provenance" information of this kind cannot be expressed in RDF, just that it cannot be done using only the meaning RDF associates with the reification vocabulary. For example, if an RDF document (say, a Web page) has a URI, statements could be made about the resource identified by that URI and, based on some application-dependent understanding of how those statements should be interpreted, an application could act as if those statements "distribute" over (apply equally to) all the statements in the document. Also, if some mechanism exists (outside of RDF) to assign URIs to individual RDF statements, then statements could certainly be made about those individual statements, using their URIs to identify them. However, in these cases, it would also not be strictly necessary to use the reification vocabulary in the conventional way.
缺乏内置的方式赋予陈述URIref并不意味着这种类型的来源(provenance)信息无法在RDF中表示,而是这无法仅仅用RDF关联给具体化词汇的语义达到。例如,如果一个RDF文档(如,一个网页)有个URI,这可以对这个URI表示的资源做出陈述,然后,通过一些应用相关的对这些陈述的解释,一个应用可以认为这些陈述对文档中的全部陈述起作用。另外,如果有些RDF之外的机制可用以赋予RDF陈述URI,当然可以做出关于陈述(用这些URI标识)的陈述。然而,这样的话,没有必要严格遵照具体化词汇的惯例用法。
To see this, assuming the original statement:
为了明白这点,假设原来的陈述:
exproducts:item10245 exterms:weight "2.4"^^xsd:decimal .

had a URIref of exproducts:triple12345, the statement could be attributed to John Smith simply by the statement:
有一个URIref exproducts:triple12345,这个陈述可以简单地通过下面的陈述让其归属于John Smith:
exproducts:triple12345 dc:creator exstaff:85740 .

with no use of the reification vocabulary (although the description of exproducts:triple12345 as having rdf:type rdf:Statement might also be helpful).
而没有用具体化词汇(尽管加上exproducts:triple12345的rdf:type是rdf:Statement可能是有益的)。
In addition, the reification vocabulary could be used directly according to the convention described above, along with an application-dependent understanding as to how to associate specific triples with their reifications. However, other applications receiving this RDF would not necessarily share this application-dependent understanding, and thus would not necessarily interpret the graphs appropriately.
另外,具体化词汇在使用时,可以直接遵照上述的惯例,并附带应用相关的对如何把特定的三元组和其具体化关联起来的理解。然而,其他收到这个RDF数据的应用不一定能够分享这个应用相关的理解,因此不一定能够正确地解释这个图。
It is also important to note that the interpretation of reification described here is not the same as "quotation", as found in some languages. Instead, the reification describes the relationship between a particular instance of a triple and the resources the triple refers to. The reification can be read intuitively as saying "this RDF triple talks about these things", rather than (as in quotation) "this RDF triple has this form." For instance, in the reification example used in this section, the triple:
还有一点需要重视:这里讲述的具体化的解释和一些语言中的“引用”(quotation)不同。具体化描述了一个特定的三元组的实例和这三元组提及的资源之间的关系,具体化可以直观地理解为:这个三元组说的是这些事物,而不是在引用中的:这个三元组有这个形式。例如,在这节中的具体化例子中,三元组
exproducts:triple12345 rdf:subject exproducts:item10245 .

describing the rdf:subject of the original statement says that the subject of the statement is the resource (the tent) identified by the URIref exproducts:item10245. It does not say that the subject of the statement is the URIref itself (i.e., a string beginning with certain characters), as quotation would do.
描述了原来的陈述的rdf:subject, 是说陈述的主体是由URIref exproducts:item10245标识的资源(那个帐篷)。它不是像引用那样说陈述的主体是这个URIref本身(一个由一些字符开头的字符串)。

4.4 More on Structured Values: rdf:value

4.4 关于结构化值(rdf:value)的更多信息


Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties) noted that the RDF model intrinsically supports only binary relations; that is, a statement specifies a relation between two resources. For example, the statement:
2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties)注意到RDF模型本质上只支持二元关系,也就是说,一个陈述表示了两个资源之间的关系。例如,陈述:
exstaff:85740 exterms:manager exstaff:62345 .


states that the relation exterms:manager holds between two employees (presumably one manages the other).
说两个雇员之间有exterms: manager关系(一个管理另一个)。
However, in some cases it is necessary to represent information involving higher arity relations (relations between more than two resources) in RDF. Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties) discussed one example of this, where the problem was to represent the relationship between John Smith and his address information, and the value of John's address was a structured value of his street, city, state, and postal code. Writing this as a relation shows that this address is a 5-ary relation of the form:
然而,有些情况下有必要在RDF中表示多元关系(多于两个资源之间的关系)。2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties) 讨论了一个例子,这个例子的问题是要表示John Smith和他的地址信息,即一个由街道,城市,州,邮政编码组成的结构。可以看出这个地址信息是一个5元关系。
address(exstaff:85740, "1501 Grant Avenue", "Bedford", "Massachusetts", "01730")

Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties) noted that this kind of structured information can be represented in RDF by considering the aggregate thing be described (here, the group of components representing John's address) as a separate resource, and then making separate statements about that new resource, as in the triples:
2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties)注意到这种结构化的信息可以通过聚集一部分信息作为一个单独的资源(这里,John’s的地址信息),然后对这个新资源发表单独的陈述,如下面的三元组所示:


exstaff:85740 exterms:address _:johnaddress .
_:johnaddress exterms:street "1501 Grant Avenue" .
_:johnaddress exterms:city "Bedford" .
_:johnaddress exterms:state "Massachusetts" .
_:johnaddress exterms:postalCode "01730" .


(where _:johnaddress is the blank node identifier of the blank node representing John's address.)

This is a general way to represent any n-ary relation in RDF: select one of the participants (John in this case) to serve as the subject of the original relation (address in this case), then specify an intermediate resource to represent the rest of the relation (either with or without assigning it a URI), then give that new resource properties representing the remaining components of the relation.
(其中_:johnaddress是表示John’s的地址的匿名节点的标识) 这是在RDF中表示N元关系的一般方法:选出关系中的一个元素(这里是John)作为关系(这里是address)的主体,指定一个中间的资源来表示关系中剩下的部分,然后把关系剩下部分都作为这个中间资源的属性。


In the case of John's address, none of the individual parts of the structured value could be considered the "main" value of the exterms:address property; all of the parts contribute equally to the value. However, in some cases one of the parts of the structured value is often thought of as the "main" value, with the other parts of the relation providing additional contextual or other information that qualifies the main value. For instance, in Example 9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9) in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources), the weight of a particular tent was given as the decimal value 2.4 using a typed literal, i.e.,
在John 的地址信息中,没有一个部分能够作为属性exterms:address的主值(main value),所有部分对值的贡献是相同的。然后,有时候,结构中的一部分可以作为结构的主值,其他部分提供上下文信息或其他对主值的修饰信息。例如,在3.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)例9 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example9) 中,一个帐篷的重量的值是小数2.4,也就是,
exproduct:item10245 exterms:weight "2.4"^^xsd:decimal .


In fact, a more complete description of the weight would have been 2.4 kilograms rather than just the decimal value 2.4. To state this, the value of the exterms:weight property would need to have two components, the typed literal for the decimal value and an indication of the unit of measure (kilograms). In this situation the decimal value could be considered the "main" value of the exterms:weight property, because frequently the value would be recorded simply as the typed literal (as in the triple above), relying on an understanding of the context to fill in the unstated units information.
实际上,更为复杂的对重量的描述应该是2.4千克( kilograms),而不是仅仅小数2.4。为了表示这个,属性exterms:weight的值还需要2个部分:作为类型文字的数值和量度的单位(千克)。在这种情况下,数值可以看成属性exterms:weight的主值,因为一般这个值都是一个类型文字,而依赖对上下文信息来填充这个值的单位。
In the RDF model a qualified property value of this kind can be considered as simply another kind of structured value. To represent this, a separate resource could be used to represent the structured value as a whole (the weight, in this case), and to serve as the object of the original statement. That resource could then be given properties representing the individual parts of the structured value. In this case, there should be a property for the typed literal representing the decimal value, and a property for the unit. RDF provides a predefined rdf:value property to describe the main value (if there is one) of a structured value. So in this case, the typed literal could be given as the value of the rdf:value property, and the resource exunits:kilograms as the value of an exterms:units property (assuming the resource exunits:kilograms is defined as part of example.org's vocabulary). The resulting triples would be:
在RDF模型中,这种类型的带有修饰的属性值可以看成一种简单的结构化值。为了表达这个,一个单独的资源可以用来表示结构化值,且作为原来陈述的客体。这个资源可以有属性表示结构值中的部分。在这里,应该有个属性表示数值,还一个属性表示单位。RDF提供了一个预定义的属性rdf:value来描述结构值中的主值。因此,这里的数值可以作为rdf:value的值,资源exunits:kilograms作为属性exterms:units的值(假设资源exunits:kilograms定义为example.org的词汇集的一部分)。结果,这些三元组为:
exproduct:item10245 exterms:weight _:weight10245 .
_:weight10245 rdf:value "2.4"^^xsd:decimal .
_:weight10245 exterms:units exunits:kilograms .


which can be expressed using the RDF/XML shown in Example 21 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example21):
这可以用RDF/XML表示,如例21 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example21)所示:

Example 21: RDF/XML using rdf:value
例21:用rdf:value的RDF/XML表示

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

            xmlns:exterms="http://www.example.org/terms/">


  <rdf:Description rdf:about="http://www.example.com/2002/04/products#item10245">
<exterms:weight rdf:parseType="Resource">
<rdf:value rdf:datatype="&xsd;decimal">2.4</rdf:value>
<exterms:units rdf:resource="http://www.example.org/units/kilograms"/>
</exterms:weight>
</rdf:Description>


</rdf:RDF>


Example 21 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example21) also illustrates a second use of the rdf:parseType attribute introduced in Section 4.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#collections), in this case, rdf:parseType="Resource". An rdf:parseType="Resource" attribute is used to indicate that the contents of an element are to be interpreted as the description of a new (blank node) resource, without actually having to write a nested rdf:Description element. In this case, the rdf:parseType="Resource" attribute used in the exterms:weight property element indicates that a blank node is to be created as the value of the exterms:weight property, and that the enclosed elements (rdf:value and exterms:units) describe properties of that blank node. Further details on rdf:parseType="Resource" are given in [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].
例21 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example21)也显示了对4.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#collections)介绍的属性rdf:parseType的用法,在这里,rdf:parseType="Resource"用以表示节点的内容同时被解释为一个新的匿名节点,而不用写一个嵌套的rdf:Description元素。rdf:parseType="Resource" 用在属性 exterms:weight 元素节点中表示创建了一个匿名节点作为属性的值,且包含的元素 (rdf:value 和 exterms:units) 描述了这个匿名节点的属性。关于rdf:parseType="Resource"更详细的信息在[RDF-SYNTAX].


The same approach can be used to represent quantities using any units of measure, as well as values taken from different classification schemes or rating systems, by using the rdf:value property to give the main value, and using additional properties to identify the classification scheme or other information that further describes the value.
相同的方法也可用于表示具有任何单位的数量,用rdf:value属性表示主值,用其他的属性表示关于数量的其他信息。
There is no need to use rdf:value for these purposes (e.g., a user-defined property name, such as exterms:amount, could have been used instead of rdf:value in Example 21 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example21)), and RDF does not associate any special meaning with rdf:value. rdf:value is simply provided as a convenience for use in these commonly-occurring situations.
但没有必要用rdf:value去取代用户自定义的属性,如例21 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example21)中的属性exterms:amount, 因为RDF并没有给rdf:value特殊的解释。它只是作为表示这种情形的惯例。
However, even though much existing data in databases and on the Web (and in later Primer examples) takes the form of simple values for properties such as weights, costs, etc., the principle that such simple values are often insufficient to adequately describe these values is an important one. In a global environment such as the Web, it is generally not safe to make the assumption that anyone accessing a property value will understand the units being used (or other contextually-dependent information that may be involved). For example, a U.S. site might give a weight value in pounds, but someone accessing that data from outside the U.S. might assume that weights are given in kilograms. The correct interpretation of data in the Web environment may require that additional information (such as units information) be explicitly recorded. This can be done in many ways, such as using rdf:value, building units into property names (e.g., exterms:weightInKg), defining specialized datatypes that include units information (e.g., extypes:kilograms), or adding additional user-defined properties to specify this information (e.g., exterms:unitOfWeight), either in descriptions of individual items or products, in descriptions of sets of data (e.g., all the data in a catalog or on a site), or in schemas (see Section 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)).

然而,尽管大部分数据库中和Web上的数据用简单的数值作为属性(如,重量,价格等)的值,这种简单的数值往往不足够描述这些值。在像Web这样的环境,一般来说,假设其他人访问属性的值的时候能知道它的单位(或其他上下文相关的信息)是不稳妥的。例如,一个美国的网站给出重量的单位默认是磅,但非美国的人访问这个数据的时候常假设单位是公斤。对Web上数据的正确解释可能需要其他的信息,如单位信息。这有很多种方法:例如,用rdf:value,把单位信息放在属性名字种,如属性exterms:weightInKg包含了数据的单位信息。或者,加上用户自定义的的信息,如exterms:unitOfWeight, 在物品或产品实例的描述中,在一个数据集的描述中,或者在Schema中(参考第5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)


4.5 XML Literals

4.5 XML文字


Sometimes the value of a property needs to be a fragment of XML, or text that might contain XML markup. For example, a publisher might maintain RDF metadata that includes the titles of books and articles. While such titles are often just simple strings of characters, this is not always the case. For instance, the titles of books on mathematics may contain mathematical formulas that could be represented using MathML [MATHML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-mathml)]. Titles might also include markup for other reasons, such as for Ruby annotations [RUBY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ruby)], or for bidirectional rendering or special glyph variants (see, e.g., [CHARMOD (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-charmod)]).
有时候,属性的值可能是一个XML的片断,或包含XML标记的文本。例如,出版社可能要维护一些RDF元数据,包括书和文章的标题。当然,这些标题可能是简单的字符串,但并不总是这样。例如,数学书的标题可能包含用MathML [MATHML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-mathml)]表示的数学公式。标题还可能因为其他原因包含标记,如 Ruby标注 [RUBY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ruby)], 或者双相的显示特殊的浮雕型变量。 ([CHARMOD (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-charmod)])
RDF/XML provides a special notation to make it easy to write literals of this kind. This is done using a third value of the rdf:parseType attribute. Giving an element the attribute rdf:parseType="Literal" indicates that the contents of the element are to be interpreted as an XML fragment. Example 22 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example22) illustrates the use of rdf:parseType="Literal":
RDF/XML提供了一个特殊的符号,使书写这种文字变得简单。即通过属性rdf:parseType第三个值,如果一个元素节点的有属性节点rdf:parseType="Literal",表明这个元素节点的内容应该被解释为一个XML片断。例22 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example22) 演示了这种用法。

Example 22: RDF/XML for an XML Literal
例22:一个XML文字的RDF/XML表示

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

            xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:base="http://www.example.com/books">


  <rdf:Description rdf:ID="book12345">
<dc:title rdf:parseType="Literal">
<span xml:lang="en">
The <em>&lt;br /&gt;</em> Element Considered Harmful.
</span>
</dc:title>
</rdf:Description>


</rdf:RDF>


The RDF/XML in Example 22 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example22) describes a graph containing a single triple with subject ex:book12345, and predicate dc:title. The rdf:parseType="Literal" attribute in the RDF/XML indicates that all the XML within the <dc:title> element is an XML fragment that is the value of the dc:title property. In the graph, this value is a typed literal, whose datatype, rdf:XMLLiteral, is defined in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)] specifically to represent fragments of XML (including character sequences that may or may not include XML markup). The XML fragment is canonicalized according to the XML Exclusive Canonicalization recommendation [XML-XC14N (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml-xc14n)]. This causes declarations of used namespaces to be added to the fragment, the uniform escaping or unescaping of characters, the expansion of empty-element tags, and other transformations. (For these reasons, and the fact that the triples notation itself requires further escaping, the actual typed literal is not shown here. RDF/XML provides the rdf:parseType="Literal" attribute so that RDF users will not have to deal directly with these transformations. Those interested in the details should consult [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)] and [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].) Contextual attributes, such as xml:lang and xml:base are not inherited from the RDF/XML document, and, if required, must, as shown in the example, be explicitly specified in the XML fragment.
Example 22 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example22) 中的RDF/XML 描述了一个包含了一个三元组的图,这个三元组的主体是ex:book12345, 谓词是dc:title. 属性节点 rdf:parseType="Literal" 表示元素节点 <dc:title> 下的内容是一个XML片断,即作为属性dc:title的值。在这个图中,值是类型为rdf:XMLLiteral 的类型文字。[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)] 特意定义rdf:XMLLiteral作为表示XML片断的数据类型。这些XML片断都是根据XML Exclusive Canonicalization recommendation [XML-XC14N (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml-xc14n)]规范化了的,这导致了一些转换,如为XML片断加上已用的名字空间声明,统一的字符转义或去转义,空元素的扩展。(因为这些原因以及三元组的标注本身需要一些转义符,这里不显示真正的类型文字。RDF/XML 提供了属性 rdf:parseType="Literal" 使RDF用户不用进行这些转换。详细信息请参考[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)] 和 [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].) 一些上下文属性,如xml:lang 和 xml:base 并不会从RDF/XML文档中继承,如果需要的化,如上例所示,必须在XML片断中给出。
This example illustrates that care must be taken in designing RDF data. It might appear at first glance that titles are simple strings best represented as plain literals, and only later might it be discovered that some titles contain markup. In cases where the value of a property may sometimes contain markup and sometimes not, either rdf:parseType="Literal" should be used throughout, or software must handle both plain literals and literals of type rdf:XMLLiteral as values of the property.
这个例子表明了书写RDF数据是要谨慎。乍看,标题的值是用平凡文字表示的简单字符串,后来又发现会包含XML标记。如果一个属性的值有时包含XML标记,有时有不包含,应该都用rdf:parseType="Literal",或者软件应该能处理属性的值可能是平凡文字和rdf:XMLLiteral类型的文字的情况。

5. Defining RDF Vocabularies: RDF Schema

5. RDF Schema — 定义RDF的词汇表


RDF provides a way to express simple statements about resources, using named properties and values. However, RDF user communities also need the ability to define the vocabularies (terms) they intend to use in those statements, specifically, to indicate that they are describing specific kinds or classes of resources, and will use specific properties in describing those resources. For example, the company example.com from the examples in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources) would want to describe classes such as exterms:Tent, and use properties such as exterms:model, exterms:weightInKg, and exterms:packedSize to describe them (QNames with various "example" namespace prefixes are used as the names of classes and properties here as a reminder that in RDF these names are actually URI references, as discussed in Section 2.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts)). Similarly, people interested in describing bibliographic resources would want to describe classes such as ex2:Book or ex2:MagazineArticle, and use properties such as ex2:author, ex2:title, and ex2:subject to describe them. Other applications might need to describe classes such as ex3:Person and ex3:Company, and properties such as ex3:age, ex3:jobTitle, ex3:stockSymbol, and ex3:numberOfEmployees. RDF itself provides no means for defining such application-specific classes and properties. Instead, such classes and properties are described as an RDF vocabulary, using extensions to RDF provided by the RDF Vocabulary Description Language 1.0: RDF Schema (http://www.w3.org/TR/rdf-schema/) [RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)], referred to here as RDF Schema.


RDF使用命名特性和值来表达与资源有关的简单声明。但是,在某些情况下,用户希望能够根据需要自定义一些词汇,然后用这些词汇来描述资源。这些词汇表明用户正在描述某种资源,并且会采用某些特定的特性来描述。例如,3.2节所举例子中,example.com 公司想要描述一个类:exterms:Tent,并且使用特性 exterms:model,exterms:weightInKg 和 exterms:packedSize来描述它们。(这些类和特性的名字之前带有各种“example”名称空间前缀,表明:在RDF中,这些名字其实都是RUI引用 ,2.1小节中已经讨论过这个问题)。类似的情况,那些对图书资源比较感兴趣的RDF开发人员可能会描述 ex2:Book或者ex2:MagazineArtical这样的类,并使用ex2:author, ex2:title ,ex2:subject之类的特性来描述这些类。其它的一些应用可能会描述诸如ex3:Person、ex3:Company 这样的类和ex3:age 、ex3:jobTitle、ex3:stockSymbol 、ex3:numberofEmployee之类的一些特性。RDF本身并不能针对特定应用需求来定义一些类和特性。这些类和特性被称为RDF词汇,它们需要通过RDF词汇描述语言:RDF Schema(RDF的一种扩展语言) 来定义。


RDF Schema does not provide a vocabulary of application-specific classes like exterms:Tent, ex2:Book, or ex3:Person, and properties like exterms:weightInKg, ex2:author or ex3:JobTitle. Instead, it provides the facilities needed to describe such classes and properties, and to indicate which classes and properties are expected to be used together (for example, to say that the property ex3:jobTitle will be used in describing a ex3:Person). In other words, RDF Schema provides a type system for RDF. The RDF Schema type system is similar in some respects to the type systems of object-oriented programming languages such as Java. For example, RDF Schema allows resources to be defined as instances of one or more classes. In addition, it allows classes to be organized in a hierarchical fashion; for example a class ex:Dog might be defined as a subclass of ex:Mammal which is a subclass of ex:Animal, meaning that any resource which is in class ex:Dog is also implicitly in class ex:Animal as well. However, RDF classes and properties are in some respects very different from programming language types. RDF class and property descriptions do not create a straightjacket into which information must be forced, but instead provide additional information about the RDF resources they describe. This information can be used in a variety of ways, which will be discussed in Section 5.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#interpretingschema).



RDF Schema 并没有针对特定应用提供诸如 exterms:Tent , ex2:Book 或者 ex3:Person这样的一些类或者是诸如 exterms:weightInKg ex2:author 或者 ex3:JobTitle 这样的一些特性词汇。RDFS只是提供了描述一种这些类和特性的能力 (facilities),并且可以暗示某些类和特性期望合在一起使用(例如,特性 ex3:jobTitle 应该用来描述ex3:Person)。换句话说,RDF Schema为RDF提供了一个类型系统。RDF Schema 类型系统在某些方面类似于Java这样的面向对象编程语言的类型系统。例如,RDF Schema允许资源被定义为一个或者多个类的实例。另外,RDFS通常把类组织成为一种分级结构;例如,类 ex:Dog可以定义为ex:Mammal的子类,而ex:Mammal又是ex:Animal的子类。 如果某个资源是类 ex:Dog的实例,那么隐含意味着它也是ex:Animal的实例。然而,RDF 类和特性在某些方面又与编程语言的类型系统有着明显的差异。RDF类和特性并没有过多束缚资源的描述方式,而是提供了一些关于RDF 资源的额外描述信息。这些添加的信息可以通过各种方式来使用,具体内容将在5.3节中介绍。


The RDF Schema facilities are themselves provided in the form of an RDF vocabulary; that is, as a specialized set of predefined RDF resources with their own special meanings. The resources in the RDF Schema vocabulary have URIrefs with the prefix http://www.w3.org/2000/01/rdf-schema# (conventionally associated with the QName prefix rdfs:). Vocabulary descriptions (schemas) written in the RDF Schema language are legal RDF graphs. Hence, RDF software that is not written to also process the additional RDF Schema vocabulary can still interpret a schema as a legal RDF graph consisting of various resources and properties, but will not "understand" the additional built-in meanings of the RDF Schema terms. To understand these additional meanings, RDF software must be written to process an extended language that includes not only the rdf: vocabulary, but also the rdfs: vocabulary, together with their built-in meanings. This point will be illustrated in the next section.


RDF Schema 所具有的这些能力本身也是以 RDF词汇形式提供的。也就是说,这些RDF 词汇是一组带有特殊含义的、预定义的RDF资源。 这些资源的(RDF Schema词汇)URI带有前缀 http://www.w3.org/2000/01/rdf-schema# (QName通常采用前缀 rdfs:)。采用RDF Schema 语言所定义的词汇描述(schemas)也是合法的RDF图。因此,即使一个软件不是专为处理新加的RDF Schema词汇而开发的,它仍然可以将schema解释为一个包含了各种资源和特性的合法RDF图,但是这个软件并不能“理解”新添加的RDF Schema术语的内在含义。为了理解新加术语的含义,RDF 软件必须能够处理一种扩展语言。这种扩展语言不仅仅包含rdf:前缀的词汇,而且还包含了rdfs:前缀的词汇,以及这些词汇的内在含义。下一小节中将对这一点进行详细分析。



The following sections will illustrate RDF Schema's basic resources and properties.


下一小节将详细分析RDF Schema的基本资源和特性。




5.1 Describing Classes


5.1 描述类

A basic step in any kind of description process is identifying the various kinds of things to be described. RDF Schema refers to these "kinds of things" as classes. A class in RDF Schema corresponds to the generic concept of a Type or Category, somewhat like the notion of a class in object-oriented programming languages such as Java. RDF classes can be used to represent almost any category of thing, such as Web pages, people, document types, databases or abstract concepts. Classes are described using the RDF Schema resources rdfs:Class and rdfs:Resource, and the properties rdf:type and rdfs:subClassOf.
描述过程通常从划分被描述事物的种类开始。RDF Schema把事物的种类称之为类(class)。RDF Schema中的类(class)与我们通常所说的类型(Type)或者分类(Category)基本相同,有点类似于面向对象编程语言(比如Java)中的类(class)的概念。RDF类可以用来表示事物的任何分类,例如网页、人、文档类型、数据库或者抽象概念等。类可以通过RDF Schema中的资源(rdfs:Class和rdfs:Resource)以及特性(rdf:type和rdfs:subClassOf)来表示。

For example, suppose an organization example.org wanted to use RDF to provide information about different kinds of motor vehicles. In RDF Schema, example.org would first need a class to represent the category of things that are motor vehicles. The resources that belong to a class are called its instances. In this case, example.org intends for the instances of this class to be resources that are motor vehicles.
例如,假设example.org这个组织想用RDF来提供有关不同种类机动车(Motor vehicles)的信息,那么它在RDF Schema中首先需要一个代表机动车这一分类(category)的类(class)。属于某个类(class)的资源被称为该类的实例(instances)。在本例中,所有是机动车的资源都是这个类的实例。

In RDF Schema, a class is any resource having an rdf:type property whose value is the resource rdfs:Class. So the motor vehicle class would be described by assigning the class a URIref, say ex:MotorVehicle (using ex: to stand for the URIref http://www.example.org/schemas/vehicles, which is used as the prefix for URIrefs from example.org's vocabulary) and describing that resource with an rdf:type property whose value is the resource rdfs:Class. That is, example.org would write the RDF statement:
在RDF Schema中,一个是任何具有rdf:type特性、并且该特性的值为rdfs:Class的资源。因此,可以这样来描述一个机动车类:为该类指定一个URIref,比如ex:MotorVehicle(其中的前缀 ex: 代表URIref http://www.example.org/schemas/vehicles,ex: 被用作example.org词汇表中的所有URIrefs的前缀),然后将这个机动车类描述为一个具有rdf:type特性、并且特性值为rdfs:Class的资源。也就是说,example.org应该编写如下的RDF声明:

 ex:MotorVehicle   rdf:type   rdfs:Class .

As indicated in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources), the property rdf:type is used to indicate that a resource is an instance of a class. So, having described ex:MotorVehicle as a class, resource exthings:companyCar would be described as a motor vehicle by the RDF statement:
正如在3.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)中所讨论的那样,特性rdf:type用来表明一个资源是某个类的实例。因此,将ex:MotorVehicle描述为类之后,可以用下面的RDF声明来描述资源exthing:companyCar是一个机动车:

 exthings:companyCar   rdf:type   ex:MotorVehicle .

(This statement uses a common convention that class names are written with an initial uppercase letter, while property and instance names are written with an initial lowercase letter. However, this convention is not required in RDF Schema. The statement also assumes that example.org has decided to define separate vocabularies for classes of things, and instances of things.)
(在书写上述RDF声明时,遵守了一些约定,即:将类名的首字母大写,而将特性和实例名称的首字母小写。但是,RDF Schema并不强制要求这一点。上述RDF声明也假定:example.org已分别为事物的类(classes)和事物的实例(instances)定义了两个不同的词汇表[译注//这两个词汇表分别在ex:和exthings:所代表的命名空间里定义]。)

The resource rdfs:Class itself has an rdf:type of rdfs:Class. A resource may be an instance of more than one class.
rdfs:Class本身也是资源,而且也有一个rdf:type特征并且该特性的值为rdfs:Class。一个资源可以是一个或多个类的实例.

After describing class ex:MotorVehicle, example.org might want to describe additional classes representing various specialized kinds of motor vehicle, e.g., passenger vehicles, vans, minivans, and so on. These classes can be described in the same way as class ex:MotorVehicle, by assigning a URIref for each new class, and writing RDF statements describing these resources as classes, e.g., writing:
example.org在描述了ex:MotorVehicle类之后,也许还要再定义一些类来代表各种特定种类的机动车,例如客车(passenger vehicles)、大篷货车(vans)、小型货车(minivans)等等。这些类可以采用和类ex:MotorVehicle同样的方法来定义:首先为每个新建的类指定一个URIref,然后编写如下的RDF声明将这些资源定义为类:

 ex:Van     rdf:type   rdfs:Class .
ex:Truck rdf:type rdfs:Class .

and so on. However, these statements by themselves only describe the individual classes. example.org may also want to indicate their special relationship to class ex:MotorVehicle, i.e., that they are specialized kinds of MotorVehicle.
但是上面这些声明本身只是对单个的类的定义。example.org可能还要描述上面定义的类与类ex:MotorVehicle之间的特定关系,比如它们是机动车(MotorVehicle)中的一

This kind of specialization relationship between two classes is described using the predefined rdfs:subClassOf property to relate the two classes. For example, to state that ex:Van is a specialized kind of ex:MotorVehicle, example.org would write the RDF statement:
这种两个类之间的特化关系(specialization relationship)可以用预定义的特性rdfs:subClassOf来描述。例如,可以通过编写下面这条RDF声明来描述ex:Van是一种特殊的ex:MotorVehicle:

 ex:Van   rdfs:subClassOf   ex:MotorVehicle .

The meaning of this rdfs:subClassOf relationship is that any instance of class ex:Van is also an instance of class ex:MotorVehicle. So if resource exthings:companyVan is an instance of ex:Van then, based on the declared rdfs:subClassOf relationship, RDF software written to understand the RDF Schema vocabulary can infer the additional information that exthings:companyVan is also an instance of ex:MotorVehicle.
在上面的例子中,rdfs:subClassOf的含义是:任何ex:Van类的实例同时也是ex:MotroVehicle类的实例。因此,如果资源exthings:companyVan是ex:Van的一个实例,那么理解RDF Schema词汇表的RDF软件可以根据上面声明的rdfs:subClassOf关系推理出额外的有用信息,即exthings:companyVan也是ex:MotorVehicle的一个实例。

This example of exthings:companyVan illustrates the point made earlier about RDF Schema defining an extended language. RDF itself does not define the special meaning of terms from the RDF Schema vocabulary such as rdfs:subClassOf. So if an RDF schema defines this rdfs:subClassOf relationship between ex:Van and ex:MotorVehicle, RDF software not written to understand the RDF Schema terms would recognize this as a triple, with predicate rdfs:subClassOf, but it would not understand the special significance of rdfs:subClassOf, and not be able to draw the additional inference that exthings:companyVan is also an instance of ex:MotorVehicle.
exthings:companyVan的例子说明了一点,即RDF Schema可以定义一种扩展语言。但是,RDF本身并没有定义RDF Schema中的词汇(比如 rdfs:subClassOf)所具有的含义。因此,即时某个RDF schema[译注//注意RDF Schema与RDF schema的区别]定义了ex:Van和ex:MotorVehicle之间的rdfs:subClassOf关系(通过编写一个RDF声明),但是对于不理解RDF Schema术语的RDF软件来说,这个RDF声明只是一个以rdfs:subClassOf为谓词的三元组,该RDF软件并不能理解rdfs:subClassOf所代表的含义,因此也不能据此得到额外的结论:exthing:companyVan也是ex:MotorVehicle的实例。

The rdfs:subClassOf property is transitive. This means, for example, that given the RDF statements:
rdfs:subClassOf特性具有传递性(transitive)。也就是说,如果给出下列RDF声明:

 ex:Van       rdfs:subClassOf   ex:MotorVehicle .
ex:MiniVan rdfs:subClassOf ex:Van .

RDF Schema defines ex:MiniVan as also being a subclass of ex:MotorVehicle. As a result, RDF Schema defines resources that are instances of class ex:MiniVan as also being instances of class ex:MotorVehicle (as well as being instances of class ex:Van). A class may be a subclass of more than one class (for example, ex:MiniVan may be a subclass of both ex:Van and ex:PassengerVehicle). RDF Schema defines all classes as subclasses of class rdfs:Resource (since the instances belonging to all classes are resources).
这些声明可以推理出ex:MiniVan同时也是ex:MotroVehicle的子类。相应的,如果RDF Schema定义了某个资源是ex:MiniVan的实例,那么它也是ex:MotorVehicle的实例(同时也是类ex:Van的实例)。一个类可以是一个或多个类的子类。(例如:ex:MiniVan可以同时为ex:Van和ex:PassengerVehicle的子类)。RDF Schema规定:所有的类总是rdfs:Resource的子类(因为任何类的实例都是资源)。

Figure 18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18) shows the full class hierarchy being discussed in these examples.
图18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18)是上面这些例子的一个完整的类层次图。

vehicleClassesJan12.png

图18:车辆类层次图

(To simplify the figure, the rdf:type properties relating each of the classes to rdfs:Class are omitted in Figure 18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18). In fact, RDF Schema defines both the subjects and objects of statements that use the rdfs:subClassOf property to be resources of type rdfs:Class, so this information could be inferred. However, in actually writing schemas, it is good practice to explicitly provide this information.)
为了简化起见,图18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18)中将连接类和rdfs:Class的rdf:type特性全部省略了。事实上,根据RDF Schema的定义,一个以rdfs:subClassOf为谓词的声明中的主体和客体都应该是rdfs:Class类型的资源。因此,这些信息可以推理出来,不过在实际编写schema的时候,明确声明这些信息是一种比较好的编码风格。

This schema could also be described by the triples:
上图所示的schema可以用下列三元组来描述:

 ex:MotorVehicle       rdf:type          rdfs:Class .
ex:PassengerVehicle rdf:type rdfs:Class .
ex:Van rdf:type rdfs:Class .
ex:Truck rdf:type rdfs:Class .
ex:MiniVan rdf:type rdfs:Class .
 ex:PassengerVehicle   rdfs:subClassOf   ex:MotorVehicle .
ex:Van rdfs:subClassOf ex:MotorVehicle .
ex:Truck rdfs:subClassOf ex:MotorVehicle .
 ex:MiniVan            rdfs:subClassOf   ex:Van .
ex:MiniVan rdfs:subClassOf ex:PassengerVehicle .

Example 23 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example23) shows how this schema could be written in RDF/XML.
上述schema可用例23 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example23)所示的RDF/XML来书写。

Example 23: The Vehicle Class Hierarchy in RDF/XML
例23:用RDF/XML书写的车辆类层次图

 <?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<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://example.org/schemas/vehicles">
<rdf:Description rdf:ID="MotorVehicle">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description>
<rdf:Description rdf:ID="PassengerVehicle">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdf:Description>
<rdf:Description rdf:ID="Truck">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdf:Description>
<rdf:Description rdf:ID="Van">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdf:Description>
<rdf:Description rdf:ID="MiniVan">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#Van"/>
<rdfs:subClassOf rdf:resource="#PassengerVehicle"/>
</rdf:Description>
</rdf:RDF>

As discussed in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources) in connection with Example 13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13), RDF/XML provides an abbreviation for describing resources having an rdf:type property (typed nodes). Since RDF Schema classes are RDF resources, this abbreviation can be applied to the description of classes. Using this abbreviation, the schema could also be described as shown in Example 24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24):
正如3.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)以及例13 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example13)中所讨论的,RDF/XML提供了一种简写形式来描述具有rdf:type特性的资源(类型结点)。因为RDF Schema的类同时也是RDF资源,这种简写形式可以应用于对类的描述。上述的schema也可以使用这种简写形式来描述,如例24所示:

Example 24: The Vehicle Class Hierarchy Using the Typed Node Abbreviation
例24:使用类型节点的机动车类层次简写形式

 <?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<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://example.org/schemas/vehicles">
<rdfs:Class rdf:ID="MotorVehicle"/>
<rdfs:Class rdf:ID="PassengerVehicle">
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="Truck">
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="Van">
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="MiniVan">
<rdfs:subClassOf rdf:resource="#Van"/>
<rdfs:subClassOf rdf:resource="#PassengerVehicle"/>
</rdfs:Class>
</rdf:RDF>

Similar typed node abbreviations will be used throughout the rest of this section.
本节其余部分都将采用相似的类型节点简写形式。

The RDF/XML in Example 23 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example23) and Example 24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24) introduces names, such as MotorVehicle, for the resources (classes) that it describes using rdf:ID, to give the effect of "assigning" URIrefs relative to the schema document as described in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources). rdf:ID is useful here because it both abbreviates the URIrefs, and also provides an additional check that the value of the rdf:ID attribute is unique against the current base URI (usually the document URI). This helps pick up repeated rdf:ID values when defining the names of classes and properties in RDF schemas. Relative URIrefs based on these names can then be used in other class definitions within the same schema (e.g., as #MotorVehicle is used in the description of the other classes). The full URIref of this class, assuming that the schema itself was the resource http://example.org/schemas/vehicles, would be http://example.org/schemas/vehicles#MotorVehicle (shown in Figure 18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18)). As noted in Section 3.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources), to ensure that the references to these schema classes would be consistently maintained even if the schema were relocated or copied (or to simply assign a base URIref for the schema classes without assuming they are all published at a single location), the class descriptions could also include an explicit xml:base="http://example.org/schemas/vehicles" declaration. Use of an explicit xml:base declaration is considered good practice, and one is provided in both examples.
例23 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example23)例24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24)中的RDF/XML为那些具有rdf:ID特性的资源(类)指定了资源名称(例如:MotorVehicle),这相当于为资源(类)指派了一个相对于schema文档的URIrefs(参见3.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)的描述)。这里的rdf:ID非常有用,因为它不仅仅是URIrefs的简写形式,同时还提供了一种额外检查,即确保rdf:ID属性的值相对于当前的基准URI(通常的情况下就是本文档URI)是唯一的。在RDF schemas中定义类和特性的名称时,这种机制有助于发现重复的rdf:ID值。在同一个schema中,基于这些名字的相对URIrefs可以在其它类的定义中被引用。(例如,可以在其它类的描述中用#MotorVehicle来引用MotorVehicle类)。假定schema本身的URI是http://example.org/schemas/vehicles,那么MotorVehicle类的完整URIref就是http://example.org/schemas/vehicles#MotorVehicle(如图18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18)所示)。正如3.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#newresources)所指出的,schema可能被移动或复制(或者只是为schema中的类指定一个基准URIref,而不假定它们被发布在同一个位置)。为了确保在这些情况下对schema中类的引用能够维持一致,可以在定义这些类的时候显式声明一个基准URI(即增加属性xml:base="http://example.org/schemas/vehicles")。显式声明xml:base是一种良好的编码风格,前面两个例子就是这样做。

To refer to these classes in RDF instance data (e.g., data describing individual vehicles of these classes) located elsewhere, example.org would need to identify the classes either by writing absolute URIrefs, by using relative URIrefs together with an appropriate xml:base declaration, or by using QNames together with an appropriate namespace declaration that allows the QNames to be expanded to the proper URIrefs. For example, the resource exthings:companyCar could be described as an instance of the class ex:MotorVehicle described in the schema of Example 24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24) by the RDF/XML shown in Example 25 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example25) :
为了在别处的RDF实例数据(即描述属于某个类的个体的数据)中引用这些类,example.org可采取下列方式:声明一个恰当的xml:base,并书写相对URIrefs,然后根据这两者所确定的绝对URIrefs来标识类;或者,声明一个恰当的名字空间,并书写QNames,然后根据由QName展开得到的绝对URIrefs来标识类。例如,在例25 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example25)所示的RDF/XML中,资源exthings:companyCar可被描述为类ex:MotorVehicle(在例24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example25)中定义的)的一个实例:

例25:一个ex:MotorVehicle类的实例

 <?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/schemas/vehicles#"
xml:base="http://example.org/things">
<ex:MotorVehicle rdf:ID="companyCar"/>
 </rdf:RDF>

Note that the QName ex:MotorVehicle, when expanded using the namespace declaration xmlns:ex="http://example.org/schemas/vehicles#", becomes the full URIref http://example.org/schemas/vehicles#MotorVehicle, which is the correct URIref for the MotorVehicle class as shown in Figure 18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18). The xml:base declaration xml:base="http://example.org/things" is provided to allow the rdf:ID="companyCar" to expand to the proper exthings:companyCar URIref (since a QName cannot be used as the value of the rdf:ID attribute).
注意:QName ex:MotorVehicle将根据命名空间声明xmlns:ex="http://example.org/schemas/vehicles#"展开为完整的URIref http://example.org/schemas/vehicles#MotorVehicle,即MotorVehicle类的URIref(见图18 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure18))。xml:base声明 xml:base=http://example.org/things 用于将rdf:ID="companyCar"展开为exthings:companyCar所对应的URIref(这里没有采用前一种机制是因为QName不能作为rdf:ID属性的值)。

5.2 Describing Properties

5.2 描述特性

In addition to describing the specific classes of things they want to describe, user communities also need to be able to describe specific properties that characterize those classes of things (such as rearSeatLegRoom to describe a passenger vehicle). In RDF Schema, properties are described using the RDF class rdf:Property, and the RDF Schema properties rdfs:domain, rdfs:range, and rdfs:subPropertyOf.
用户除了描述他们想要描述的类(classes),通常还需要能够定义刻画这些类的特性(properties)(例如用rearSeatLegRoom来描述一个客车)。在RDF schema中,特性是用RDF类rdf:Property以及RDF Schema特性rdfs:domain(定义域)、rdfs:range(值域)以及rdfs;subPropertyOf来描述的。

All properties in RDF are described as instances of class rdf:Property. So a new property, such as exterms:weightInKg, is described by assigning the property a URIref, and describing that resource with an rdf:type property whose value is the resource rdf:Property, for example, by writing the RDF statement:
RDF中的所有特性都被描述为类rdf:Property的实例。因此一个新特性(例如exterms:weigntInKg)的描述是通过为它指派一个URIref,并使用一个值为rdf:Property的rdf:type特性来完成的。例如,书写如下的RDF声明:

 exterms:weightInKg   rdf:type   rdf:Property .

RDF Schema also provides vocabulary for describing how properties and classes are intended to be used together in RDF data. The most important information of this kind is supplied by using the RDF Schema properties rdfs:range and rdfs:domain to further describe application-specific properties.

RDF Schema还提供了一些词汇用于描述如何在RDF数据中正确使用特性和类。其中最重要的一个信息是由RDF Schema特性rdfs:range和rdfs:domain提供的,它们用于进一步描述与应用相关的特性。

The rdfs:range property is used to indicate that the values of a particular property are instances of a designated class. For example, if example.org wanted to indicate that the property ex:author had values that are instances of class ex:Person, it would write the RDF statements:
rdfs:range用于表明某个特性的值(定义域)是给定类的实例。例如,如果example.org想要表明“特性ex:author的值是类ex:person的实例”,那么可以写出如下的RDF声明:

 ex:Person   rdf:type     rdfs:Class .
ex:author rdf:type rdf:Property .
ex:author rdfs:range ex:Person .

These statements indicate that ex:Person is a class, ex:author is a property, and that RDF statements using the ex:author property have instances of ex:Person as objects.
上述声明表明:ex:person是一个类,ex:author是一个特性,并且对于使用ex:author特性的RDF声明,其客体(Object)是ex:person类的实例。

A property, say ex:hasMother, can have zero, one, or more than one range property. If ex:hasMother has no range property, then nothing is said about the values of the ex:hasMother property. If ex:hasMother has one range property, say one specifying ex:Person as the range, this says that the values of the ex:hasMother property are instances of class ex:Person. If ex:hasMother has more than one range property, say one specifying ex:Person as its range, and another specifying ex:Female as its range, this says that the values of the ex:hasMother property are resources that are instances of all of the classes specified as the ranges, i.e., that any value of ex:hasMother is both a ex:Female and a ex:Person.
一个特性(比如ex:hasMother)可以有零个、一个、或多个range特性。如果ex:hasMother没有range特性,那么对ex:hasMother特性的值而言,就没有什么限制。如果ex:hasMother有一个range特性限制,例如指定ex:Person作为其值域,这表明ex:hasMother特性的值是类ex:Person的实例。如果ex:hasMother有多个range特性,例如在指定ex:person为它的range特性的同时,还指定了ex:Femal作为它的range特性,这说明了ex:hasMother特性的值是所有被指定的类的实例。例如,ex:hasMother的值既是一个ex:Femal又是一个ex:Person

This last point may not be obvious. However, stating that the property ex:hasMother has the two ranges ex:Female and ex:Person involves making two separate statements:
最后一点并不是十分明显,即:实际上,为特性ex:hasMother指定两个range(ex:Femal和ex:person)涉及到两个独立的声明:

 ex:hasMother   rdfs:range   ex:Female .
ex:hasMother rdfs:range ex:Person .

For any given statement using this property, say:
对于任何用到上述特性的声明,比方说:

 exstaff:frank   ex:hasMother   exstaff:frances .

in order for both the rdfs:range statements to be correct, it must be the case that exstaff:frances is both an instance of ex:Female and of ex:Person.
为确保两个rdfs:range声明正确,exstaff:frances必须同时是ex:Femal和ex:Person类的实例。

The rdfs:range property can also be used to indicate that the value of a property is given by a typed literal, as discussed in Section 2.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals). For example, if example.org wanted to indicate that the property ex:age had values from the XML Schema datatype xsd:integer, it would write the RDF statements:
rdfs:range特性也可用于表明特性的值是一个类型文字(typed literal,见2.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals))。例如,如果example.org要表明特性ex:age的值来自XML Schema数据类型xsd:integer,它应书写如下RDF声明:

 ex:age   rdf:type     rdf:Property .
ex:age rdfs:range xsd:integer .

The datatype xsd:integer is identified by its URIref (the full URIref being http://www.w3.org/2001/XMLSchema#integer). This URIref can be used without explicitly stating in the schema that it identifies a datatype. However, it is often useful to explicitly state that a given URIref identifies a datatype. This can be done using the RDF Schema class rdfs:Datatype. To state that xsd:integer is a datatype, example.org would write the RDF statement:
数据类型xsd:integer是通过URIref(完整的URIref为http://www.w3.org/2001/XMLSchema#integer)来标识的。可以不在schema中显式声明该URIref标识某个数据类型而直接使t用它。然而,显式声明一个给定的URIref标识某个数据类型常常是有用的。这可以通过使用RDF Schema类rdfs:Datatype来完成。要声明xsd:integer是一个数据类型,example.org应书写如下RDF声明:

 xsd:integer   rdf:type   rdfs:Datatype .

This statement says that xsd:integer is the URIref of a datatype (which is assumed to conform to the requirements for RDF datatypes described in [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]). Such a statement does not constitute a definition of a datatype, e.g., in the sense that example.org is defining a new datatype. There is no way to define datatypes in RDF Schema. As noted in Section 2.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals), datatypes are defined externally to RDF (and to RDF Schema), and referred to in RDF statements by their URIrefs. This statement simply serves to document the existence of the datatype, and indicate explicitly that it is being used in this schema.
这个声明的含义是:xsd:integer是某个数据类型(它被假定符合[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]中所描述的RDF数据类型要求)的URIref。这一声明并构成一个数据类型的定义,即仿佛example.org是在定义一个新的数据类型。在RDF Schema中,没有可用来定义数据类型的方式。正如在2.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#typedliterals)中提到的,数据类型是在RDF(甚至是RDF Schema)之外定义、然后在RDF中通过它们的URIrefs来引用的。上述声明的作用仅仅是记录该数据类型的存在,并显式表明它在schema中被用到。

The rdfs:domain property is used to indicate that a particular property applies to a designated class. For example, if example.org wanted to indicate that the property ex:author applies to instances of class ex:Book, it would write the RDF statements:
rdfds:domain用于表明某个特性应用于指定的类(定义域)。例如,如果example.org要表明特性ex:author应用于类ex:Book的实例上,它应书写如下RDF声明:

 ex:Book     rdf:type      rdfs:Class .
ex:author rdf:type rdf:Property .
ex:author rdfs:domain ex:Book .

These statements indicate that ex:Book is a class, ex:author is a property, and that RDF statements using the ex:author property have instances of ex:Book as subjects.
上述声明表明ex:Book是类,ex:author是特性。而使用ex:author特性的RDF声明以ex:Book的实例为主体。

A given property, say exterms:weight, may have zero, one, or more than one domain property. If exterms:weight has no domain property, then nothing is said about the resources that exterms:weight properties may be used with (any resource could have a exterms:weight property). If exterms:weight has one domain property, say one specifying ex:Book as the domain, this says that the exterms:weight property applies to instances of class ex:Book. If exterms:weight has more than one domain property, say one specifying ex:Book as the domain and another one specifying ex:MotorVehicle as the domain, this says that any resource that has a exterms:weight property is an instance of all of the classes specified as the domains, i.e., that any resource that has a exterms:weight property is both a ex:Book and a ex:MotorVehicle (illustrating the need for care in specifying domains and ranges).
一个给定的特性(例如exterms:weight)可能有零个、一个或多个domain特性。如果exterm:weight没有domain特性,那么便没有规定exterms:weight特性对应的主体是某类资源,也就是说任何资源都可以作为exterms:weight特性的主体。如果exterms:weight有一个domain特性,例如指定ex:Book作为其定义域,这表明exterms:weight特性应用于类ex:Book的实例。如果exterms:weight有多个domain特性,例如一个domain特性指定其定义域为ex:Book,另一个domain特性指定其定义域为ex:MotorVehicle,这表明具有exterms:weight特性的资源是所有被指定为定义域的类的实例,即具有exterms:weight特性的资源既是ex:Book类的实例又是ex:MotorVehicle类的实例(对待具体问题,需要认真分析、仔细地指定定义域和值域)。

As in the case of rdfs:range, this last point may not be obvious. However, stating that the property exterms:weight has the two domains ex:Book and ex:MotorVehicle involves making two separate statements:
与rdfs:range的情况一样,最后一点可能不是非常明显,即:实际上,为特性exterms:weight声明两个定义域(ex:Book和ex:MotorVehicle)涉及到两个独立的声明:

 exterms:weight   rdfs:domain   ex:Book .
exterms:weight rdfs:domain ex:MotorVehicle .

For any given statement using this property, say:
对于任何用到该特性的声明,比方说:

 exthings:companyCar   exterms:weight   "2500"^^xsd:integer .

in order for both the rdfs:domain statements to be correct, it must be the case that exthings:companyCar is both an instance of ex:Book and of ex:MotorVehicle.
为了保证两个rdfs:domain声明是正确的,必须保证exthings:companyCar同时是ex:Book和ex:MotorVehicle类的实例。

The use of these range and domain descriptions can be illustrated by extending the vehicle schema, adding two properties ex:registeredTo and ex:rearSeatLegRoom, a new class ex:Person, and explicitly describing the datatype xsd:integer as a datatype. The ex:registeredTo property applies to any ex:MotorVehicle and its value is a ex:Person. For the sake of this example, ex:rearSeatLegRoom applies only to instances of class ex:PassengerVehicle. The value is an xsd:integer giving the number of centimeters of rear seat legroom. These descriptions are shown in Example 26 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example26):
我们可以扩展车辆类的schema来举例说明值域(range)和定义域(domain)描述的使用方法:增加两个特性ex:registeredTo和ex:rearSeatLegRoom,然后添加一个新的类ex:Person,并显式地将xsd:integer声明为数据类型。ex:registerdTo特性应用于任何ex:MotorVehicle,并且它的值是ex:Person。对本例而言,ex:rearSeatLegRoom仅仅应用到ex:PassengerVehicle类的实例上,其值是一个xsd:integer(该值给定了后座的脚部活动空间的厘米数)。例26 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example26)显示了这些描述的RDF/XML:

Example 26: Some Property Descriptions for the Vehicle Schema
例26:车辆schema的一些特性描述

 <rdf:Property rdf:ID="registeredTo">
<rdfs:domain rdf:resource="#MotorVehicle"/>
<rdfs:range rdf:resource="#Person"/>
</rdf:Property>
<rdf:Property rdf:ID="rearSeatLegRoom">
<rdfs:domain rdf:resource="#PassengerVehicle"/>
<rdfs:range rdf:resource="&xsd;integer"/>
</rdf:Property>
<rdfs:Class rdf:ID="Person"/>
<rdfs:Datatype rdf:about="&xsd;integer"/>

Note that an <rdf:RDF> element is not used in Example 26 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example26), because it is assumed this RDF/XML is being added to the vehicle schema described in Example 24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24). This same assumption also allows the use of relative URIrefs like #MotorVehicle to refer to other classes from that schema.
注意:例26 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example26)中没有使用<rdf:RDF>元素,因为这里的RDF/XML片断将被添加到了例24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24)所示的车辆schema中。同理,这里可以使用相对Urirefs(比如#MotorVehicle)来引用该schema中的类。

RDF Schema provides a way to specialize properties as well as classes. This specialization relationship between two properties is described using the predefined rdfs:subPropertyOf property. For example, if ex:primaryDriver and ex:driver are both properties, example.org could describe these properties, and the fact that ex:primaryDriver is a specialization of ex:driver, by writing the RDF statements:
RDF Schema提供了一种方法来像描述类的特化关系一样来描述特性之间的特化关系。这种两个特性之间的特化关系可以使用预定义的rdfs:subPropertyOf特性来描述。例如,如果ex:primaryDriver和ex:driver都是特性,则example.org可以通过下列RDF声明来描述“ex:primaryDriver是ex:driver的特化”:

 ex:driver          rdf:type             rdf:Property .
ex:primaryDriver rdf:type rdf:Property .
ex:primaryDriver rdfs:subPropertyOf ex:driver .

The meaning of this rdfs:subPropertyOf relationship is that if an instance exstaff:fred is an ex:primaryDriver of the instance ex:companyVan, then RDF Schema defines exstaff:fred as also being an ex:driver of ex:companyVan. The RDF/XML describing these properties (assuming again that it is being added to the vehicle schema described in Example 24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24)) is shown in Example 27 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example27).
rdfs:subPropertyOf关系的含义在于,如果一个实例exstaff:fred是实例ex:companyVan的一个ex:primaryDriver,那么RDF Schema定义exstaff:fred也是ex:companVan的一个ex:driver 。例27 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example27)所示的RDF/XML描述了这些特性(同样,该RDF/XML片断将被添加到例24 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example24)所示的车辆schema中)

Example 27: More Properties for the Vehicle Schema
例27:车辆schema中其它的特性

 <rdf:Property rdf:ID="driver">
<rdfs:domain rdf:resource="#MotorVehicle"/>
</rdf:Property>
<rdf:Property rdf:ID="primaryDriver">
<rdfs:subPropertyOf rdf:resource="#driver"/>
</rdf:Property>

A property may be a subproperty of zero, one or more properties. All RDF Schema rdfs:range and rdfs:domain properties that apply to an RDF property also apply to each of its subproperties. So, in the above example, RDF Schema defines ex:primaryDriver as also having an rdfs:domain of ex:MotorVehicle, because of its subproperty relationship to ex:driver.
一个特性可以是零个、一个或多个特性的子特性(subproperty)。当RDF Schema中的rdfs:range和rdfs:domain特性应用于某个RDF特性时,它们也会应用于该RDF特性的子特性。因此,在上面的例子中,RDF Schema定义了ex:primaryDriver也具有rdfs:domain约束(值为ex:MotorVehicle),因为ex:primaryDriver是ex:driver的子特性。

Example 28 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example28) shows the RDF/XML for the full vehicle schema, containing all the descriptions 例28 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example28)是车辆schema的完整RDF/XML代码,包括了到目前为止的所有描述。

Example 28: The Full Vehicle Schema
例28:完整的车辆schema

 <?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<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://example.org/schemas/vehicles">
<rdfs:Class rdf:ID="MotorVehicle"/>
<rdfs:Class rdf:ID="PassengerVehicle">
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="Truck">
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="Van">
<rdfs:subClassOf rdf:resource="#MotorVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="MiniVan">
<rdfs:subClassOf rdf:resource="#Van"/>
<rdfs:subClassOf rdf:resource="#PassengerVehicle"/>
</rdfs:Class>
<rdfs:Class rdf:ID="Person"/>
<rdfs:Datatype rdf:about="&xsd;integer"/>
<rdf:Property rdf:ID="registeredTo">
<rdfs:domain rdf:resource="#MotorVehicle"/>
<rdfs:range rdf:resource="#Person"/>
</rdf:Property>
<rdf:Property rdf:ID="rearSeatLegRoom">
<rdfs:domain rdf:resource="#PassengerVehicle"/>
<rdfs:range rdf:resource="&xsd;integer"/>
</rdf:Property>
<rdf:Property rdf:ID="driver">
<rdfs:domain rdf:resource="#MotorVehicle"/>
</rdf:Property>
<rdf:Property rdf:ID="primaryDriver">
<rdfs:subPropertyOf rdf:resource="#driver"/>
</rdf:Property>
</rdf:RDF>

Having shown how to describe classes and properties using RDF Schema, instances using those classes and properties can now be illustrated. For example, Example 29 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example29) describes an instance of the ex:PassengerVehicle class described in Example 28 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example28), together with some hypothetical values for its properties.
前面说明了如何使用RDF Schema来描述类和特性,现在可以讲述使用这些类和特性的实例了。例如, 例29 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example29)描述了一个ex:passengerVehicle类(见例28 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example28))的实例,并为它的一些特性赋了值。

Example 29: An Instance of ex:PassengerVehicle
例 29:一个ex:PassengerVehicle类的实例

 <?xml version="1.0"?>
<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/schemas/vehicles#"
xml:base="http://example.org/things">
<ex:PassengerVehicle rdf:ID="johnSmithsCar">
<ex:registeredTo rdf:resource="http://www.example.org/staffid/85740"/>
<ex:rearSeatLegRoom
rdf:datatype="&xsd;integer">127</ex:rearSeatLegRoom>
<ex:primaryDriver rdf:resource="http://www.example.org/staffid/85740"/>
</ex:PassengerVehicle>
</rdf:RDF>

This example assumes that the instance is described in a separate document from the schema. Since the schema has an xml:base of http://example.org/schemas/vehicles, the namespace declaration xmlns:ex="http://example.org/schemas/vehicles#" is provided to allow QNames such as ex:registeredTo in the instance data to be properly expanded to the URIrefs of the classes and properties described in that schema. An xml:base declaration is also provided for this instance, to allow rdf:ID="johnSmithsCar" to expand to the proper URIref independently of the location of the actual document.
本例假定实例与schema是分别在不同的文档中描述的。由于schema以http://example.org/schemas/vehicles作为其XML base(即作为xml:base属性的值),因此在实例数据[译注//如5.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#schemaclasses)所述,即描述属于某个类的个体的数据]中用命名空间声明xmlns:ex="http://example.org/schemas/vehicles#"来保证QNames(如ex:registeredTo)得以展开为正确的、标识schema中类和特性的URIrefs。实例描述中也使用了一个xml:base声明,用于将rdf:ID="johnSmithsCar"中的johnSmithsCar展开为正确的绝对URIref,而绝对URIrefs的展开过程是根据xml:base进行的,与当前文档的位置无关。

Note that an ex:registeredTo property can be used in describing this instance of ex:PassengerVehicle, because ex:PassengerVehicle is a subclass of ex:MotorVehicle. Note also that a typed literal is used for the value of the ex:rearSetLegRoom property in this instance, rather than a plain literal (i.e., rather than stating the value as <ex:rearSeatLegRoom>127</ex:rearSeatLegRoom>). Because the schema describes the range of this property as an xsd:integer, the value of the property should be a typed literal of that datatype in order to match the range description (i.e., the range declaration does not automatically "assign" a datatype to a plain literal, and so a typed literal of the appropriate datatype must be explicitly provided). Additional information, either in the schema, or in additional instance data, could also be provided to explicitly specify the units of the ex:rearSetLegRoom property (centimeters), as discussed in Section 4.4 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfvalue).
注意,ex:registeredTo特性可被用来描述ex:PassengerVehicle类的实例,因为ex:PassengerVehicle是ex:MotorVehicle的子类。也要注意到,在实例描述中,ex:rearSetLegRoom特性的值是一个类型文字(typed literal),而不是平凡文字(plain literal)(它不是通过<ex:rearSeatLegRoom>127</ex:rearSeatLegRoom>的方式来指定值)。因为schema中描述了该特性的值域(range)为一个xsd:integer,因此该特性的值应该是一个数据类型为xsd:interger的类型文字以满足值域限制(即值域声明并不会自动地将平凡文字指派为某种数据类型,因此必须显式提供一个具有正确数据类型的类型文字)。正如4.4节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfvalue)中所讨论的那样,可以在schema或者附加的实例数据中提供一些额外信息来显式指定ex:rearSetLegRoom特性的单位(厘米)。

5.3 Interpreting RDF Schema Declarations

5.3 解释RDF Schema声明

As noted earlier, the RDF Schema type system is similar in some respects to the type systems of object-oriented programming languages such as Java. However, RDF differs from most programming language type systems in several important respects.
正如前所述,RDF Schema的类型系统与面向对象编程语言(如Java)的类型系统很相似,然而,RDF与大部分程序设计语言的类型系统在几个重要方面是有区别:

One important difference is that instead of describing a class as having a collection of specific properties, an RDF schema describes properties as applying to specific classes of resources, using domain and range properties. For example, a typical object-oriented programming language might define a class Book with an attribute called author having values of type Person. A corresponding RDF schema would describe a class ex:Book, and, in a separate description, a property ex:author having a domain of ex:Book and a range of ex:Person.
一个重要的区别是:RDF Schema描述属性可以作用于哪些特定的类(通过domainrange属性),而不是(像面向对象类型系统)描述类具有哪些特定属性的集合。例如:在一个典型的面向对象编程语言中,类 Book会定义为有一个属性author,且author的类型是Person;而在RDF Schema中,类ex:Book和属性ex:author都会被分开定义,另外,属性ex:author的定义域是ex:Book,值域是ex:Person。

The difference between these approaches may seem to be only syntactic, but in fact there is an important difference. In the programming language class description, the attribute author is part of the description of class Book, and applies only to instances of class Book. Another class (say, softwareModule) might also have an attribute called author, but this would be considered a different attribute. In other words, the scope of an attribute description in most programming languages is restricted to the class or type in which it is defined. In RDF, on the other hand, property descriptions are, by default, independent of class definitions, and have, by default, global scope (although they may optionally be declared to apply only to certain classes using domain specifications).
这两种定义方法的区别表面上看起来只是语法层次上的,其实,他们有着重大的区别。在程序设计语言中,属性author是关于类Book的描述的一部分,而且只能应用于类Book的实例。如果另外一个类,例如SoftwareModule也有个属性author,这两个author属性被看成是不同的属性。因为在大多数编程语言中,属性的作用域局部与它被定义的类或类型的。而在RDF中,缺省地,属性的描述是独立于类描述的,并且属性的作用域是全局的(尽管可以它们可被声明为只能应用于某些类)。

As a result, an RDF schema could describe a property exterms:weight without a domain being specified. This property could then be used to describe instances of any class that might be considered to have a weight. One benefit of the RDF property-based approach is that it becomes easier to extend the use of property definitions to situations that might not have been anticipated in the original description. At the same time, this is a "benefit" which must be used with care, to insure that properties are not mis-applied in inappropriate situations.
一个结果是:RDF Schema可以描述一个不指定定义域的属性,如exterms:weight这个属性可以用来描述任何具有重量(weight)属性的类的实例。RDF的以属性为中心的方法的一个好处是:扩展属性的用途使其应用于最初定义时未预知的情形更为容易。同时,这个“好处”也要谨慎使用,以免属性错误应用于不恰当的情形。

Another result of the global scope of RDF property descriptions is that it is not possible in an RDF schema to define a specific property as having locally-different ranges depending on the class of the resource it is applied to. For example, in defining the property ex:hasParent, it would be desirable to be able to say that if the property is used to describe a resource of class ex:Human, then the range of the property is also a resource of class ex:Human, while if the property is used to describe a resource of class ex:Tiger, then the range of the property is also a resource of class ex:Tiger. This kind of definition is not possible in RDF Schema. Instead, any range defined for an RDF property applies to all uses of the property, and so ranges should be defined with care. However, while such locally-different ranges cannot be defined in RDF Schema, they can be defined in some of the richer schema languages discussed in Section 5.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas).
RDF属性的全局作用域的另外一个结果是:无法在RDF Schema中定义一个根据所描述类(即定义域)的不同而具有不同值域的属性。例如,在定义属性ex:hasParent时,如果这个属性用于描述类ex:Human,则这个属性的值域是ex:Human;如果这个属性用于描述类ex:Tiger,则这个属性的值域是ex:Tiger,这样定义属性显然更为合适。但这种定义方法无法在RDF Schema中实现。对一个RDF属性的值域的任何定义将应用于用到该属性的所有地方。因此,定义值域时应谨慎。然而,虽然不能在RDF Schema中定义这种局部相异的属性值域,但在5.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)中讨论的表达能力更强的模式语言中可以定义。

Another important difference is that RDF Schema descriptions are not necessarily prescriptive in the way programming language type declarations typically are. For example, if a programming language declares a class Book with an author attribute having values of type Person, this is usually interpreted as a group of constraints. The language will not allow the creation of an instance of Book without an author attribute, and it will not allow an instance of Book with an author attribute that does not have a Person as its value. Moreover, if author is the only attribute defined for class Book, the language will not allow an instance of Book with some other attribute.
另外一个重要的区别是:RDF Schema的描述不一定像程序设计语言的类型声明那样是规约性的(prescriptive)。例如,如果在某个程序设计语言中,类Book被定义为有一个属性author,且author的类型是Person,这通常被解释为一组约束。该语言不会允许Book的一个实例没有author属性,也不会允许Book的一个实例的book属性值的类型不是Person。更为重要的是,如果author的定义为类Book的唯一属性,该语言不会允许Book的实例具有其他的属性。

RDF Schema, on the other hand, provides schema information as additional descriptions of resources, but does not prescribe how these descriptions should be used by an application. For example, suppose an RDF schema states that an ex:author property has an rdfs:range of class ex:Person. This is simply an RDF statement that RDF statements containing ex:author properties have instances of ex:Person as objects.
相反,RDF Schem提供的模式信息是作为对资源的额外描述(descriptions),并不会限制这些描述怎样被用于一个应用。例如,假设一个RDF Schema中定义了属性ex:author的值域(rdfs:range)是ex:Person,这仅仅是一个简单的RDF陈述: 谓词是ex:author的陈述的客体是类ex:Person的实例。

This schema-supplied information might be used in different ways. One application might interpret this statement as specifying part of a template for RDF data it is creating, and use it to ensure that any ex:author property has a value of the indicated (ex:Person) class. That is, this application interprets the schema description as a constraint in the same way that a programming language might. However, another application might interpret this statement as providing additional information about data it is receiving, information which may not be provided explicitly in the original data. For example, this second application might receive some RDF data that includes an ex:author property whose value is a resource of unspecified class, and use this schema-provided statement to conclude that the resource must be an instance of class ex:Person. A third application might receive some RDF data that includes an ex:author property whose value is a resource of class ex:Corporation, and use this schema information as the basis of a warning that "there may be an inconsistency here, but on the other hand there may not be". Somewhere else there may be a declaration that resolves the apparent inconsistency (e.g., a declaration to the effect that "a Corporation is a (legal) Person").
这个Schema提供的信息可能以多种方式得到利用。一个应用可能把这个陈述解释为创建RDF数据的模板的一部分,且用它来限制任意ex:author的值都是ex:Person的实例。也就是说,这个应用和程序设计语言一样,把模式信息解释为约束(constraint)。然而,另外一个应用可能把这个陈述解释为获取的数据的额外信息,这个信息并没有在原数据中显式表示。例如,第二个应用可能收到一些RDF数据,这些数据包含了一个值为未知类型的ex:author属性,则可以利用RDF Schema中的那个陈述推导出这个ex:author属性的值是类ex:Person的实例。第三个应用可能收到一些RDF数据, 这些数据包含了一个值为ex:Corporation的实例的ex:author属性,利用RDF Schema的信息,可以发出警告:“数据可能不一致,也可能不是”。在其他地方,可能存在一个声明消除了这个数据不一致性(例如,声明一个“Corporation”也是一个“Person”)。

Moreover, depending on how the application interprets the property descriptions, a description of an instance might be considered valid either without some of the schema-specified properties (e.g., there might be an instance of ex:Book without an ex:author property, even if ex:author is described as having a domain of ex:Book), or with additional properties (there might be an instance of ex:Book with an ex:technicalEditor property, even though the schema describing class ex:Book does not describe such a property).
此外,根据应用解释属性描述的方式,一个实例仍然可以被认为是合法的,即使没有RDF Schema指定的属性(如可能有一些ex:Book的实例没有ex:author属性,即使ex:author的定义域为ex:Book),或者具有其他的属性(如可能有一些ex:Book的实例具有ex:technicalEditor属性,即使描述ex:Book的Schema没有对这个属性的描述)。

In other words, statements in an RDF schema are always descriptions. They may also be prescriptive (introduce constraints), but only if the application interpreting those statements wants to treat them that way. All RDF Schema does is provide a way of stating this additional information. Whether this information conflicts with explicitly specified instance data is up to the application to determine and act upon.
换句话说,RDF Schema中的陈述通常是描述(descriptions)。他们也可以是规约性的(prescriptive),如果应用要这样解释的话。RDF Schema所做的是提供额外的信息。这些信息是否和显式指定的实例数据有冲突,取决于具体的应用。

5.4 Other Schema Information

5.4 其他Schema信息

RDF Schema provides a number of other built-in properties, which can be used to provide documentation and other information about an RDF schema or about instances. For example the rdfs:comment property can be used to provide a human-readable description of a resource. The rdfs:label property can be used to provide a more human-readable version of a resource's name. The rdfs:seeAlso property can be used to indicate a resource that might provide additional information about the subject resource. The rdfs:isDefinedBy property is a subproperty of rdfs:seeAlso, and can be used to indicate a resource that (in a sense not specified by RDF; e.g., the resource may not be an RDF schema) "defines" the subject resource. RDF Vocabulary Description Language 1.0: RDF Schema (http://www.w3.org/TR/rdf-schema/) [RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)] should be consulted for further discussion of these properties.
RDF Schema还提供了一些其他的内嵌属性,这些属性可以用于为RDF Schema和实例提供资料记录和其他信息。例如,rdfs:comment属性可用于提供关于资源的易读的描述,rdfs:label属性可用于提供关于资源的更易读的名字, rdfs:seeAlso属性可用于提示其他地方可能有关于此资源的更多的描述,rdfs:isDefinedBy是rdfs:seeAlso的子属性,可用于提示其他地方有关于此资源的定义。对这些属性更多的讨论,请参考RDF词汇描述语言1.0: RDF Schema (http://www.w3.org/TR/rdf-schema/)[RDF-VOCABULARY (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-vocabulary)]。

As with a number of the built-in RDF properties such as rdf:value, the uses described for these RDF Schema properties are only their intended uses. [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] defines no special meanings for these properties, and RDF Schema does not define any constraints based on these intended uses. For example, there is no constraint specified that the object of a rdfs:seeAlso property must provide additional information about the subject of the statement in which it appears.
对于其他的内嵌RDF属性(如rdf:value)它们的用途就是规范中的设计用途(intended use),文档[RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]对这些属性没有定义特定的语义,RDF Schmea也没有基于他们的设计用途定义任何的约束。例如,没有约束限制属性rdfs:seeAlso的客体必须为它所在的陈述的主体提供额外的信息。

5.5 Richer Schema Languages

5.5 表达更丰富的Schema语言

RDF Schema provides basic capabilities for describing RDF vocabularies, but additional capabilities are also possible, and can be useful. These capabilities may be provided through further development of RDF Schema, or in other languages based on RDF. Other richer schema capabilities that have been identified as useful (but that are not provided by RDF Schema) include:
RDF Schema提供了描述RDF词汇集的基本能力,更强的表达能力是可能的,也是有用的。这些能力可以通过进一步发展RDF Schema来提供,也可以通过其他基于RDF的语言来提供。其他已被认为有用但RDF Schema没有提供的、更丰富的表达能力包括:

  • cardinality constraints on properties, e.g., that a Person has exactly one biological father.
  • 对属性的基数限制。例如,一个人有且只有一个生物学意义上的父亲。
  • specifying that a given property (such as ex:hasAncestor) is transitive, e.g., that if A ex:hasAncestor B, and B ex:hasAncestor C, then A ex:hasAncestor C.
  • 指定一个属性(如ex:hasAncestor)是传递的,即:如果A ex:hasAncestor B,且 B ex:hasAncestor C,则A ex:hasAncestor C。
  • specifying that a given property is a unique identifier (or key) for instances of a particular class.
  • 指定一个属性是一个类的实例的唯一表示符(或说,主键)。
  • specifying that two different classes (having different URIrefs) actually represent the same class.
  • 指定两个不同的类(具有不同的URIrefs)实际代表同一个的类。
  • specifying that two different instances (having different URIrefs) actually represent the same individual.
  • 指定两个不同的实例(具有不同的URIrefs)实际代表同一个实例。
  • specifying constraints on the range or cardinality of a property that depend on the class of resource to which a property is applied, e.g., being able to say that for a soccer team the ex:hasPlayers property has 11 values, while for a basketball team the same property should have only 5 values.
  • 指定属性的值域或基数限制取决于属性应用到的类,例如,说一个足球队的属性ex:hasPlayers值的个数为11,同时,这个属性应用于篮球队时,值的个数应该是5。
  • the ability to describe new classes in terms of combinations (e.g., unions and intersections) of other classes, or to say that two classes are disjoint (i.e., that no resource is an instance of both classes).
  • 能够通过对类的组合(如,并,交)得到新的类,或者说两个类是相离的,即两个类没有共同的实例。

The additional capabilities mentioned above, in addition to others, are the targets of ontology languages such as DAML+OIL (http://www.w3.org/TR/daml+oil-reference) [DAML+OIL (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-damloil)] and OWL (http://www.w3.org/TR/owl-ref/) [OWL (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-owl)]. Both these languages are based on RDF and RDF Schema (and both currently provide all the additional capabilities mentioned above). The intent of such languages is to provide additional machine-processable semantics for resources, that is, to make the machine representations of resources more closely resemble their intended real world counterparts. While such capabilities are not necessarily needed to build useful applications using RDF (see Section 6 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#applications) for a description of a number of existing RDF applications), the development of such languages is a very active subject of work as part of the development of the Semantic Web (http://www.w3.org/2001/sw/Activity).
上面提到这些丰富的表达能力,以及其他一些没提到的,正是本体语言(如DAML+OIL (http://www.w3.org/TR/daml+oil-reference)[DAML+OIL (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-damloil)]和OWL (http://www.w3.org/TR/owl-ref/)[OWL (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-owl)])的目标。这些本体语言都是基于RDF和RDF Schema的。这些语言的目的是为资源提供更多的机器可处理的语义信息,也就是说,使资源的机器表示能够更紧密模拟真实世界对应的部分。虽然这些语言对构造基于RDF的有用应用(第6节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#applications)有一些已有的RDF应用的描述)来说不是必须的,但这些语言的研究是语义Web研究中的一个非常活跃的主题。

6. Some RDF Applications: RDF in the Field

6. 一些RDF应用:具体领域中的RDF


The previous sections have described the general capabilities of RDF and RDF Schema. While examples were used in those sections to illustrate those capabilities, and some of those examples may have suggested potential RDF applications, those sections did not actually discuss any real applications. This section will describe some actual deployed RDF applications, showing how RDF supports various real-world requirements to represent and manipulate information about a wide variety of things.

在前面的章节里,已经描述了RDF和RDF Schema的大体的表达能力,并且举了一些例子来演示这些能力,其中有些例子还可能暗示了一些潜在的RDF应用,但是并没有讨论任何真正的应用。在这节中,将会描述一些真正已经发布的RDF应用,说明了RDF是怎样支持各种不同的现实世界的关于表示和处理关于各种事物的信息的需求。



6.1 Dublin Core Metadata Initiative

6.1 都柏林核心元数据倡议


Metadata is data about data. Specifically, the term refers to data used to identify, describe, or locate information resources, whether these resources are physical or electronic. While structured metadata processed by computers is relatively new, the basic concept of metadata has been used for many years in helping manage and use large collections of information. Library card catalogs are a familiar example of such metadata.

元数据是关于数据的数据。这个术语指的是用来识别、描述、查找信息资源的数据,而不管这些资源是物理存在的或电子化的。虽然用计算机处理的结构化元数据相对较新,但在帮助管理和使用海量信息时的元数据的基本概念已经用了多年。图书目录卡就是一个大家熟悉的这种元数据例子。

The Dublin Core is a set of "elements" (properties) for describing documents (and hence, for recording metadata). The element set was originally developed at the March 1995 Metadata Workshop in Dublin, Ohio. The Dublin Core has subsequently been modified on the basis of later Dublin Core Metadata workshops, and is currently maintained by the Dublin Core Metadata Initiative (http://dublincore.org/). The goal of the Dublin Core is to provide a minimal set of descriptive elements that facilitate the description and the automated indexing of document-like networked objects, in a manner similar to a library card catalog. The Dublin Core metadata set is intended to be suitable for use by resource discovery tools on the Internet, such as the "Webcrawlers" employed by popular World Wide Web search engines. In addition, the Dublin Core is meant to be sufficiently simple to be understood and used by the wide range of authors and casual publishers who contribute information to the Internet. Dublin Core elements have become widely used in documenting Internet resources (the Dublin Core creator element has already been used in earlier examples). The current elements of the Dublin Core are defined in the Dublin Core Metadata Element Set, Version 1.1: Reference Description (http://dublincore.org/documents/2003/06/02/dces/) [DC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-dublin-core)], and contain definitions for the following properties:

都柏林核心是描述文件(因此,也是为了记录元数据)的一个“元素”集(属性)。这个元素集是由元数据工作组在1995年3月在俄亥俄州的都柏林(Dublin, Ohio)首先开发出来的。稍后,在都柏林核心元数据工作组基础上,都柏林核心进行了一系列的修改,这就是我们现在看到的都柏林核心元数据倡议 (http://dublincore.org/)。都柏林核心的目的是提供一个描述性的元素的最小集,以便对类似文档的网络对象进行描述和自动索引,就像一张图书目录卡一样。都柏林核心元数据集的设计目标是适合让因特网上资源发现工具使用,如通行的万维网搜索引擎使用的网络爬虫(“Webcrawlers”)。此外,都柏林核心有意为足够简单,使得为因特网提供信息的各种各样的作者和出版商都能够理解和使用。 都柏林核心元素已广泛地应用于记录因特网资源的有关信息(都柏林核心元素dc:create已经在以前的例子中用到)。 都柏林核心元素的当前版本定义在柏林核心元数据元素集,版本1.1:参考描述 (http://dublincore.org/documents/2003/06/02/dces/) [DC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-dublin-core)],它包含了下列属性的定义:


  • Title: A name given to the resource.
  • Creator: An entity primarily responsible for making the content of the resource.
  • Subject: The topic of the content of the resource.
  • Description: An account of the content of the resource.
  • Publisher: An entity responsible for making the resource available
  • Contributor: An entity responsible for making contributions to the content of the resource.
  • Date: A date associated with an event in the life cycle of the resource.
  • Type: The nature or genre of the content of the resource.
  • Format: The physical or digital manifestation of the resource.
  • Identifier: An unambiguous reference to the resource within a given context.
  • Source: A reference to a resource from which the present resource is derived.
  • Language: A language of the intellectual content of the resource.
  • Relation: A reference to a related resource.
  • Coverage: The extent or scope of the content of the resource.
  • Rights: Information about rights held in and over the resource.


  • 标题(Title): 资源的名字。
  • 创建者(Creator): 一个主要负责创建资源内容的实体。
  • 主题(Subject): 资源内容的主题.
  • 描述(Description): 资源内容的描述.
  • 出版者(Publisher): 一个负责使得资源内容可用的实体
  • 贡献者(Contributor): 一个负责为资源内容作出贡献的实体(如作者)。
  • 日期(Date): 在资源生命周期中某时间关联的日期。
  • 类型(Type): 资源内容的类型。
  • 格式(Format): 资源的物理形式或数据形式.
  • 标识符(Identifier): 一个在给定上下文中明确标识资源的标识符。
  • 来源(Source): 一个对作为目前资源的来源的资源引用。
  • 语言(Language): 资源内容采用的语言
  • 关系(Relation): 一个对相关资源的引用
  • 覆盖范围(Coverage): 资源内容所在的范围或区域
  • 权限(Rights): 关于资源的权限信息.


Information using the Dublin Core elements may be represented in any suitable language (e.g., in HTML meta elements). However, RDF is an ideal representation for Dublin Core information. The examples below represent the simple description of a set of resources in RDF using the Dublin Core vocabulary. Note that the specific Dublin Core RDF vocabulary shown here is not intended to be authoritative. The Dublin Core Reference Description [DC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-dublin-core)] is the authoritative reference.

使用都柏林核心元素的信息可以用任意适合的语言( 例如,HTML的 meta元素)表示。 然而,RDF是都柏林核心信息的一种理想的表示。 下面的例子表示了在RDF中,用都柏林核心词汇表示的关于一个资源集合的简单描述。注意,这里显示的都柏林核心RDF词汇不是权威的描述,都柏林核心参考描述[DC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-dublin-core)]才是最权威的参考。
The first example, Example 30 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example30), describes a Web site home page using Dublin Core properties:

 

第一个例子(例30),使用都柏林核心属性描述一个网站主页:



Example 30: A Web Page Described using Dublin Core Properties

<rdf:RDF

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="http://www.dlib.org">
<dc:title>D-Lib Program - Research in Digital Libraries</dc:title>
<dc:description>The D-Lib program supports the community of people
with research interests in digital libraries and electronic
publishing.</dc:description>
<dc:publisher>Corporation For National Research Initiatives</dc:publisher>
<dc:date>1995-01-07</dc:date>
<dc:subject>
<rdf:Bag>
<rdf:li>Research; statistical methods</rdf:li>
<rdf:li>Education, research, related topics</rdf:li>
<rdf:li>Library use Studies</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:type>World Wide Web Home Page</dc:type>
<dc:format>text/html</dc:format>
<dc:language>en</dc:language>
</rdf:Description>

</rdf:RDF>


Note that both RDF and the Dublin Core define an (XML) element called "Description" (although the Dublin Core element name is written in lowercase). Even if the initial letter were identically uppercase, the XML namespace mechanism enables these two elements to be distinguished (one is rdf:Description, and the other is dc:description). Also, as a matter of interest, accessing http://purl.org/dc/elements/1.1/ (http://purl.org/dc/elements/1.1/) (the namespace URI used to identify the Dublin Core vocabulary in this example) in a Web browser (as of the current writing) will retrieve an RDF Schema declaration for [DC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-dublin-core)].
我们注意到,RDF和都柏林核心都定义了一个( XML )元素称为为“Description”,(虽然都柏林核心元素名称用了小写字母)。 即使开头的字母都是大写字母,还是可以用XML的名字空间机制将这两个元素区别开来(一是rdf:Description,另外一个是dc:description)。 同时,有趣的是,在Web浏览器中访问http://purl.org/dc/elements/1.1/ (http://purl.org/dc/elements/1.1/) 时(名字空间URI在这里用于标识都柏林核心词汇),可以得到一个[DC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-dublin-core)]的RDF Schema声明。

The second example, Example 31 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example31), describes a published magazine:

第二个例子,例31 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example31) 描述了一个出版了的杂志


Example 31: Describing A Magazine Using Dublin Core

<rdf:RDF

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/">
<rdf:Description rdf:about="http://www.dlib.org/dlib/may98/05contents.html">
<dc:title>DLIB Magazine - The Magazine for Digital Library Research
- May 1998</dc:title>
<dc:description>D-LIB magazine is a monthly compilation of
contributed stories, commentary, and briefings.</dc:description>
<dc:contributor>Amy Friedlander</dc:contributor>
<dc:publisher>Corporation for National Research Initiatives</dc:publisher>
<dc:date>1998-01-05</dc:date>
<dc:type>electronic journal</dc:type>
<dc:subject>
<rdf:Bag>
<rdf:li>library use studies</rdf:li>
<rdf:li>magazines and newspapers</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:format>text/html</dc:format>
<dc:identifier rdf:resource="urn:issn:1082-9873"/>
<dcterms:isPartOf rdf:resource="http://www.dlib.org"/>
</rdf:Description>
</rdf:RDF>


Example 31 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example31) uses (in the third line from the bottom) the Dublin Core qualifier isPartOf (from a separate vocabulary) to indicate that this magazine is "part of" the previously-described Web site.

例31 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example31) 使用了都柏林的限定词“isPartOf”(来自一个单独的词汇表)来说明这份杂志是以前描述过的Web网站的一部分。

The third example, Example 32 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example32), describes a specific article in the magazine described in Example 31 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example31).
第三个例子,例 32 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example32), 描述了例 31 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example31)中描述过的杂志中的一篇特定的文章


Example 32: Describing a Magazine Article

<rdf:RDF

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/">
<rdf:Description rdf:about="http://www.dlib.org/dlib/may98/miller/05miller.html">
<dc:title>An Introduction to the Resource Description Framework</dc:title>
<dc:creator>Eric J. Miller</dc:creator>
<dc:description>The Resource Description Framework (RDF) is an
infrastructure that enables the encoding, exchange and reuse of
structured metadata. rdf is an application of xml that imposes needed
structural constraints to provide unambiguous methods of expressing
semantics. rdf additionally provides a means for publishing both
human-readable and machine-processable vocabularies designed to
encourage the reuse and extension of metadata semantics among
disparate information communities. the structural constraints rdf
imposes to support the consistent encoding and exchange of
standardized metadata provides for the interchangeability of separate
packages of metadata defined by different resource description
communities. </dc:description>
<dc:publisher>Corporation for National Research Initiatives</dc:publisher>
<dc:subject>
<rdf:Bag>
<rdf:li>machine-readable catalog record formats</rdf:li>
<rdf:li>applications of computer file organization and
access methods</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:rights>Copyright ? 1998 Eric Miller</dc:rights>
<dc:type>Electronic Document</dc:type>
<dc:format>text/html</dc:format>
<dc:language>en</dc:language>
<dcterms:isPartOf rdf:resource="http://www.dlib.org/dlib/may98/05contents.html"/>
</rdf:Description>

</rdf:RDF>


Example 32 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example32) also uses the qualifier isPartOf, this time to indicate that this article is "part of" the previously-described magazine.

例32中也使用了限定词“isPartOf”,这次是指这篇文章是先前描述过的杂志中的一部分。


Computer languages and file formats do not always make explicit provision for embedding metadata with the data it describes. In many cases, the metadata has to be specified as a separate resource and explicitly linked to the data (this has been done for the RDF metadata that describes the Primer; there is an explicit link to this metadata at the end of the Primer). However, applications and languages are increasingly making explicit provision for embedding metadata directly with the data. For example, the W3C's Scalable Vector Graphics language [SVG (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-svg)] (another XML-based language) provides an explicit metadata element for recording metadata along with other SVG data. Any XML-based metadata language can be used inside this element. [SVG (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-svg)] includes the example shown in Example 33 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example33) of how to embed metadata describing an SVG document in the SVG document itself. The example uses the Dublin Core vocabulary, and RDF/XML for recording the metadata.

计算机语言和文件格式并非总能为他们描述的数据嵌入元数据提供明确的方式。在许多情况下,元数据不得不被指定为一种单独的资源,并被明确地链接到数据(如,描述本入门文档的RDF元数据就是这样的;在本文档的的最后一部分有一个对元数据的显式链接)。 然而,应用程序和语言日益为元数据直接嵌入数据提供明确的方式。例如, W3C的可伸缩矢量图形语言[SVG (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-svg)] (另一个以XML为基础的语言)提供了一个明确的元数据元素用以记录关于其他SVG数据的元数据。 任何以XML为基础的元数据语言都能包含在这个元素里。[SVG (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-svg)] 包含了例 33 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example33)所示的例子,它描述了一个SVG文件的元数据是如何嵌入在SVG文件本身的。这个例子使用了都柏林核心词汇和RDF/XML来记录元数据。


Example 33: Including Metadata in an SVG Document 一个包含元数据的SVG文件

<?xml version="1.0"?>
<svg width="4in" height="3in" version="1.1"

    xmlns = 'http://www.w3.org/2000/svg'>
<desc xmlns:myfoo="http://example.org/myfoo">
<myfoo:title>This is a financial report</myfoo:title>
<myfoo:descr>The global description uses markup from the
<myfoo:emph>myfoo</myfoo:emph> namespace.</myfoo:descr>
<myfoo:scene><myfoo:what>widget $growth</myfoo:what>
<myfoo:contains>$three $graph-bar</myfoo:contains>
<myfoo:when>1998 $through 2000</myfoo:when> </myfoo:scene>
</desc>
<metadata>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc = "http://purl.org/dc/elements/1.1/" >
<rdf:Description rdf:about="http://example.org/myfoo"
dc:title="MyFoo Financial Report"
dc:description="$three $bar $thousands $dollars $from 1998 $through 2000"
dc:publisher="Example Organization"
dc:date="2000-04-11"
dc:format="image/svg+xml"
dc:language="en" >
<dc:creator>
<rdf:Bag>
<rdf:li>Irving Bird</rdf:li>
<rdf:li>Mary Lambert</rdf:li>
</rdf:Bag>
</dc:creator>
</rdf:Description>
</rdf:RDF>
</metadata>

</svg>


Adobe's Extensible Metadata Platform (XMP) (http://www.adobe.com/products/xmp/main.html) is another example of technology that allows metadata about a file to be embedded into the file itself. XMP uses RDF/XML as the basis of its metadata representation. A number of Adobe products already support XMP.

Adobe公司的可扩展元数据平台( XMP )是另一个允许关于一个文件的元数据被嵌入到文件本身中的技术的例子。 XMP使用RDF/XML作为其元数据表示的基础。 一些Adobe产品已经支持XMP。

6.2 PRISM


PRISM: Publishing Requirements for Industry Standard Metadata (http://www.prismstandard.org/) [PRISM (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-prism)] is a metadata specification developed in the publishing industry. Magazine publishers and their vendors formed the PRISM Working Group to identify the industry's needs for metadata and define a specification to meet them. Publishers want to use existing content in many ways in order to get a greater return on the investment made in creating it. Converting magazine articles to HTML for posting on the Web is one example. Licensing it to aggregators like LexisNexis (http://www.lexisnexis.com/) is another. All of these are "first uses" of the content; typically they all go live at the time the magazine hits the stands. The publishers also want their content to be "evergreen". It might be used in new issues, such as in a retrospective article. It could be used by other divisions in the company, such as in a book compiled from the magazine's photos, recipes, etc. Another use is to license it to outsiders, such as in a reprint of a product review, or in a retrospective produced by a different publisher. This overall goal requires a metadata approach that emphasizes discovery, rights tracking, and end-to-end metadata.
PRISM:PRISM: 出版业标准元数据需求 (http://www.prismstandard.org/)[PRISM (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-prism)]是在出版业中发展完善的一个元数据规范。PRISM工作组是由杂志出版商和杂志的销售商构成的,他们确定行业所需的元数据(metadata)并为之指定一些列相关的规范。出版商想以多种方式利用现有内容(资料),目的是获取更多的对创建资源时的投资回报。一个例子是为了发布在Web上而把杂志文章转换成HTML;而把它许可给一个叫LexisNexis (http://www.lexisnexis.com/) 的聚合器则是另外一个例子。所有的这些都是内容的“首次使用”;当杂志发行时,其内容也跟着公诸于世了,出版商也想让他们的内容变成“常青树”。它有可能用于其他的期号,如在一个回顾文章中。它也可能用于公司的其他部门,如把杂志中的图片等编辑成书。另一个用途则是许可给外人使用,如关于产品评论的再版,或其他出版商的精选辑中。全部达到这些目的就需要一种元数据方式,它着重于"发现","权限追踪"和"端到端的元数据"。


Discovery: Discovery is a general term for finding content which encompasses searching, browsing, content routing, and other techniques. Discussions of discovery frequently center on a consumer searching a public Web site. However, discovering content is much broader than that. The audience may consist of consumers, or it may consist of internal users such as researchers, designers, photo editors, licensing agents, etc. To assist discovery, PRISM provides properties to describe the topics, formats, genre, origin, and contexts of a resource. It also provides means for categorizing resources using multiple subject description taxonomies.
发现(Discovery):发现是关于寻找资料的一个笼统的术语,包含了搜索,浏览,内容的传输,以及其他技术。关于发现的讨论经常以客户在公众网站的搜索为中心。不过,内容发现的范畴要比这宽广得多。(发现的)主体可能由客户组成,或可能由内部用户(如研究人员,设计者,图片编辑,许可证代理人,等等)组成。为了辅助法内容发现,PRISM提供了一系列属性来描述资源的主题,格式,类型,来源和上下文。它同时也提供了一种用多主题描述分类系统对资源分类的方法。
Rights Tracking: Magazines frequently contain material licensed from others. Photos from a stock photo agency are the most common type of licensed material, but articles, sidebars, and all other types of content may be licensed. Simply knowing if content was licensed for one-time use, requires royalty payments, or is wholly-owned by the publisher is a struggle. PRISM provides elements for basic tracking of such rights. A separate vocabulary defined in the PRISM specification supports description of places, times, and industries where content may or may not be used.
权限追踪(Rights Tracking):杂志经常包含了经其它人许可使用的材料。除了文章,工具条和其他所有内容可能已被许可的类型之外,特许资料的最普遍的类型就是从一个图片代理处获得的图片。一份资料是否有一次性使用权(当然,这也是要交特许使用金的),还是被出版商完全占有;仅仅想知道这些就需要一番努力了。PRISM为简单的权限跟踪提供了一些元素。PRISM规范定义了一个单独的词汇集用来支持一些描述(description),这些描述记录了资料可以或不可以被使用的地方,次数,行业等相关内容。
End-to-end metadata: Most published content already has metadata created for it. Unfortunately, when content moves between systems, the metadata is frequently discarded, only to be re-created later in the production process at considerable expense. PRISM aims to reduce this problem by providing a specification that can be used in multiple stages in the content production pipeline. An important feature of the PRISM specification is its use of other existing specifications. Rather than create an entirely new thing, the group decided to use existing specifications as much as possible, and only define new things where needed. For this reason, the PRISM specification uses XML, RDF, Dublin Core, and well as various ISO formats and vocabularies.
端到端的元数据(End-to-end metadata):大多数出版的内容都已经有了为它们创建的元数据。遗憾的是,当在系统之间传输内容时,元数据经常会丢失,那么只有在以后的生产过程中以相当的开销来重建它们。为了减少这种问题的发生,PRISM提供了一种能在内容生产线的多个阶段中使用的规范。PRISM规范的一大特色是对其他现有的规范的使用。工作组坚决尽可能多的使用现有的规范,而不是创建一个全新的事物,并且只是在必需的地方定义新事物。因此,RPISM规范使用XML,RDF,Dublin Core,和各种ISO格式和词汇表。
A PRISM description may be as simple as a few Dublin Core properties with plain literal values. Example 34 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example34) describes a photograph, giving basic information on its title, photographer, format, etc.
一个PRISM描述可能和一些值为频繁文字的Dublin Core属性那么简单。例34 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example34) 描述了一个照片,并给出了它的名称,摄影师,格式等一些基本的信息:

Example 34: A PRISM Description of a Photograph
例34:一个照片的PRISM描述
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:lang="en-US">


 <rdf:Description rdf:about="Corfu.jpg">
<dc:title>Walking on the Beach in Corfu</dc:title>
<dc:description>Photograph taken at 6:00 am on Corfu with two models
</dc:description>
<dc:creator>John Peterson</dc:creator>
<dc:contributor>Sally Smith, lighting</dc:contributor>
<dc:format>image/jpeg</dc:format>
</rdf:Description>

</rdf:RDF>


PRISM also augments the Dublin Core to allow more detailed descriptions. The augmentations are defined as three new vocabularies, generally cited using the prefixes prism:, pcv:, and prl:.
PRISM也对Dublin Core的作了补充用以允许更详细的描述。补充的内容通过三个新的词汇集来说明,通常通过前缀prism:,pcv:和prl来引用:
prism: This prefix refers to the main PRISM vocabulary, whose terms use the URI prefix http://prismstandard.org/namespaces/basic/1.0/. Most of the properties in this vocabulary are more specific versions of properties from the Dublin Core. For example, more specific versions of dc:date are provided by properties like prism:publicationTime, prism:releaseTime, prism:expirationTime, etc.

prism: 这个前缀指主要的RPISM词汇集,它的术语使用了URI前缀“http://prismstandard.org/namespaces/basic/1.0/”。这个词汇集中的大部分属性是来自Dublin Core属性的更细化版本。例如,dc:date的细化版本是由像prism:publicationTime,prism:releaseTime,prism:expirationTime等等这样的属性提供的。
pcv: This prefix refers to the PRISM Controlled Vocabulary (pcv) vocabulary, whose terms use the URI prefix http://prismstandard.org/namespaces/pcv/1.0/. Currently, common practice for describing the subject(s) of an article is by supplying descriptive keywords. Unfortunately, simple keywords do not make a great difference in retrieval performance, due to the fact that different people will use different keywords [BATES96 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-bates96)]. Best practice is to code the articles with subject terms from a "controlled vocabulary". The vocabulary should provide as many synonyms as possible for its terms in the vocabulary. This way the controlled terms provide a meeting ground for the keywords supplied by the searcher and the indexer. The pcv vocabulary provides properties for specifying terms in a vocabulary, the relations between terms, and alternate names for the terms.

pcv:这个前缀指PRISM受控词汇表(PRISM Controlled Vocabulary(pcv)),它的术语使用了URI前缀“http://prismstandard.org/namespaces/pcv/1.0/”。通常,描述文章的主题(可能不止一个)的常见做法是提供描述性的关键词。遗憾的是,由于不同的人会使用不同的关键词[BATES96 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-bates96)],简单的关键词对提高检索性能上并没有太大作用。最好的办法是用取自某“受控词汇表”的主题术语(subject terms)为文章编码,这个词汇集应当为词汇集中的术语提供尽可能多的同义词。这样,受控的术语就会为搜索者和编索引者提供共用的关键词。pcv词汇集提供了属性,用以说明词汇集中的术语,术语之间的关系,和术语的别称。
prl: This prefix refers to the PRISM Rights Language vocabulary, whose terms use the URI prefix http://prismstandard.org/namespaces/prl/1.0/. Digital Rights Management is an area undergoing considerable upheaval. There are a number of proposals for rights management languages, but none are clearly favored throughout the industry. Because there was no clear choice to recommend, the PRISM Rights Language (PRL) was defined as an interim measure. It provides properties which let people say if an item can or cannot be "used", depending on conditions of time, geography, and industry. This is believed to be an 80/20 trade-off which will help publishers begin to save money when tracking rights. It is not intended to be a general rights language, or allow publishers to automatically enforce limits on consumer uses of the content.

prl:这个前缀指PRISM权限语言词汇集( PRISM Rights Language vocabulary),它的术语使用URI前缀“http://prismstandard.org/namespaces/prl/1.0/”。数字权限管理(Digital Rights Management)是个承受着剧变的领域。有很多关于权限管理语言的提议,但没有一个能在整个行业中明显受欢迎。因为没有明确的可推荐选择,于是PRISM Rights Language (PRL)就被定义为一个过渡性的标准。它提供了依赖于时间,地理,行业等条件的属性,这些属性可以让人们表示一个术语能或不能被使用。人们相信这是一个将会帮助出版商在跟踪权限时省钱的“80/20平衡”【译者注:意思是说80%的人经常使用占术语总数20%的那部分术语,所以,确定一个标准(即限定这20%的术语)可以使出版商在跟踪权限时省时省力,也就省了钱。】。它不是作为一种通用的权限语言的,也不能让出版商对客户的内容使用作出限制。


PRISM uses RDF because of its abilities for dealing with descriptions of varying complexity. Currently, a great deal of metadata uses simple character string (plain literal) values, such as:
PRISM采用RDF是因为它有处理复杂程度不同的描述的能力。目前,很多元数据使用普通的字符串(平凡文字)值,例如:
<dc:coverage>Greece</dc:coverage>


Over time the developers of PRISM expect uses of the PRISM specification to become more sophisticated, moving from simple literal values to more structured values. In fact, that range of values is a situation being faced now. Some publishers already use sophisticated controlled vocabularies, others are barely using manually-supplied keywords. To illustrate this, some examples of the different kinds of values that can be given for the dc:coverage property are:
长时间以来PRISM的开发者期待着PRISM规范的使用变得更完善,由简单文字值向更具构造性的值转化。事实上,那个范围的值正是现在有待解决的。一些出版商已经在使用完善的受控词汇集了,而其他的才刚刚使用手工提供(manually-supplied)的关键词。为了说明这些,能赋值给属性dc:coverage的不同类型的值的例子是:
<dc:coverage>Greece</dc:coverage>

<dc:coverage rdf:resource="http://prismstandard.org/vocabs/ISO-3166/GR"/>


(i.e., using either a plain literal or a URIref to identify the country) and
(也就是说,用平凡文字或URIref标识这个国家)和

<dc:coverage>

  <pcv:Descriptor rdf:about="http://prismstandard.org/vocabs/ISO-3166/GR">
<pcv:label xml:lang="en">Greece</pcv:label>
<pcv:label xml:lang="fr">Grèce</pcv:label>
</pcv:Descriptor>

</dc:coverage>


(using a structured value to provide both a URIref and names in various languages).
(使用一个构造值来提供一个URIref和在多种语言中的名称)
Note also that there are properties whose meanings are similar, or subsets of other properties. For example, the geographic subject of a resource could be given with
同时注意有些含义近似,或可说是其他属性的子集的属性。例如:一个资源的地理主题可以像这样给出:


<prism:subject>Greece</prism:subject>
<dc:coverage>Greece</dc:coverage>


or

<prism:location>Greece</prism:location>


Any of those properties might use the simple literal value, or a more complex structured value. Such a range of possibilities cannot be adequately described by DTDs, or even by the newer XML Schemas. While there is a wide range of syntactic variations to deal with, RDF's graph model has a simple structure - a set of triples. Dealing with the metadata in the triples domain makes it much easier for older software to accommodate content with new extensions.
那些属性当中的任何一个都可能使用简单文字值或是一个更复杂的结构值。DTD,甚至是更新的XML Schemas,都不能充分的描述出这种多变的可能性。虽然要处理这种范围广泛的句法变化,RDF的模型图却有一种简单的结构--三元组集。在三元组领域处理元数据使得旧软件适应有新扩展的内容轻松多了。
This section closes with two final examples. Example 35 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example35) says that the image (.../Corfu.jpg) cannot be used (#none) in the tobacco industry (code 21 in SIC, the Standard Industrial Classifications).
这一节由最后举两个例子结束。例35 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example35) 说明了:图像(.../Corfu.jpg)不能够被用于(#none)烟草工业(在SIC(Standard Industrial Classifications,标准工业分类)中的代码为21 )。

Example 35: A PRISM Description of an Image
例35:一个图片的PRISM描述:
<rdf:RDF xmlns:prism="http://prismstandard.org/namespaces/basic/1.0/"

         xmlns:prl="http://prismstandard.org/namespaces/prl/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">


 <rdf:Description rdf:about="Corfu.jpg">
<dc:rights rdf:parseType="Resource"
xml:base="http://prismstandard.org/vocabularies/1.0/usage.xml">
<prl:usage rdf:resource="#none"/>
<prl:industry rdf:resource="http://prismstandard.org/vocabs/SIC/21"/>
</dc:rights>
</rdf:Description>

</rdf:RDF>


Example 36 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example36) says that the photographer for the Corfu image was employee 3845, better known as John Peterson. It also says that the geographic coverage of the photo is Greece. It does so by providing, not just a code from a controlled vocabulary, but a cached version of the information for that term in the vocabulary.
例36 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example36) 说明了图片“Corfu”的摄影师员工编号是“3845”(employee 3845),就是人们熟知的John Peterson(better known as John Peterson)。它还说明了图片所显示的地理位置为希腊。例36之所以能够做到这一点,在于它不仅仅提供了来自受控词汇表的术语代码(code),而且它还可以提供该词汇表中术语代码所隐含的信息。

Example 36: Additional Information about the Image from Example 35
例36:关于例35中图片的附加说明:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

         xmlns:pcv="http://prismstandard.org/namespaces/pcv/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xml:base="http://travel.example.com/">


  <rdf:Description rdf:about="/2000/08/Corfu.jpg">
<dc:identifier rdf:resource="/content/2357845" />
<dc:creator>
<pcv:Descriptor rdf:about="/emp3845">
<pcv:label>John Peterson</pcv:label>
</pcv:Descriptor>
</dc:creator>
<dc:coverage>
<pcv:Descriptor
rdf:about="http://prismstandard.org/vocabs/ISO-3166/GR">
<pcv:label xml:lang="en">Greece</pcv:label>
<pcv:label xml:lang="fr">Grece</pcv:label>
</pcv:Descriptor>
</dc:coverage>
</rdf:Description>

</rdf:RDF>



6.3 XPackage



Many situations involve the need to maintain information about structured groupings of resources and their associations that are, or may be, used as a unit. The XML Package (XPackage) specification (http://www.xpackage.org/specification/) [XPACKAGE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xpackage)] provides a framework for defining such groupings, called packages. XPackage specifies a framework for describing the resources included in such packages, the properties of those resources, their method of inclusion, and their relationships with each other. XPackage applications include specifying the style sheets used by a document, declaring the images shared by multiple documents, indicating the author and other metadata of a document, describing how namespaces are used by XML resources, and providing a manifest for bundling resources into a single archive file.

在很多情况下都需要维持 关于资源的结构化分组和他们用作单位的联系的信息.The XML 包 (XPackage) 规格说明书 (http://www.xpackage.org/specification/) [XPACKAGE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xpackage)提供了一个定义这样的分组的框架,叫做"包". XPackage 详细说明了一个框架来描述包含在包里面的资源,这些资源的特性,包含的方法,还有他们之间的相互关系. XPackage 应用包括指定一个文档用的样式表,声明多个文档共用的图片, 指明一个文档的作者和其他元数据, 描述XML资源是如何使用名字空间的,还提供了一个清单来把资源和一个档案文件捆在一起.
The XPackage framework is based upon XML, RDF, and the XML Linking Language (http://www.w3.org/TR/xlink/) [XLINK (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xlink)], and provides multiple RDF vocabularies: one for general packaging descriptions, and several other vocabularies for providing supplemental resource information useful to package processors.
XPackage 框架是基于XML, RDF和XML 链接语言 (http://www.w3.org/TR/xlink/) [XLINK (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xlink)], 还提供了多个RDF词汇表: 一个是用在一般的包装描述, 还有几个词汇表是用于对包装处理器提供一些有用的信息.
One application of XPackage is the description of XHTML documents and their supporting resources. An XHTML document retrieved from a Web site may rely on other resources such as style sheets and image files that also need to be retrieved. However, the identities of these supporting resources may not be obvious without processing the entire document. Other information about the document, such as the name of its author, may also not be available without processing the document. XPackage allows such descriptive information to be stored in a standard way in a package description document containing RDF. The outer elements of a package description document describing such an XHTML document might look like Example 37 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example37) (with namespace declarations removed for simplicity):

对XPackage的一个应用是描述XHTML文档和他们支持的资源.当一个站点要获取一个XHTML文档的时候,或许还会牵涉到其他的资源,像样式表和图像文件也需要被获取.然而,如果不处理这个文档,这些资源的特性就不是很明显了.关于这个文档的其他信息,例如作者的名字,如果不处理这个文档,可能也是不可取的. XPackage允许这些叙述性情报(如作者等信息)标准地储存在一个包含RDF的包描述文档.例 37 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example37) (为了简明, 删除了名字空间声明):描述一个XHTML文档的包描述文档的外部元素:

Example 37: Outer Elements of an XPackage Package Description Document
例 37: 一个XPackage 包描述文档的外部元素

<?xml version="1.0"?>
<xpackage:description>

  <rdf:RDF>


    (description of individual resources go here)


  </rdf:RDF>

</xpackage:description>


Resources (such as the XHTML document, style sheets, and images) are described within this package description document using standard RDF/XML syntax. Each resource description element may include RDF properties from various vocabularies (XPackage uses the term "ontology" for what RDF calls a "vocabulary"). Besides the main packaging vocabulary, XPackage itself specifies several supplemental vocabularies, including:
在包描述文档里面,资源(如XHTML文档, 样式表, 和图片) 被标准的RDF/XML语法描述. 每一个资源描述元素都包含在不同的词汇表里面的RDF属性(XPackage 使用术语"ontology"来表示RDF里面的"词汇表"). 除了那个主要的包词汇表, XPackage 本身自带了几个补充的词汇表,包括:


  • a vocabulary (using prefix file:) for describing files (with properties such as file:size)
  • a vocabulary (using prefix mime:) for providing MIME information (with properties such as mime:contentType)
  • a vocabulary (using prefix unicode:) for providing character usage information (with properties such as unicode:script)
  • a vocabulary (using prefix x:) for describing XML-based resources (with properties such as x:namespace and x:style)


  • 一个描述文件(包含属性如 file:size)的词汇表(使用前缀 file:)
  • 一个提供MIME信息(包含属性如mime:contentType)的词汇表(使用前缀 mime:)
  • 一个提供字符使用信息(包含属性如unicode:sript)的词汇表(使用前缀 unicode:)
  • 一个描述基于XML的资源(包含属性如x:namespace和x:style)的词汇表(使用前缀 x:)

In Example 38 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example38), the document's MIME content type ("application/xhtml+xml") is defined using a standard XPackage property from the XPackage MIME vocabulary, mime:contentType. Another property, the document's author (in this case, "Garret Wilson"), is described using a property from the Dublin Core vocabulary, defined outside of XPackage, resulting in a dc:creator property.
例 38 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example38), 使用一个标准的属于XPackage MINE 词汇表的XPackage属性(mime:contentType),定义了文件的MIME 内容类型 ("application/xhtml+xml"). 另一个属性,使用了一个Dublin Core 词汇表里面的属性来描述文档的作者 (在这个例子里是"Garret Wilson").这个属性是在XPackage外部定义的,所有就使用了dc:creator这个属性.



Example 38: A Description of an XHTML Document
例 38: 对一个XHTML文档的描述

<?xml version="1.0"?>
<xpackage:description

           xmlns:xpackage="http://xpackage.org/namespaces/2003/xpackage#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:mime="http://xpackage.org/namespaces/2003/mime#"
xmlns:x="http://xpackage.org/namespaces/2003/xml#"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rdf:RDF>


    <!--doc.html-->
<rdf:Description rdf:about="urn:example:xhtmldocument-doc">
<rdfs:comment>The XHTML document.</rdfs:comment>
<xpackage:location xlink:href="doc.html"/>
<mime:contentType>application/xhtml+xml</mime:contentType>
<x:namespace rdf:resource="http://www.w3.org/1999/xhtml"/>
<x:style rdf:resource="urn:example:xhtmldocument-stylesheet"/>
<dc:creator>Garret Wilson</dc:creator>
<xpackage:manifest rdf:parseType="Collection">
<rdf:Description rdf:about="urn:example:xhtmldocument-stylesheet"/>
<rdf:Description rdf:about="urn:example:xhtmldocument-image"/>
</xpackage:manifest>
</rdf:Description>


    </rdf:RDF> 

</xpackage:description>


The xpackage:manifest property indicates that both the style sheet and image resources are necessary for processing; those resources are described separately within the package description document. The example style sheet resource description in Example 39 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example39) lists its location within the package ("stylesheet.css") using the general XPackage vocabulary xpackage:location property (which is compatible with XLink), and shows through use of the XPackage MIME vocabulary mime:contentType property that it is a CSS style sheet ("text/css").

属性xpackage:manifest 指明,在处理的时候,样式表和图像资源都需要用到; 那些资源在包描述文档里面被分别的描述. 在描述样式表的例子例 39 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example39)里面, 使用在general XPackage 词汇表里面的xpackage:location属性列出了它在包里面的路径("stylesheet.css"), 也用XPackage MIME 词汇表的 mime:contentType 属性来说明了这是一个CSS 样式表 ("text/css").


Example 39: A Style Sheet Resource Description
例 39: 一个样式表的资源描述

<?xml version="1.0"?>
<xpackage:description

           xmlns:xpackage="http://xpackage.org/namespaces/2003/xpackage#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:mime="http://xpackage.org/namespaces/2003/mime#"
xmlns:x="http://xpackage.org/namespaces/2003/xml#"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rdf:RDF>


    <!--stylesheet.css-->
<rdf:Description rdf:about="urn:example:xhtmldocument-css">
<rdfs:comment>The document style sheet.</rdfs:comment>
<xpackage:location xlink:href="stylesheet.css"/>
<mime:contentType>text/css</mime:contentType>
</rdf:Description>


    </rdf:RDF> 

</xpackage:description>


The full version of this example may be found in [XPACKAGE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xpackage)].
这个例子的完整版本可以在 [XPACKAGE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xpackage)]上看到.


6.4 RSS 1.0: RDF Site Summary

6.4 RSS 1.0: RDF站点汇总


People sometimes need to access a wide variety of information on the Web on a day-to-day basis, such as schedules, to-do lists, news headlines, search results, "What's New", etc. As the sources and diversity of the information on the Web increases, it becomes increasingly difficult to manage this information and integrate it into a coherent whole. RSS 1.0 (http://purl.org/rss/1.0) ("RDF Site Summary") is an RDF vocabulary that provides a lightweight, yet powerful way of describing information for timely, large-scale distribution and reuse. RSS 1.0 is also perhaps the most widely deployed RDF application on the Web.

人们常常需要每天访问网上各种各样的信息,例如计划安排、任务表、新闻标题、搜索结果,最新消息等。随着万维网上信息资源和多样性的增加,管理这些信息并将之集成为一个整体的难度越来越大。RSS1.0(http://purl.org/rss/1.0)(“RDF Site Sumary”)是一个RDF词汇表,它提供一种轻量级但功能强大的方式来描述这些实时的、大规模分布和可重用的信息。RSS1.0同时可能也是万维网上最为广泛的RDF应用。


To give a simple example, the W3C home page (http://www.w3.org/) is a primary point of contact with the public and serves in part to disseminate information about the deliverables of the Consortium. An example of the W3C home page as of a certain date is shown in Figure 19 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure19). The center column of news items changes frequently. To support the timely dissemination of this information, the W3C Team has implemented an RDF Site Summary (RSS 1.0 (http://purl.org/rss/1.0/)) news feed that makes the content in the center column available to others to reuse as they will. News syndication sites may merge the headlines into a summary of the day's latest news, others may display the headlines as links as a service to their readers, and, increasingly, individuals may subscribe to this feed with a desktop application. These desktop RSS readers allow their users to keep track of potentially hundreds of sites, without having to visit each one in their browser.

举例来说,W3C主页(http://www.w3.org)是W3C组织与保持公众联系的主要方式,服务于传播有关该组织的研究信息。图19是某一天的W3C主页,(http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure19).中间一列是新闻条目,经常发生改变。为了能够及时传播这些信息,W3C 小组实现了一个RDF Site Summary(RSS 1.0 (http://purl.org/rss/1.0/))新闻种子,这样中间列的内容就可以被其它人按需获取或者重用。新闻综合站点可以将(种子站点的)新闻标题融合进自己当天新闻综述之中。其它的站点也可以将新闻标题作为一种链接显示给它们的访问者,并且,越来越多的个人会用自己的桌面应用来订阅种子(站点的内容)。这些桌面的RSS 阅读器允许它们的用户不用浏览器去访问每一个站点,就能追踪上百个站点。

fig18dec16.gif (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/w3c-rss.crop.gif)

图19:W3C主页

Numerous sites all over the Web provide RSS 1.0 feeds. Example 40 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example40) is an example of the W3C feed (http://www.w3.org/2000/08/w3c-synd/home.rss) (from a different date):


万维网上大量的站点都提供RSS1.0种子。例40 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example40)是某一天W3C种子的实例。(http://www.w3.org/2000/08/w3c-synd/home.rss)



例 40: W3C RSS 1.0 种子示例

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns="http://purl.org/rss/1.0/"

    xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">


  <channel rdf:about="http://www.w3.org/2000/08/w3c-synd/home.rss">
<title>The World Wide Web Consortium</title>
<description>Leading the Web to its Full Potential...</description>
<link>http://www.w3.org/</link&gt;


    <dc:date>2002-10-28T08:07:21Z</dc:date>


    <items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.w3.org/News/2002#item164"/>
<rdf:li rdf:resource="http://www.w3.org/News/2002#item168"/>
<rdf:li rdf:resource="http://www.w3.org/News/2002#item167"/>
</rdf:Seq>
</items>


  </channel>


  <item rdf:about="http://www.w3.org/News/2002#item164">
<title>User Agent Accessibility Guidelines Become a W3C
Proposed Recommendation</title>
<description>17 October 2002: W3C is pleased to announce the
advancement of User Agent Accessibility Guidelines 1.0 to
Proposed Recommendation. Comments are welcome through 14 November.
Written for developers of user agents, the guidelines lower
barriers to Web accessibility for people with disabilities
(visual, hearing, physical, cognitive, and neurological).
The companion Techniques Working Draft is updated. Read about
the Web Accessibility Initiative. (News archive)</description>
<link>http://www.w3.org/News/2002#item164</link&gt;
<dc:date>2002-10-17</dc:date>
</item>


  <item rdf:about="http://www.w3.org/News/2002#item168">
<title>Working Draft of Authoring Challenges for Device
Independence Published</title>
<description>25 October 2002: The Device Independence
Working Group has released the first public Working Draft of
Authoring Challenges for Device Independence. The draft describes
the considerations that Web authors face in supporting access to
their sites from a variety of different devices. It is written
for authors, language developers, device experts and developers
of Web applications and authoring systems. Read about the Device
Independence Activity (News archive)</description>
<link>http://www.w3.org/News/2002#item168</link&gt;
<dc:date>2002-10-25</dc:date>
</item>


  <item rdf:about="http://www.w3.org/News/2002#item167">
<title>CSS3 Last Call Working Drafts Published</title>
<description>24 October 2002: The CSS Working Group has
released two Last Call Working Drafts and welcomes comments
on them through 27 November. CSS3 module: text is a set of
text formatting properties and addresses international contexts.
CSS3 module: Ruby is properties for ruby, a short run of text
alongside base text typically used in East Asia. CSS3 module:
The box model for the layout of textual documents in visual
media is also updated. Cascading Style Sheets (CSS) is a
language used to render structured documents like HTML and
XML on screen, on paper, and in speech. Visit the CSS home
page. (News archive)</description>
<link>http://www.w3.org/News/2002#item167</link&gt;
<dc:date>2002-10-24</dc:date>
</item>


</rdf:RDF>


As Example 40 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example40) shows, the format is designed for content that can be packaged into easily distinguishable sections. News sites, Web logs, sports scores, stock quotes, and the like are all use-cases for RSS 1.0.

正如例40所示 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example40),种子的格式经过专门设计,这样内容就可以非常容易地打包进不同的部分。新闻站点,网站日志,体育比分(sports scores)、股票报价 一类的应用都是RSS1.O的典型用例。


The RSS feed can be requested by any application able to "speak" HTTP. More recently, however, RSS 1.0 applications are splitting into three different categories:

RSS种子可以被任何能够“讲”HTTP的应用所请求。最近,RSS1.0应用分成了以下三种不同的大类:


  • On-line aggregators - Sites such as Meerkat (http://www.oreillynet.com/meerkat/index.php?&amp;c=4743&amp;t=ALL) and NewsIsFree (http://www.newsisfree.com/sources/info/906/), shown side-by-side in Figure 20 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure20) (each mirroring W3C's column of news). These gather feeds from thousands of sources, separate each of the <item>s out, and add them together again into one large group. The whole group is then made searchable. In this way, one can search for the latest news on, for example, "Java" from perhaps thousands of sites, without having to search them all.


  • Scripts - RSS's original purpose was to allow Webmasters to include the content of another's site within their own. RSS 1.0 is still used in this way, with many sites (Slashdot (http://slashdot.org/) for example) incorporating RSS feeds on their front page.
  • 脚本-RSS 的最初目的是让网站站长能够将其它站点的内容包含进自己的站点。RSS1.0仍然在以这种方式使用。许多站点(例如Slashdot (http://slashdot.org/))将RSS种子集成进网站的首页(front page)。


fig19Adec16.gif (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/meerkat-rss.crop.gif) fig19Bdec16.gif (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/newsisfree-rss.crop.gif)

图20:MeerKat 和 NewsIsFree


RSS 1.0 is extensible by design. By importing additional RDF vocabularies (or modules as they are known within the RSS development community), the RSS 1.0 author can provide large amounts of metadata and handling instructions to the recipient of the file. Modules can, as with more general RDF vocabularies, be written by anyone. Currently there are 3 official modules (http://web.resource.org/rss/1.0/) and 19 proposed modules (http://web.resource.org/rss/1.0/modules/proposed.html) readily recognized by the community at large. These modules range from the complete Dublin Core module (http://web.resource.org/rss/1.0/modules/dc/) to more specialized RSS-centric modules such as the Aggregation module (http://web.resource.org/rss/1.0/modules/aggregation/).

RSS1.0遵照可扩展原则进行设计。通过引入其它的RDF词汇(RSS开发团体称之为模块(modules)),RSS1.0作者可以提供大量的元数据并处理。模块可以和其它更通用的RDF词汇一样,可以由感兴趣的人员来开发。当前,已经开发了三个官方认可的模块(http://web.resource.org/rss/1.0/),和19个建议模块(http://web.resource.org/rss/1.0/modules/proposed.html)。这些模块已经被大量团体所认同,其覆盖范围从完整的都柏林核心模块(Dublin Core module) (http://web.resource.org/rss/1.0/modules/dc/) 到更加专业的RSS中心模块,例如 Aggregation module (http://web.resource.org/rss/1.0/modules/aggregation/).

Care should be taken when discussing "RSS" in the scope of RDF. There are currently two RSS specification strands. One strand (RSS 0.91,0.92,0.93,0.94 and 2.0) does not use RDF. The other strand (RSS 0.9 and 1.0) does.

应当注意一点,当我们在RDF的范畴讨论RSS的时候,当前有两中RSS规范标准。一个分支(RSS 0.91,0.92,0.93,0.94 和2.0)没有使用RDF,另外一个分支(RSS 0.9 和1.0)使用了RDF。


6.5 CIM/XML



6.5 CIM/XML


Electric utilities use power system models for a number of different purposes. For example, simulations of power systems are necessary for planning and security analysis. Power system models are also used in actual operations, e.g., by the Energy Management Systems (EMS) used in energy control centers. An operational power system model can consist of thousands of classes of information. In addition to using these models in-house, utilities need to exchange system modeling information, both in planning, and for operational purposes, e.g., for coordinating transmission and ensuring reliable operations. However, individual utilities use different software for these purposes, and as a result the system models are stored in different formats, making the exchange of these models difficult.

电业部门使用电力系统模型以完成各种不同的任务。例如,在计划和安全分析中电力系统的模拟就是必不可少的。电力系统模型同时也应用于实际的操作中,比如它可以被能源管理系统(Energy Management Systems ,EMS)用于能源控制中心中。一个实际运作的电力系统模型可能由几千种信息类别组成。除了在内部使用这些模型,电业部门为了规划和一些运作目的,比如为了达到协调电力传输或者确保操作可靠性的目的,还需要相互交换系统模型信息。然而,各个电业部门使用了不同的软件来完成这些任务,因此,系统模型以不同的格式存储,这使得这些模型的交换相当困难。
In order to support the exchange of power system models, utilities needed to agree on common definitions of power system entities and relationships. To support this, the Electric Power Research Institute (http://www.epri.com/) (EPRI) a non-profit energy research consortium, developed a Common Information Model (CIM) [CIM (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-cim)]. The CIM specifies common semantics for power system resources, their attributes, and relationships. In addition, to further support the ability to electronically exchange CIM models, the power industry has developed CIM/XML (http://www.langdale.com.au/CIMXML/), a language for expressing CIM models in XML. CIM/XML is an RDF application, using RDF and RDF Schema to organize its XML structures. The North American Electric Reliability Council (http://www.nerc.com/) (NERC) (an industry-supported organization formed to promote the reliability of electricity delivery in North America) has adopted CIM/XML as the standard for exchanging models between power transmission system operators. The CIM/XML format is also going through an IEC international standardization process. An excellent discussion of CIM/XML can be found in [DWZ01 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-devos)]. [NB: This power industry CIM should not be confused with the CIM developed by the Distributed Management Task Force (http://www.dmtf.org/) for representing management information for distributed software, network, and enterprise environments. The DMTF CIM also has an XML representation, but does not currently use RDF, although independent research is underway in that direction.]

为了使电力系统模型间能够进行信息交换,电业部门需要就电力系统的实体以及实体间关系的定义达成一致。一个非盈利性的电力科学研究协会――电力能源研究协会 (http://www.epri.com/)(Electric Power Research Institute,EPRI),开发了一个[通用信息模型 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-cim)](Common Information Model,CIM)来完成这一任务。在CIM模型中,明确了电力系统的资源,属性以及关系等的通用语义。除此之外,为了能够进一步增强电子化地交换CIM模型的能力,电力业已经开发了一种用XML表达CIM模型的语言CIM/XML (http://www.langdale.com.au/CIMXML/)。CIM/XML是一种RDF的应用,使用RDF和RDF Schema来组织CIM模型的XML文档结构。北美电力可靠性理事会 (http://www.nerc.com/)(North American Electric Reliability Council,NERC)(一个业界组织的以提高北美地区电力传送可靠性为目的的理事会)已经采纳了CIM/XML作为电力传输系统运营商间交换模型信息的标准。同时,CIM/XML格式也通过了国际电工委员会的国际标准化认证过程。在[DWZ01 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-devos)]上有关于CIM/XML的大量精彩讨论.[注:请不要将电力业CIM与分布式管理任务组(Distributed Management Task Force, DMTF) (http://www.dmtf.org/)所开发的CIM混淆。DMTF开发的CIM是用以为分布式软件、网络和企业环境表示管理信息的,它也是采用XML进行表示的,目前并未采用RDF,但关于这个方向的独立研究已经展开。

The CIM can represent all of the major objects of an electric utility as object classes and attributes, as well as their relationships. CIM uses these object classes and attributes to support the integration of independently developed applications between vendor specific EMS systems, or between an EMS system and other systems that are concerned with different aspects of power system operations, such as generation or distribution management.

CIM模型能将一个电业部门的所有主要对象均表示为类、属性以及它们之间的关系.CIM模型使用这些类和属性以支持独立开发的应用软件之间的集成,这些软件可能应用于特定厂商的EMS之间,也可能是应用于某个EMS和其他的与系统运作有关的系统之间,像发电和送电的管理等。

The CIM is specified as a set of class diagrams using the Unified Modeling Language (http://www.uml.org/) (UML). The base class of the CIM is the PowerSystemResource class, with other more specialized classes such as Substation, Switch, and Breaker being defined as subclasses. CIM/XML represents the CIM as an RDF Schema vocabulary, and uses RDF/XML as the language for exchanging specific system models. Example 41 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example41) shows examples of CIM/XML class and property definitions:


CIM模型被明确表示为一系列使用统一建模语言 (http://www.uml.org/)(Unified Modeling Language,UML)描述的类图。CIM模型的基类是PowerSystemResource类,同时CIM模型还包括了Substation 、Switch、Breaker等一些特殊化的子类。CIM/XML将CIM表示为RDF模式的一个词汇表,并将RDF/XML用作为交换特定系统模型间的语言。例41 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example41)展示了CIM/XML类和属性定义的例子。


Example 41: Examples of CIM/XML Class and Property Definitions
例41: CIM/XML类和属性定义的例子

 <rdfs:Class rdf:ID="PowerSystemResource"> 
<rdfs:label xml:lang="en">PowerSystemResource</rdfs:label>
<rdfs:comment>"A power system component that can be either an
individual element such as a switch or a set of elements
such as a substation. PowerSystemResources that are sets
could be members of other sets. For example a Switch is a
member of a Substation and a Substation could be a member
of a division of a Company"</rdfs:comment>
</rdfs:Class>
<rdfs:Class rdf:ID="Breaker">
<rdfs:label xml:lang="en">Breaker</rdfs:label>
<rdfs:subClassOf rdf:resource="#Switch" />
<rdfs:comment>"A mechanical switching device capable of making,
carrying, and breaking currents under normal circuit conditions
and also making, carrying for a specified time, and breaking
currents under specified abnormal circuit conditions e.g. those
of short circuit. The typeName is the type of breaker, e.g.,
oil, air blast, vacuum, SF6."</rdfs:comment>
</rdfs:Class>
<rdf:Property rdf:ID="Breaker.ampRating">
<rdfs:label xml:lang="en">ampRating</rdfs:label>
<rdfs:domain rdf:resource="#Breaker" />
<rdfs:range rdf:resource="#CurrentFlow" />
<rdfs:comment>"Fault interrupting rating in amperes"</rdfs:comment>
</rdf:Property>

CIM/XML uses only a subset of the complete RDF/XML syntax, in order to simplify expressing the models. In addition, CIM/XML implements some extensions to the RDF Schema vocabulary. These extensions support the description of inverse roles and multiplicity (cardinality) constraints describing how many instances of a given property are allowed for a given resource (allowable values for a multiplicity declaration are zero-or-one, exactly-one, zero-or-more, one-or-more). The properties in Example 42 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example42) illustrate these extensions (which are identified by a cims: QName prefix):


CIM/XML为了简化模型表达,只使用了RDF/XML完全语法的一个子集。并且,CIM/XML对RDF Schema词汇表进行了一些扩展。这些扩展支持逆属性的描述以及多值(基数)约束。多值(基数)约束用来描述对于一个给定资源的一个给定属性允许的作为其值的实例个数(对于一个多值声明允许的值是“零值或单值”、“单值”、“零值或多值”、“单值或多值”)。例42 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example42)中的属性阐述了这些扩展(这些扩展的部分用QName前缀cims标识):


Example 42: Some CIM/XML Extensions of RDF Schema

例42:一些RDF模式的CIM/XML扩展

<rdf:Property rdf:ID="Breaker.OperatedBy">

   <rdfs:label xml:lang="en">OperatedBy</rdfs:label> 
<rdfs:domain rdf:resource="#Breaker" />
<rdfs:range rdf:resource="#ProtectionEquipment" />
<cims:inverseRoleName rdf:resource="#ProtectionEquipment.Operates" />
<cims:multiplicity rdf:resource="http://www.cim-logic.com/schema/990530#M:0..n" />
<rdfs:comment>"Circuit breakers may be operated by
protection relays."</rdfs:comment>

</rdf:Property>

<rdf:Property rdf:ID="ProtectionEquipment.Operates">

   <rdfs:label xml:lang="en">Operates</rdfs:label> 
<rdfs:domain rdf:resource="#ProtectionEquipment" />
<rdfs:range rdf:resource="#Breaker" />
<cims:inverseRoleName rdf:resource="#Breaker.OperatedBy" />
<cims:multiplicity rdf:resource="http://www.cim-logic.com/schema/990530#M:0..n" />
<rdfs:comment>"Circuit breakers may be operated by
protection relays."</rdfs:comment>

</rdf:Property>


EPRI has conducted successful interoperability tests using CIM/XML to exchange real-life, large-scale models (involving, in the case of one test, data describing over 2000 substations) between a variety of vendor products, and validating that these models would be correctly interpreted by typical utility applications. Although the CIM was originally intended for EMS systems, it is also being extended to support power distribution and other applications as well.

通过使用CIM/XML交换各个厂商产品之间的实际的大规模模型(包括像在一个测试中使用到的2000多所变电站的描述数据),并通过验证这些模型能被有代表性的应用软件所正确解释,电力科学研究院已经成功的进行了互操作的测试。尽管CIM模型原先是被计划用于电力管理系统,但现在它已经被扩展到电力传输以及其他方面的一些应用领域了。

The Object Management Group (http://www.omg.org/) has adopted an object interface standard to access CIM power system models called the Data Access Facility [DAF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-daf)]. Like the CIM/XML language, the DAF is based on the RDF model and shares the same CIM schema. However, while CIM/XML enables a model to be exchanged as a document, DAF enables an application to access the model as a set of objects.

对象管理组织 (http://www.omg.org/)(Object Management Group,OMG)已经采用了一个称为数据访问辅助工具(Data Access Facility ,[DAF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-daf)])的对象接口标准来对CIM电力系统模型进行访问。类似CIM/XML语言,DAF也是基于RDF模型的,并且与CIM/XML共享相同的CIM模式。.然而,CIM/XML目的是使一个模型能够以文档的方式被交换,而DAF则是使应用软件能够像访问一个对象集合一样的访问这个模型。

CIM/XML illustrates the useful role RDF can play in supporting XML-based exchange of information that is naturally expressed as entity-relationship or object-oriented classes, attributes, and relationships (even when that information will not necessarily be Web-accessible). In these cases, RDF provides a basic structure for the XML in support of identifying objects, and using them in structured relationships. This connection is illustrated by a number of applications using RDF/XML for information interchange, as well as a number of projects investigating linkages between RDF (or ontology languages such as OWL) and UML (and its XML representations). CIM/XML's need to extend RDF Schema to support cardinality constraints and inverse relationships also illustrates the kinds of requirements that have led to the development of more powerful RDF-based schema/ontology languages such as DAML+OIL and OWL described in Section 5.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas). Such languages may be appropriate in supporting many similar modeling applications in the future.

基于XML的信息交换很自然地能被表示为实体-关系模型或者面向对象的类、属性和关系(甚至不要求这些信息是能通过Web访问的),CIM/XML阐明了RDF在这其中能够扮演的重要角色。在这些情况下,RDF为XML提供了一个基本架构以支持对象标识,以及支持在结构化的关系中使用这些对象。大量使用RDF/XML进行信息交换的应用软件阐明了这一关系,同时大量研究RDF(或者像OWL等的本体语言)和UML(以及它的XML表示)之间联系的工程也阐明了这一关系。CIM/XML需要扩展RDF模式才能支持基数约束和逆属性,这类的需要促使人们开发更强大的基于RDF的Schema或本体语言,如DAML+OIL和在5.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)描述的OWL等。在将来,这些语言在支持一些类似的模型应用就可能更为合适。

Finally, CIM/XML also illustrates an important fact for those looking for additional examples of "RDF in the Field": sometimes languages are described as "XML" languages, or systems are described as using "XML", and the "XML" they are actually using is RDF/XML, i.e., they are RDF applications. Sometimes it is necessary to go fairly far into the description of the language or system in order to find this out (in some examples that have been found, RDF is never explicitly mentioned at all, but sample data clearly shows it is RDF/XML). Moreover, in applications such as CIM/XML, the RDF that is created will not be readily found on the Web, since it is intended for information exchange between software components rather than for general access (although future scenarios could be imagined in which more of this type of RDF would become Web-accessible).


最后,CIM/XML还为那些正在寻找另外的“RDF在领域中的应用”的例子的那些人阐述了一个重要事实:一些语言被描述为“XML”语言,或者系统被描述为使用“XML”的,而它们实际使用的“XML”就是RDF/XML,也即它们就是关于RDF的应用。有时需要相当深入地了解这些语言或者这些系统的描述才能发现这点(在某些已知的例子中,RDF甚至根本没有被明确的提及,但是样例数据清楚地显示这是RDF/XML)。同时,在类似于CIM/XML的这些应用中,由于创建的RDF是被计划用作软件部件间的信息交换而不是用于通用性的访问(尽管我们可以假想在未来,更多这种类型的RDF能够通过Web访问),因此创建出的RDF在Web上并不那么容易找到。


6.6 Gene Ontology Consortium

6.6 基因本体协会


Structured metadata using controlled vocabularies such as SNOMED RT (http://www.snomed.org/) (Systematized Nomenclature of Medicine Reference Terminology) and MeSH (http://www.nlm.nih.gov/mesh/meshhome.html) (Medical Subject Headings) plays an important role in medicine, enabling more efficient literature searches and aiding in the distribution and exchange of medical knowledge [COWAN (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-cowan)]. At the same time, the field of medicine is rapidly changing, and with that comes the need to develop additional vocabularies.

使用像 SNOMED RT (http://www.snomed.org/) (医学文献术语系统化命名法, Systematized Nomenclature of Medicine Reference Terminology) 和MeSH (http://www.nlm.nih.gov/mesh/meshhome.html) (医学学科标题,Medical Subject Headings) 之类的受控词汇表的结构化元数据在医学界扮演着越来越重要的角色。这些结构化元数据提高了文献搜索的效率,并有助于医学知识[COWAN (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-cowan)]的传播与交换。但是,由于医学领域知识在不断地发生快速变化,这就要求人们开发额外的词汇表以供使用。

The objective of the Gene Ontology (GO) Consortium (http://www.geneontology.org/) [GO (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-go)] is to provide controlled vocabularies to describe specific aspects of gene products. Collaborating databases annotate their gene products (or genes) with GO terms, providing references and indicating what kind of evidence is available to support the annotations. The use of common GO terms by these databases facilitates uniform queries across them. The GO ontologies are structured to allow both attribution and querying to be performed at different levels of granularity. The GO vocabularies are dynamic, since knowledge of gene and protein roles in cells is accumulating and changing.

基因本体协会 (http://www.geneontology.org/)(Gene Ontology (GO) Consortium)的[基因本体 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-go)([GO])]旨在提供一个受控词汇表,用以描述基因产品某些方面的特征。相互协作的数据库使用基因本体术语标注它们的基因产品(或者基因),引用并指明了哪些证据可用以支持这些注释。这些数据库使用通用基因本体术语,更加容易实现数据库之间的统一查询。结构化的基因本体可以在不同的粒度等级上进行归因与查询。由于有关基因和蛋白质在细胞中功能的知识在不断积累和更新,因此基因本体词汇表也是动态变化的。

The three organizing principles of the GO are molecular function, biological process, and cellular component. A gene product has one or more molecular functions and is used in one or more biological processes; it may be, or may be associated with, one or more cellular components. Definitions of the terms within all three of these ontologies are contained in a single (text) definition file. XML formatted versions, containing all three ontology files and all available definitions, are generated monthly.

基因本体的三个组织原则是“分子功能”,“生物过程”和“细胞成分”。某个基因产品可能有一种或多种分子功能,并有可能作用于一个或多个生物过程之中;该产品可能包含了一种或多种的细胞成分,也可能与一种或多种细胞成分相关联。这三种本体中所有的术语定义都包含在一个单独的(文本格式的)定义文件中。每月都会定时生成一些XML格式的文件,其中包含了这三种本体文件以及所有可用的(本体)定义。

Function, process and component are represented as directed acyclic graphs (DAGs) or networks. A child term may be an "instance" of its parent term (isa relationship) or a component of its parent term (part-of relationship). A child term may have more than one parent term and may have a different class of relationship with its different parents. Synonyms and cross-references to external databases are also represented in the ontologies. GO uses RDF/XML facilities to represent the relationships between terms in the XML versions of the ontologies, because of its flexibility in representing these graph structures, as well as its widespread tool support. At the same time, GO currently uses non-RDF nested XML structures within the term descriptions, so the language used is not pure RDF/XML.

功能、过程和成分被表示为有向无环图(DAGs)或者网络。一个子术语可能是其父术语的一个“实例”(isa-关系),或者是其父术语的一个成分(part-of关系)。一个子术语可能有多个父术语并可能与其不同的父术语间有着不同的关系类别。本体还可以表示同义词和对外部数据库的交叉引用。由于RDF/XML在表示图结构时有很大的灵活性,并且有着广泛的工具支持,基因本体使用RDF/XML来简化XML版本的本体中的术语间的关系表示。但是,基因本体目前在术语描述中使用了“非”RDF嵌套的XML结构,所以现在所使用的基因本体描述语言并不是纯粹的RDF/XML。

Example 43 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example43) shows some sample GO information from the GO documentation (http://www.geneontology.org/GO.doc.html):


例 43 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example43) 展示了一些基因本体文档 (http://www.geneontology.org/GO.doc.html)中的基因本体信息的样例:


Example 43: Sample GO Information

例 43:基因本体信息样例

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE go:go>
<go:go xmlns:go="http://www.geneontology.org/xml-dtd/go.dtd#"

       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 
<go:version timestamp="Wed May 9 23:55:02 2001" />


  <rdf:RDF> 
<go:term rdf:about="http://www.geneontology.org/go#GO:0003673">
<go:accession>GO:0003673</go:accession>
<go:name>Gene_Ontology</go:name>
<go:definition></go:definition>
</go:term>


     <go:term rdf:about="http://www.geneontology.org/go#GO:0003674"> 
<go:accession>GO:0003674</go:accession>
<go:name>molecular_function</go:name>
<go:definition>The action characteristic of a gene product.</go:definition>
<go:part-of rdf:resource="http://www.geneontology.org/go#GO:0003673" />
<go:dbxref>
<go:database_symbol>go</go:database_symbol>
<go:reference>curators</go:reference>
</go:dbxref>
</go:term>


     <go:term rdf:about="http://www.geneontology.org/go#GO:0016209"> 
<go:accession>GO:0016209</go:accession>
<go:name>antioxidant</go:name>
<go:definition></go:definition>
<go:isa rdf:resource="http://www.geneontology.org/go#GO:0003674" />
<go:association>
<go:evidence evidence_code="ISS">
<go:dbxref>
<go:database_symbol>fb</go:database_symbol>
<go:reference>fbrf0105495</go:reference>
</go:dbxref>
</go:evidence>
<go:gene_product>
<go:name>CG7217</go:name>
<go:dbxref>
<go:database_symbol>fb</go:database_symbol>
<go:reference>FBgn0038570</go:reference>
</go:dbxref>
</go:gene_product>
</go:association>
<go:association>
<go:evidence evidence_code="ISS">
<go:dbxref>
<go:database_symbol>fb</go:database_symbol>
<go:reference>fbrf0105495</go:reference>
</go:dbxref>
</go:evidence>
<go:gene_product>
<go:name>Jafrac1</go:name>
<go:dbxref>
<go:database_symbol>fb</go:database_symbol>
<go:reference>FBgn0040309</go:reference>
</go:dbxref>
</go:gene_product>
</go:association>
</go:term>
</rdf:RDF>

</go:go>


Example 43 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example43) illustrates that go:term is the basic element. In some cases, the GO has defined its own terms rather than using RDF Schema. For example, term GO:0016209 has the element <go:isa rdf:resource="http://www.geneontology.org/go#GO:0003674" />. This tag represents the relationship "GO:0016209 isa GO:0003674", or, in English, "Antioxidant is a molecular function." Another specialized relationship is go:part-of. For example, GO:0003674 has the element <go:part-of rdf:resource="http://www.geneontology.org/go#GO:0003673" />. This says that "Molecular function is part of the Gene Ontology".

例 43 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example43)说明了go:term是基本元素。在某些情况下,基因本体没有使用RDF Schema,而定义了它自己的术语。例如,术语GO:0016209有一个元素<go:isa rdf:resource="http://www.geneontology.org/go#GO:0003674" />。这一标记表示了"GO:0016209 isa GO:0003674"这一关系,或者用英语来说,表示了“Molecular function is part of the Gene Ontology(抗氧化剂是一个分子功能)”。另一个关系特例是go:part-of。例如,GO:0003674有一个元素是<go:part-of rdf:resource="http://www.geneontology.org/go#GO:0003673" />。这表明了“Molecular function is part of the Gene Ontology(分子功能是基因本体的一部分)”。

Every annotation must be attributed to a source, which may be a literature reference, another database or a computational analysis. The annotation must indicate what kind of evidence is found in the cited source to support the association between the gene product and the GO term. A simple controlled vocabulary is used to record evidence. Examples include:


任何一个标注必须被归因到一个源,这个源可以是一份参考文献、一个数据库或者一个计算分析。标注必须指明在引用的源中找到了哪些证据以支持基因产品与这一基因术语的关联。一个简单的受控词汇表可以用来记录这些证据。例子包括:


  • ISS means "inferred from sequence similarity [with <database:sequence_id>]"
  • IDA means "inferred from direct assay"
  • TAS means "traceable author statement"


  • ISS 意思是 “inferred from sequence similarity [with <database:sequence_id>](根据基因序列相似性推断[用<database:sequence_id>])”
  • IDA意思是 “inferred from direct assay(根据直接化验推断)”
  • TAS 意思是 “traceable author statement(可追踪的作者论述)”


The go:dbxref element represents the term in an external database, and go:association represents the gene associations of each term. go:association can have both go:association, which holds a go:dbxref to the evidence supporting the association, and a go:gene_product, which contains the gene symbol and go:dbxref. These elements illustrate that the GO XML syntax is not "pure" RDF/XML, since the nesting of other elements within these elements does not conform to the alternate node/predicate arc "stripes" described in Sections 2.1 and 2.2 of [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)].

go:dbxref元素表示在外部数据库的术语,而go:association表示每个术语的基因关联。go:association能同时含有go:association 和go:gene_product,前者包含了指向支持关联证据的go:dbxref,后者则包含了基因符号与go:dbxref。这些元素说明了基因本体的XML语法并不是“纯粹的”RDF/XML,因为这些元素中嵌套着其他元素这一事实并未遵循[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]的2.1节与2.2节中所描述的交替节点/谓词弧的条状嵌套语法。

The GO illustrates a number of interesting points. First, it shows that the value of using XML for information exchange can be enhanced by structuring that XML using RDF. This is particularly true for data that has an overall graph or network structure, rather than being a strict hierarchy. The GO is also another example in which data using RDF will not necessarily appear for direct use on the Web (although the files are Web-accessible). It is also another example of data which is, on the surface, described as "XML", but on closer examination uses RDF/XML facilities (albeit not "pure" RDF/XML). Finally, the GO illustrates the role RDF can play as a basis for representing ontologies. This role will be further enhanced once richer RDF-based languages for specifying ontologies, such as the DAML+OIL or OWL languages discussed in Section 5.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas), become more widely used. In fact, a Gene Ontology Next Generation (http://gong.man.ac.uk/) project is currently developing a representation of the GO ontologies in these richer languages.


基因本体说明了许多有趣的要点。首先,它表明使用RDF结构化XML能增强XML在信息交换中的作用。在数据结构整体上是一个图结构或者网络结构而不是一个严格层次结构的情况下,这一点将体现得更加明显。同时,基因本体作为一个例子表明了使用RDF的数据并不一定要以在Web上直接使用的形式出现(尽管所有的文件通过Web都是可访问的)。而基因本体也可作为一个例子,表明数据表面上使用“XML”进行描述,但是进一步观察可发现其使用的是RDF/XML(尽管不是“纯粹的”RDF/XML)。最后,基因本体阐明了RDF在本体本体中所扮演的基础性角色。在5.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)中讨论过DAML+OIL 与OWL等基于RDF的更加丰富的本体描述语言,一旦这些语言得到广泛使用,RDF的作用将会更进一步得到增强。实际上,一个下一代基因本体 (http://gong.man.ac.uk/)(Gene Ontology Next Generation)的项目已经开始使用这些更丰富的语言来展开基因本体表示的相关研究。

6.7 Describing Device Capabilities and User Preferences


6.7 描述设备性能和用户参数

In recent years a large number of new mobile devices for browsing the Web have appeared. Many of these devices have highly divergent capabilities including a wide range of input and output capabilities as well as different levels of language support. Mobile devices may also have widely differing network connectivity capabilities. Users of these new devices expect a usable presentation regardless of the device's capabilities or the current network characteristics. Likewise, users want their dynamically changing preferences (e.g. turn audio on/off) to be considered when content or an application is presented. The reality, however, is that device heterogeneity, and the lack of a standard way for users to convey their preferences to he server, may result in: content that cannot be stored on the device, content that cannot be displayed, or content that violates the desires of the user. Additionally, the resulting content may take too long to convey over the network to the client device.
近几年新出现了很多用于浏览Web的移动设备(mobile devices)。这些设备中有许多具有高度分散的能力,包括选择广泛的输入与输出能力,以及不同级别的语言支持。移动设备在网络连接能力方面也可能有着广泛的不同。这些新设备的用户期望有一个便于使用的外观显示,而不管其设备能力与当前的网络特性如何。同样地,用户希望在内容或应用呈现给他们时能够考虑到他们动态变化的偏好(比如是否开启声音)。然而在现实中,由于设备的异构性以及缺少一种让用户向服务器传达个人偏好的标准方式,这会造成:得到的内容可能不能存贮在设备里、不能显示出来或者违反了用户意愿。此外,最终的内容可能会在网络传输上花很多时间才到达客户端设备。

A solution for addressing these problems is for a client to encode its delivery context - the device's capabilities, the user's preferences, the network characteristics, etc. - in such a way that a server can use the context to customize content for the device and user (see [DIPRINC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-diprinc)] for a definition of delivery context). The W3C's Composite Capabilities/Preferences Profile (CC/PP) specification [CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)] helps to address this problem by defining a generic framework for describing a delivery context.
处理这些问题的一个办法是让客户端编码递送上下文(delivery context)(即设备能力、用户偏好、网络特性等等)使得服务端可以利用这个上下文为设备和用户进行内容的定制(关于递送上下文的定义,请参见[DIPRINC (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-diprinc)])。W3C的组合能力/偏好特征(Composite Capabilities/Preferences Profile, CC/PP)规范[CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)]通过定义一个描述递送上下文的通用框架促进了这个问题的解决。

The CC/PP framework defines a relatively simple structure - a two-level hierarchy of components and attribute/value pairs. A component may be used to capture a part of a delivery context (e.g. network characteristics, software supported by a device, or the hardware characteristics of a device). A component may contain one or more attributes. For example a component that encodes user preferences may contain an attribute to specify whether or not AudioOutput is desired.
CC/PP框架定义了一个相对简单的结构,即一个由组件和属性/值对构成的2层结构。一个组件(component)可被用来描述递送上下文的一部分(如网络特性、设备支持的软件或设备的硬件特性)。一个组件可以包含一个或多个属性(attributes)。例如,一个表示用户偏好的组件可能会需要包含一个指定是否打开音频输出的属性。

CC/PP defines its structure (the hierarchy described above) using RDF Schema (see [CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)] for details of the structure schema). A CC/PP vocabulary defines specific components and their attributes. [CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)], however, does not define such vocabularies. Instead, vocabularies are defined by other organizations or applications (as described below). [CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)] also does not define a protocol for transporting an instance of a CC/PP vocabulary.

CC/PP用RDF Schema定义上述层次结构(关于此结构的Schema详细信息,请参见[CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)])。一个CC/PP词汇表定义了一些特定的组件和各自的属性,但[CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)]不定义这些词汇。这些词汇是由其他机构或应用(如下所述)定义的。[CC/PP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-ccpp)]也没有定义传输CC/PP词汇实例的协议。

An instance of a CC/PP vocabulary is called a profile. CC/PP attributes are encoded as RDF properties in a profile. Example 44 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example44) shows a profile fragment of user preferences for a user that prefers an audio presentation:
CC/PP词汇表的一个实例称为一个特征文件(profile)。在特征文件中,CC/PP属性(attribute)用RDF属性(property)表示。例44 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example44)所显示的是一个特征文件的片断,它描述了用户的打开音频输出的偏好:

Example 44: A CC/PP Profile Fragment
例44:一个CC/PP特征文件的片断

 <ccpp:component>
<rdf:Description rdf:ID="UserPreferences">
<rdf:type rdf:resource="http://www.example.org/profiles/prefs/v1_0#UserPreferences"/>
<ex:AudioOutput>Yes</ex:AudioOutput>
<ex:Graphics>No</ex:Graphics>
<ex:Languages>
<rdf:Seq>
<rdf:li>en-cockney</rdf:li>
<rdf:li>en</rdf:li>
</rdf:Seq>
</ex:Languages>
</rdf:Description>
</ccpp:component>

There are several advantages to using RDF in this application. First, a profile encoded via CC/PP may include attributes that were defined in schemas created by different organizations. RDF is a natural fit for these profiles because no single organization is likely to create a super schema for the aggregated profile data. A second advantage of RDF is that it facilitates (by virtue of its graph-based data model) the insertion of arbitrary attributes (RDF properties) into a profile. This is particularly useful for profiles that include frequently changing data such as location information.
在这个应用中使用RDF有几个优势。第一,以CC/PP编码的特征文件包含的属性可能是在由不同组织创建的Schema中定义的。RDF很自然地适合表示这些特征文件,因为没有单个组织能够为聚集的特征数据创建一个超级Schema。 使用RDF的第二个好处是,它使得在特征文件中插入任意属性变得更为容易(由于RDF是基于图的数据模型),这对包含了频繁变化的数据(如地点信息)的特征文件尤为有用。

The Open Mobile Alliance has defined the User Agent Profile (UAProf) [UAPROF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uaprof)] - a CC/PP-based framework that includes a vocabulary for describing device capabilities, user agent capabilities, network characteristics, etc., as well as a protocol for transporting a profile. UAProf defines six components including: HardwarePlatform, SoftwarePlatform, NetworkCharacteristics and BrowserUA. It also defines several attributes for each of its components although a component's attributes are not fixed - they may be supplemented or overridden. Example 45 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example45) shows a fragment of UAProf's HardwarePlatform component:
开放移动联盟(Open Mobile Alliance)已经定义了用户代理特征文件(User Agent Profile, UAProf),[UAPROF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uaprof)]。它是一个基于CC/PP的框架,包含了一个用于描述设备能力、用户代理能力、网络特性等的词汇表,并定义了一个传输特征文件的协议。UAProf定义了六个组件,包括硬件平台(HardwarePlatform)软件平台(SoftwarePlatform)网络特性(NetworkCharacteristrics)用户浏览器(BrowserUA)等。它还为每个组件定义了一些属性,尽管组件的属性并是不固定的——可能被补充或撤销。20040210/#example45 例45 (http://www.w3.org/TR/2004/REC-rdf-primer-)显示了一个关于硬件平台组件的UAProf片断:

Example 45: A Fragment of UAProf's HardwarePlatform Component
例45:一个关于硬件平台组件的UAProf片断:

 <prf:component>
<rdf:Description rdf:ID="HardwarePlatform">
<rdf:type rdf:resource="http://www.openmobilealliance.org/profiles/UAPROF/ccppschema-20021113#HardwarePlatform"/>
<prf:ScreenSizeChar>15x6</prf:ScreenSizeChar>
<prf:BitsPerPixel>2</prf:BitsPerPixel>
<prf:ColorCapable>No</prf:ColorCapable>
<prf:BluetoothProfile>
<rdf:Bag>
<rdf:li>headset</rdf:li>
<rdf:li>dialup</rdf:li>
<rdf:li>lanaccess</rdf:li>
</rdf:Bag>
</prf:BluetoothProfile>
</rdf:Description>
</prf:component>

The UAProf protocol supports both static profiles and dynamic profiles. A static profile is accessed via a URI. This has several advantages: a client's request to a server only contains a URI rather a potentially verbose XML document (thus minimizing over the air traffic); the client does not have to store and/or create the profile; the implementation burden on a client is relatively light-weight. Dynamic profiles are created on-the-fly and consequently do not have an associated URI. They may consist of a profile fragment containing a difference from a static profile, but they may also contain unique data that is not included in the client's static profile. A request may contain any number of static profiles and dynamic profiles. However, the ordering of the profiles is important as later profiles override earlier profiles in the request. See [UAPROF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uaprof)] for more information about UAProf's protocol and its rules for resolving multiple profiles.
UAProf协议支持静态特征文件和动态特征文件。一个静态特征文件是通过URI访问的。这有几个优点:在客户发给服务器的请求中只含有一个URI,而不是一个冗长的XML文档(这将减少网络拥塞);客户不需要存储和/或创建这个特征文件;客户端的实现负担是相对轻量级的。动态特征文件是动态创建的,因此没有相关联的URI。它可以包含一个描述与静态特征文件差别的特征文件片断,也可以包含客户的静态特征文件中所没有的数据。一个请求可以包含任意数量的静态特征文件和动态特征文件。然后,特征文件的顺序是重要的,因为在请求中后面的特征文件会覆盖前面的。关于UAProf的协议和处理多个特征文件的规则,详见[UAPROF (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uaprof)]。

Several other communities (i.e. 3GPP's TS 26.234 [3GPP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-3gpp)] and the WAP Forum's Multimedia Messaging Service Client Transactions Specification [MMS-CTR (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-mms)]) have defined vocabularies based on CC/PP. As a result, a profile may take advantage of the distributed nature of RDF and include components defined from various vocabularies. Example 46 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example46) shows such a profile:
一些其他的团体(例如,3GPP's TS 26.234 [3GPP (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-3gpp)]和WAP论坛的多媒体消息服务客户端事务规范(Multimedia Messaging Service Client Transactions Specification [MMS-CTR (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-mms)]))已经定义了一些基于CC/PP的词汇表。因此,一个特征文件可以利用RDF的分布式特点,包含来自不同词汇表定义的组件。http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example46 例46]显示了一个这样的特征文件:

Example 46: A Profile Using Several Vocabularies
例46:一个用到多个词汇表的特征文件

 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:prf="http://www.wapforum.org/profiles/UAPROF/ccppschema-20010330#"
xmlns:mms="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#"
xmlns:pss="http://www.3gpp.org/profiles/PSS/ccppschema-YYYYMMDD#">
  <rdf:Description rdf:ID="SomeDevice">
<prf:component>
<rdf:Description rdf:ID="Streaming">
<rdf:type rdf:resource="http://www.3gpp.org/profiles/PSS/ccppschema-PSS5#Streaming"/>
<pss:AudioChannels>Stereo</pss:AudioChannels>
<pss:VideoPreDecoderBufferSize>30720</pss:VideoPreDecoderBufferSize>
<pss:VideoInitialPostDecoderBufferingPeriod>0</pss:VideoInitialPostDecoderBufferingPeriod>
<pss:VideoDecodingByteRate>16000</pss:VideoDecodingByteRate>
</rdf:Description>
</prf:component>
<prf:component>
<rdf:Description rdf:ID="MmsCharacteristics">
<rdf:type rdf:resource="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#Streaming"/>
<mms:MmsMaxMessageSize>2048</mms:MmsMaxMessageSize>
<mms:MmsMaxImageResolution>80x60</mms:MmsMaxImageResolution>
<mms:MmsVersion>2.0</mms:MmsVersion>
</rdf:Description>
</prf:component>
<prf:component>
<rdf:Description rdf:ID="PushCharacteristics">
<rdf:type rdf:resource="http://www.openmobilealliance.org/profiles/UAPROF/ccppschema-20010330#PushCharacteristics"/>
<prf:Push-MsgSize>1024</prf:Push-MsgSize>
<prf:Push-MaxPushReq>5</prf:Push-MaxPushReq>
<prf:Push-Accept>
<rdf:Bag>
<rdf:li>text/html</rdf:li>
<rdf:li>text/plain</rdf:li>
<rdf:li>image/gif</rdf:li>
</rdf:Bag>
</prf:Push-Accept>
</rdf:Description>
</prf:component>
</rdf:Description>
</rdf:RDF>

The definition of a delivery context and the data within a context will continually evolve. Consequently, RDF's inherent extensibility, and thus support for dynamically changing vocabularies, make RDF a good framework for encoding a delivery context.
关于递送上下文以及其中数据的定义将继续发展。从而,RDF天生的可扩展性以及因此而对动态变化的词汇表的支持使得RDF成为一个表达递送上下文的理想框架。

7. Other Parts of the RDF Specification

7. RDF规范的其它部分


Section 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#intro) indicated that the RDF Specification consists of a number of documents (in addition to this Primer):
第1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#intro) 指出了RDF 规范包含了一系列的文档(除了这个入门外):




The Primer has already discussed the subjects of several of these documents, basic RDF concepts (in Section 2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#statements)), the RDF/XML syntax (in Section 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml)) and RDF Schema (in Section 5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)). This section briefly describes the remaining documents (even though there have already been numerous references to [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] as well), in order to explain their role in the complete specification of RDF.
这个入门文档已经讨论了这些文档的一些主题, 如基本的RDF概念(在第 2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#statements)), RDF/XML 语法 (在 第 3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml)) 和RDF Schema (在 第 5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfschema)). 这节简要地讲述一下剩下的文档(尽管已经有很多对 [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]的引用), 目的是解释他们在完整的RDF规范中的角色.

7.1 RDF Semantics

7.1 RDF语义


As discussed in the preceding sections, RDF is intended to be used to express statements about resources in the form of a graph, using specific vocabularies (names of resources, properties, classes, etc.). RDF is also intended to be the foundation for more advanced languages, such as those discussed in Section 5.5 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas). In order to serve these purposes, the "meaning" of an RDF graph must be defined in a very precise manner.

就像前面章节讨论的那样, RDF是用以表示关于资源的陈述的, 它的表示形式是图并使用了一些特定的词汇(资源,属性,类的名字等等). RDF还是用以作为高级语言的基础, 如在 5.5节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#richerschemas)中讨论的一些语言. 为此, RDF图的含义必须得到精确的定义.
Exactly what constitutes the "meaning" of an RDF graph in a very general sense may depend on many factors, including conventions within a user community to interpret user-defined RDF classes and properties in specific ways, comments in natural language, or links to other content-bearing documents. As noted briefly in Section 2.2 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfmodel), much of the meaning conveyed in these forms will not be directly accessible to machine processing, although this meaning may be used by human interpreters of the RDF information, or by programmers writing software to perform various kinds of processing on that RDF information. However, RDF statements also have a formal meaning which determines, with mathematical precision, the conclusions (or entailments) that machines can draw from a given RDF graph. The RDF Semantics (http://www.w3.org/TR/rdf-mt/) [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] document defines this formal meaning, using a technique called model theory for specifying the semantics of a formal language. [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] also defines the semantic extensions to the RDF language represented by RDF Schema, and by individual datatypes. In other words, the RDF model theory provides the formal underpinnings for all RDF concepts. Based on the semantics defined in the model theory, it is simple to translate an RDF graph into a logical expression with essentially the same meaning.

一般来说,到底什么组成了RDF图的"含义"依赖于很多因素, 包括在用户团体中解释用户以特定方式定义的类和属性的一些惯例, 自然语言书写的注释, 对其他具有内容的信息的链接. 如2.2节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfmodel)所述, 大部分以这种形式表达的含义不能直接被机器处理, 尽管这些含义可能被人们解释RDF信息时用到,或被程序员在编写软件以对RDF信息作出各种处理时用到. 然而, RDF陈述也具有一种"形式化"的语义, 它决定了机器用一种数学的精确方式, 从一个给定的RDF图中可以得到的结论. 文档 RDF 语义 (http://www.w3.org/TR/rdf-mt/) [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] 用一个规范说明形式语言语义的技术, 称为模型论, 来定义这个形式化语义. [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)] 也定义了RDF语言的扩展RDF Schema和单独的数据类型的语义扩展. 换句话说, RDF模型论语义提供了所有RDF概念的理论基础. 基于在模型论中定义的语义, RDF图可以容易地翻译到具有相同含义的逻辑表达式上.



7.2 Test Cases

7.2 测试用例


The RDF Test Cases (http://www.w3.org/TR/rdf-testcases/) [RDF-TESTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-tests)] supplement the textual RDF specifications with test cases (examples) corresponding to particular technical issues addressed by the RDF Core Working Group. To help describe these examples, the Test Cases document introduces a notation called N-Triples (http://www.w3.org/TR/rdf-testcases/#ntriples), which provides the basis for the triples notation used throughout this Primer. The test cases are published in machine-readable form at Web locations referenced by the Test Cases document, so developers can use these as the basis for automated testing of RDF software.

文档 RDF 测试用例 (http://www.w3.org/TR/rdf-testcases/) [RDF-TESTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-tests)] 为用文字描述的RDF规范补充了测试用例(例子), 这些用例对应于RDF核心工作组解决的一些特定的技术问题. 为了方便描述这些用例, 那个测试用例文档引入了一个称为 N-Triples (http://www.w3.org/TR/rdf-testcases/#ntriples)的表示法, 这也是本入门文档中所用的三元组表示法的基础. 这些测试用例以机器可读的方式发布在这个测试用例文档所在的Web站点, 因此, 开发人员可以把这些作为自动化测试RDF软件的基础.
The test cases are divided into a number of categories:
这些测试用例被划分为以下几类:

  • Positive and Negative Parser Tests: These test whether RDF/XML parsers produce a correct N-Triples output graph from legal RDF/XML input documents, or correctly report errors if the input documents are not legal RDF/XML.
  • 肯定的和否定的语法分析器(Parser)测试: 他们测试RDF/XML Parser是否能够为合法的RDF/XML 输入文档产生正确的N-Triples输出图, 或为不合法的RDF/XML.输入文档正确地报告错误.
  • Positive and Negative Entailment Tests: These test whether proper entailments (conclusions) are or are not drawn from sets of specified RDF statements.
  • 肯定的和否定的蕴涵(Entailment)测试: 他们测试是否能够从指定的RDF陈述集合中得到正确的或不正确的结论.
  • Datatype-aware Entailment Tests: These are positive or negative entailment tests that involve the use of datatypes, and hence require additional support for the specific datatypes involved in the tests.
  • 带有数据类型的蕴涵测试: 他们是用到了数据类型的肯定的或否定的蕴涵测试, 因此需要对测试中用到的数据类型的支持.
  • Miscellaneous Tests: These are tests that do not fall into one of the other categories.
  • 其他测试: 他们是不在上述类别中的测试.


The test cases are not a complete specification of RDF, and are not intended to take precedence over the other specification documents. However, they are intended to illustrate the intent of the RDF Core Working Group with respect to the design of RDF, and developers may find these test cases helpful should the wording of the specifications be unclear on any point of detail.

这些测试用例不是对RDF的完全规格说明,也没有优先于其他规范文档的意思。相反,它们是用来阐明RDF核心工作组(RDF Core Working Group)在RDF的设计方面的意图。开发人员也许会觉得这些测试用例很有帮助,如果那些规范在某些细节的措辞上不够清晰的话



8. References

8. 参考文献



8.1 Normative References

8.1 规范性文献



[RDF-CONCEPTS]
Resource Description Framework (RDF): Concepts and Abstract Syntax (http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/), Klyne G., Carroll J. (Editors), W3C Recommendation, 10 February 2004. This version (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/) is http://www.w3.org/TR/2004/REC-rdf-primer-20040210/. The latest version (http://www.w3.org/TR/rdf-concepts/) is http://www.w3.org/TR/rdf-concepts/.
[RDF-MIME-TYPE]
MIME Media Types (http://www.iana.org/assignments/media-types/), The Internet Assigned Numbers Authority (IANA). This document is http://www.iana.org/assignments/media-types/ . The registration for application/rdf+xml is archived at http://www.w3.org/2001/sw/RDFCore/mediatype-registration .
[RDF-MS]
Resource Description Framework (RDF) Model and Syntax Specification (http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/), Lassila O., Swick R. (Editors), World Wide Web Consortium, 22 February 1999. This version (http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/) is http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/. The latest version (http://www.w3.org/TR/REC-rdf-syntax/) is http://www.w3.org/TR/REC-rdf-syntax/.
[RDF-SEMANTICS]
RDF Semantics (http://www.w3.org/TR/2004/REC-rdf-mt-20040210/), Hayes P. (Editor), W3C Recommendation, 10 February 2004. This version (http://www.w3.org/TR/2004/REC-rdf-mt-20040210/) is http://www.w3.org/TR/2004/REC-rdf-mt-20040210/. The latest version (http://www.w3.org/TR/rdf-mt/) is http://www.w3.org/TR/rdf-mt/.
[RDF-SYNTAX]
RDF/XML Syntax Specification (Revised) (http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/), Beckett D. (Editor), W3C Recommendation, 10 February 2004. This version (http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/) http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/. The latest version (http://www.w3.org/TR/rdf-syntax-grammar/) is http://www.w3.org/TR/rdf-syntax-grammar/.
[RDF-TESTS]
RDF Test Cases (http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/), Grant J., Beckett D. (Editors), W3C Recommendation, 10 February 2004. This version (http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/) is http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/. The latest version (http://www.w3.org/TR/rdf-testcases/) is http://www.w3.org/TR/rdf-testcases/.
[RDF-VOCABULARY]
RDF Vocabulary Description Language 1.0: RDF Schema (http://www.w3.org/TR/2004/REC-rdf-schema-20040210/), Brickley D., Guha R.V. (Editors), W3C Recommendation, 10 February 2004. This version (http://www.w3.org/TR/2004/REC-rdf-schema-20040210/) is http://www.w3.org/TR/2004/REC-rdf-schema-20040210/. The latest version (http://www.w3.org/TR/rdf-schema/) is http://www.w3.org/TR/rdf-schema/.
[UNICODE]
The Unicode Standard, Version 3, The Unicode Consortium, Addison-Wesley, 2000. ISBN 0-201-61633-5, as updated from time to time by the publication of new versions. (See http://www.unicode.org/unicode/standard/versions/ (http://www.unicode.org/unicode/standard/versions/) for the latest version and additional information on versions of the standard and of the Unicode Character Database).
[URIS]
RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax (http://www.isi.edu/in-notes/rfc2396.txt), Berners-Lee T., Fielding R., Masinter L., IETF, August 1998, http://www.isi.edu/in-notes/rfc2396.txt.
[XML]
Extensible Markup Language (XML) 1.0, Second Edition (http://www.w3.org/TR/2000/REC-xml-20001006), Bray T., Paoli J., Sperberg-McQueen C.M., Maler E. (Editors), World Wide Web Consortium, 6 October 2000. This version (http://www.w3.org/TR/2000/REC-xml-20001006) is http://www.w3.org/TR/2000/REC-xml-20001006. The latest version (http://www.w3.org/TR/REC-xml) is http://www.w3.org/TR/REC-xml.
[XML-BASE]
XML Base (http://www.w3.org/TR/2001/REC-xmlbase-20010627/), Marsh J. (Editor), World Wide Web Consortium, 27 June 2001. This version (http://www.w3.org/TR/2001/REC-xmlbase-20010627/) is http://www.w3.org/TR/2001/REC-xmlbase-20010627/. The latest version (http://www.w3.org/TR/xmlbase/) is http://www.w3.org/TR/xmlbase/.
[XML-NS]
Namespaces in XML (http://www.w3.org/TR/1999/REC-xml-names-19990114/), Bray T., Hollander D., Layman A. (Editors), World Wide Web Consortium, 14 January 1999. This version (http://www.w3.org/TR/1999/REC-xml-names-19990114/) is http://www.w3.org/TR/1999/REC-xml-names-19990114/. The latest version (http://www.w3.org/TR/REC-xml-names/) is http://www.w3.org/TR/REC-xml-names/.
[XML-XC14N]
Exclusive XML Canonicalization Version 1.0 (http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/), Boyer J., Eastlake D.E. 3rd, Reagle J. (Authors/Editors), World Wide Web Consortium, 18 July 2002. This version (http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/) is http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/. The latest version (http://www.w3.org/TR/xml-exc-c14n/) is http://www.w3.org/TR/xml-exc-c14n/.


8.2 Informational References

8.2 参考性文献



[3GPP]
3GPP TS 26.234. (http://www.3gpp.org/specs/specs.htm) 3rd Generation Partnership Project; Technical Specification Group Services and System Aspects; Transparent end-to-end packet switched streaming service; Protocols and codecs V5.2.0 (2002-09). This document (http://www.3gpp.org/specs/specs.htm) is available at http://www.3gpp.org/specs/specs.htm via directory ftp://ftp.3gpp.org/specs/2002-09/Rel-5/26_series/.
[ADDRESS-SCHEMES]
Addressing Schemes (http://www.w3.org/Addressing/schemes.html), Connolly D., 2001. This document (http://www.w3.org/Addressing/schemes.html) is http://www.w3.org/Addressing/schemes.html.
[BATES96]
Indexing and Access for Digital Libraries and the Internet: Human, Database, and Domain Factors (http://is.gseis.ucla.edu/research/mjbates.html), Bates M.J., 1996. This document (http://is.gseis.ucla.edu/research/mjbates.html) is http://is.gseis.ucla.edu/research/mjbates.html.
[BERNERS-LEE98]
What the Semantic Web can represent (http://www.w3.org/DesignIssues/RDFnot.html), Berners-Lee T., 1998. This document (http://www.w3.org/DesignIssues/RDFnot.html) is http://www.w3.org/DesignIssues/RDFnot.html.
[CC/PP]
Composite Capability/Preference Profiles (CC/PP): Structure and Vocabularies (http://www.w3.org/TR/2004/REC-CCPP-struct-vocab-20040115/), Klyne G., Reynolds F., Woodrow C., Ohto H., Hjelm J., Butler M., Tran, L., W3C Recommendation, 15 January 2004. This version (http://www.w3.org/TR/2004/REC-CCPP-struct-vocab-20040115/) is http://www.w3.org/TR/2004/REC-CCPP-struct-vocab-20040115/. The latest version (http://www.w3.org/TR/CCPP-struct-vocab/) is http://www.w3.org/TR/CCPP-struct-vocab/.
[CG]
Conceptual Graphs, Sowa J., ISO working document ISO/JTC1/SC32/WG2 N 000, 2 April 2001 (work in progress). Available at http://users.bestweb.net/~sowa/cg/cgstand.htm (http://users.bestweb.net/~sowa/cg/cgstand.htm).
[CHARMOD]
Character Model for the World Wide Web 1.0 (http://www.w3.org/TR/2002/WD-charmod-20020220/), Dürst M., Yergeau F., Ishida R., Wolf M., Freytag A., Texin T. (Editors), World Wide Web Consortium, 20 February 2002 (work in progress). This version (http://www.w3.org/TR/2002/WD-charmod-20020220/) is http://www.w3.org/TR/2002/WD-charmod-20020220/. The latest version (http://www.w3.org/TR/charmod/) is http://www.w3.org/TR/charmod/.
[CIM]
Common Information Model (CIM): CIM 10 Version, EPRI, Palo Alto, CA: 2001, 1001976. This document (http://www.epri.com/attachments/286161_1001976(1).pdf) is available at http://www.epri.com/attachments/286161_1001976(1).pdf (267pp.).
[COWAN]
Metadata, Reuters Health Information, and Cross-Media Publishing (http://seminars.seyboldreports.com/2002_new_york/files/presentations/014/cowan_john.ppt) , Cowan J., 2002. Presentation at Seybold New York 2002 Enterprise Publishing Conference. This document (http://seminars.seyboldreports.com/2002_new_york/files/presentations/014/cowan_john.ppt) is http://seminars.seyboldreports.com/seminars/2002_new_york/presentations/014/cowan_john.ppt. An accompanying transcript (http://seminars.seyboldreports.com/2002_new_york/files/transcripts/doc/transcript_EP7.doc) is http://seminars.seyboldreports.com/2002_new_york/files/transcripts/doc/transcript_EP7.doc
[DAF]
Utility Management System (UMS) Data Access Facility (http://www.omg.org/technology/documents/formal/UMS_Data_Access_Facility.htm), version 2.0, Object Management Group, November 2002. This document (http://www.omg.org/technology/documents/formal/UMS_Data_Access_Facility.htm) is available at http://www.omg.org/technology/documents/formal/UMS_Data_Access_Facility.htm.
[DAML+OIL]
DAML+OIL (March 2001) Reference Description (http://www.w3.org/TR/daml+oil-reference), Connolly D., van Harmelen F., Horrocks I., McGuinness D.L., Patel-Schneider P.F., Stein L.A., World Wide Web Consortium, 18 December 2001. This document (http://www.w3.org/TR/daml+oil-reference) is http://www.w3.org/TR/daml+oil-reference.
[DC]
Dublin Core Metadata Element Set, Version 1.1: Reference Description (http://dublincore.org/documents/2003/06/02/dces/), 02 June 2003. This version (http://dublincore.org/documents/2003/06/02/dces/) is http://dublincore.org/documents/2003/06/02/dces/. The latest version (http://dublincore.org/documents/dces/) is http://dublincore.org/documents/dces/.
[DIPRINC]
Device Independence Principles. (http://www.w3.org/TR/di-princ/) Gimson, R., Finkelstein, S., Maes, S., Suryanarayana, L., World Wide Web Consortium, 18 September 2001 (work in progress). This version (http://www.w3.org/TR/2001/WD-di-princ-20010918/) is http://www.w3.org/TR/2001/WD-di-princ-20010918. The latest version (http://www.w3.org/TR/di-princ/) is http://www.w3.org/TR/di-princ/.
[DWZ01]
XML for CIM Model Exchange (http://www.langdale.com.au/PICA/) , deVos A., Widergreen S.E., Zhu J., Proc. IEEE Conference on Power Industry Computer Systems, Sydney, Australia, 2001. This document (http://www.langdale.com.au/PICA/) is http://www.langdale.com.au/PICA/.
[GO]
Gene Ontology: tool for the unification of biology (http://www.geneontology.org/GO_nature_genetics_2000.pdf), The Gene Ontology Consortium, Nature Genetics, Vol. 25: 25-29, May 2000. Available at http://www.geneontology.org/GO_nature_genetics_2000.pdf (http://www.geneontology.org/GO_nature_genetics_2000.pdf)
[GRAY]
Logic, Algebra and Databases, Gray P., Ellis Horwood Ltd., 1984. ISBN 0-85312-709-3, 0-85312-803-0, 0-470-20103-7, 0-470-20259-9.
[HAYES]
In Defense of Logic, Hayes P., Proceedings from the International Joint Conference on Artificial Intelligence, 1975, San Francisco. Morgan Kaufmann Inc., 1977. Also in Computation and Intelligence: Collected Readings, Luger G. (ed), AAAI press/MIT press, 1995. ISBN 0-262-62101-0.
[KIF]
Knowledge Interchange Format, Genesereth M., draft proposed American National Standard NCITS.T2/98-004. Available at http://logic.stanford.edu/kif/dpans.html (http://logic.stanford.edu/kif/dpans.html).
[LBASE]
LBase: Semantics for Languages of the Semantic Web (http://www.w3.org/TR/2003/NOTE-lbase-20031010/), Guha R. V., Hayes P., W3C Note, 10 October 2003. This version (http://www.w3.org/TR/2003/NOTE-lbase-20031010/) is http://www.w3.org/TR/2003/NOTE-lbase-20031010/. The latest version (http://www.w3.org/TR/lbase/) is http://www.w3.org/TR/lbase/.
[LUGER]
Artificial Intelligence: Structures and Strategies for Complex Problem Solving (3rd ed.), Luger G., Stubblefield W., Addison Wesley Longman, 1998. ISBN 0-805-31196-3.
[MATHML]
Mathematical Markup Language (MathML) Version 2.0 (http://www.w3.org/TR/2001/REC-MathML2-20010221/), Carlisle D., Ion P., Miner R., Poppelier N. (Editors); Ausbrooks R., Buswell S., Dalmas S., Devitt S., Diaz A., Hunter R., Smith B., Soiffer N., Sutor R., Watt S. (Principal Authors), World Wide Web Consortium, 21 February 2001. This version (http://www.w3.org/TR/2001/REC-MathML2-20010221/) is http://www.w3.org/TR/2001/REC-MathML2-20010221/. The latest version (http://www.w3.org/TR/MathML2/) is http://www.w3.org/TR/MathML2/.
[MMS-CTR]
Multimedia Messaging Service Client Transactions Specification. (http://www.openmobilealliance.org/) WAP-206-MMSCTR-20020115-a. This document is available at http://www.openmobilealliance.org/.
[NAMEADDRESS]
Naming and Addressing: URIs, URLs, ... (http://www.w3.org/Addressing/), Connolly D., 2002. This document (http://www.w3.org/Addressing/) is http://www.w3.org/Addressing/.
[OWL]
OWL Web Ontology Language Reference (http://www.w3.org/TR/2004/REC-owl-ref-20040210/), Dean M., Schreiber G (Editors); van Harmelen F., Hendler J., Horrocks I., McGuinness D.L., Patel-Schneider P.F., Stein L.A. (Authors), W3C Recommendation, 10 February 2004. The latest version (http://www.w3.org/TR/owl-ref/) is http://www.w3.org/TR/owl-ref/.
[PRISM]
PRISM: Publishing Requirements for Industry Standard Metadata (http://www.prismstandard.org/), Version 1.1, 19 February 2002. The latest version (http://www.prismstandard.org/) of the PRISM specification is available at http://www.prismstandard.org/.
[RDFISSUE]
RDF Issue Tracking (http://www.w3.org/2000/03/rdf-tracking/), McBride B., 2002. This document (http://www.w3.org/2000/03/rdf-tracking/) is http://www.w3.org/2000/03/rdf-tracking/.
[RDF-S]
Resource Description Framework (RDF) Schema Specification 1.0 (http://www.w3.org/TR/2000/CR-rdf-schema-20000327/) , Brickley D., Guha, R.V. (Editors), World Wide Web Consortium. 27 March 2000. This version (http://www.w3.org/TR/2000/CR-rdf-schema-20000327/) is http://www.w3.org/TR/2000/CR-rdf-schema-20000327/.
[RSS]
RDF Site Summary (RSS) 1.0 (http://purl.org/rss/1.0/spec), Beged-Dov G., Brickley D., Dornfest R., Davis I., Dodds L., Eisenzopf J., Galbraith D., Guha R.V., MacLeod K., Miller E., Swartz A., van der Vlist E., 2000. This document (http://purl.org/rss/1.0/spec) is http://purl.org/rss/1.0/spec.
[RUBY]
Ruby Annotation (http://www.w3.org/TR/2001/REC-ruby-20010531/), Sawicki M., Suignard M., Ishikawa M., Dürst M., Texin T. (Editors), World Wide Web Consortium, 31 May 2001. This version (http://www.w3.org/TR/2001/REC-ruby-20010531/) is http://www.w3.org/TR/2001/REC-ruby-20010531/. The latest version (http://www.w3.org/TR/ruby/) is http://www.w3.org/TR/ruby/.
[SOWA]
Knowledge Representation: Logical, Philosophical and Computational Foundations, Sowa J., Brookes/Cole, 2000. ISBN 0-534-94965-7.
[SVG]
Scalable Vector Graphics (SVG) 1.1 Specification (http://www.w3.org/TR/2003/REC-SVG11-20030114/), Ferraiolo J., Fujisawa J., Jackson D. (Editors), World Wide Web Consortium, 14 January 2003. This version (http://www.w3.org/TR/2003/REC-SVG11-20030114/) is http://www.w3.org/TR/2003/REC-SVG11-20030114/. The latest version (http://www.w3.org/TR/SVG11/) is http://www.w3.org/TR/SVG11/.
[UAPROF]
User Agent Profile. (http://www.openmobilealliance.org/) OMA-WAP-UAProf-v1_1. This document is available at http://www.openmobilealliance.org/.
[WEBDATA]
Web Architecture: Describing and Exchanging Data (http://www.w3.org/1999/04/WebData), Berners-Lee T., Connolly D., Swick R., World Wide Web Consortium, 7 June 1999. This document (http://www.w3.org/1999/04/WebData) is http://www.w3.org/1999/04/WebData.
[XLINK]
XML Linking Language (XLink) Version 1.0 (http://www.w3.org/TR/2001/REC-xlink-20010627/), DeRose S., Maler E., Orchard D. (Editors), World Wide Web Consortium, 27 June 2001. This version (http://www.w3.org/TR/2001/REC-xlink-20010627/) is http://www.w3.org/TR/2001/REC-xlink-20010627/. The latest version (http://www.w3.org/TR/xlink/) is http://www.w3.org/TR/xlink/.
[XML-SCHEMA2]
XML Schema Part 2: Datatypes (http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/), Biron P., Malhotra A. (Editors), World Wide Web Consortium. 2 May 2001. This version (http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/) is http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/. The latest version (http://www.w3.org/TR/xmlschema-2/) is http://www.w3.org/TR/xmlschema-2/.
[XPACKAGE]
XML Package (XPackage) 1.0 (http://www.xpackage.org/specification/xpackage-draft-20030306.html) , Wilson G., Editor's Working Draft, 6 March 2003. This version (http://www.xpackage.org/specification/xpackage-draft-20030306.html) is http://www.xpackage.org/specification/xpackage-draft-20030306.html. The latest version (http://www.xpackage.org/specification/) is http://www.xpackage.org/specification/.


9. 致谢


This document has benefited from inputs from many members of the RDF Core Working Group (http://www.w3.org/2001/sw/RDFCore/). Specific thanks are due to Art Barstow, Dave Beckett, Dan Brickley, Ron Daniel, Ben Hammersley, Martyn Horner, Graham Klyne, Sean Palmer, Patrick Stickler, Aaron Swartz, Ralph Swick, and Garret Wilson who, together with the many people who commented on earlier versions of the Primer, provided valuable contributions to this document.

本文档得益于RDF 核心工作组 (http://www.w3.org/2001/sw/RDFCore/)中诸多成员的共同努力。尤其感谢Art Barstow, Dave Beckett, Dan Brickley, Ron Daniel, Ben Hammersley, Martyn Horner, Graham Klyne, Sean Palmer, Patrick Stickler, Aaron Swartz, Ralph Swick 以及 Garret Wilson,正是他们以及其它许多研究人员在对上一个版本的RDF入门提出了许多宝贵意见之后,才得以产生本文。

In addition, this document contains a significant contribution from Pat Hayes, Sergey Melnik, and Patrick Stickler, who led the development of the RDF datatype facilities described in the RDF family of specifications.

另外,Pat Hayes, Sergey Melnik 和 Patrick Stickler也对本文做出了重要贡献,他们领导开发了RDF规范系列中所描述的RDF数据类型工具。

Frank Manola also thanks The MITRE Corporation (http://www.mitre.org/), Frank's employer during most of the preparation of this document, for its support of his RDF Core Working Group activities under a MITRE Sponsored Research grant.

Frank Manola 还要感谢, MITRE 公司 (http://www.mitre.org/),Frank的主管, 在其完成本文的绝大部分时间里所给予的大力支持,RDF核心工作组的活动得到了该公司资助的研究授权。






Appendix A: More on Uniform Resource Identifiers (URIs)

附录A:更多关于统一资源标识符(Uniform Resource Identifiers,URIs)的更多信息


Note: This section is intended to provide a brief introduction to URIs. The definitive specification of URIs is RFC 2396 (http://www.isi.edu/in-notes/rfc2396.txt) [URIS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uri)], which should be consulted for further details. Additional discussion of URIs can also be found in Naming and Addressing: URIs, URLs, ... (http://www.w3.org/Addressing/) [NAMEADDRESS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-nameaddress)].
注意:附录A旨在提供一个关于URIs的简要介绍。URIs的权威规范是RFC 2396 (http://www.isi.edu/in-notes/rfc2396.txt)[URIS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uri)],如需了解更多信息请参阅该文档。关于URIs的补充论述可以在下列地址处获得:Naming and Addressing: URIs, URLs, ... (http://www.w3.org/Addressing/) [NAMEADDRESS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-nameaddress)]。

As discussed in Section 2.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts), the Web provides a general form of identifier, called the Uniform Resource Identifier (http://www.isi.edu/in-notes/rfc2396.txt) (URI), for identifying (naming) resources on the Web. Unlike URLs, URIs are not limited to identifying things that have network locations, or use other computer access mechanisms. A number of different URI schemes (URI forms) have been already been developed, and are being used, for various purposes. Examples include:
2.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts)所述,Web提供了一种通用形式的标识符——统一资源标识符(Uniform Resource Identifier) (http://www.isi.edu/in-notes/rfc2396.txt)(URI), 用于标识(命名)Web上的资源。与URLs不同,URIs并不局限于标识有网络位置或使用其它计算机访问机制的资源。已有许多不同的URI方案(URI scheme)被开发并正在用于不同用途,比如:

  • http: (超文本传输协议(Hypertext Transfer Protocol[译注:简称HTTP]),用于标识网页)
  • mailto: (email地址),例如mailto:em@w3.org
  • ftp: (文件传输协议(File Transfer Protocol[译注//简称FTP]))
  • urn: (统一资源名称(Uniform Resource Names[译注:简称URN]),用于标识永久与位置无关的资源),例如urn:isbn:0-520-02356-0(标识一本书)

A list of existing URI schemes can be found in Addressing Schemes (http://www.w3.org/Addressing/schemes.html) [ADDRESS-SCHEMES (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-address-schemes)], and it is a good idea to consider adapting one of the existing schemes for any specialized identification purposes, rather than trying to invent a new one.
现有URI方案(URI schemes)的列表可在Addressing Schemes (http://www.w3.org/Addressing/schemes.html) [ADDRESS-SCHEMES (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-address-schemes)]获得。一个不错的想法是考虑在各种专门的标识用途中利用现有URI方案,而不是试图创造一种新的方案。

No one person or organization controls who makes URIs or how they can be used. While some URI schemes, such as URL's http:, depend on centralized systems such as DNS, other schemes, such as freenet:, are completely decentralized. This means that, as with any other kind of name, no one needs special authority or permission to create a URI for something. Also, anyone can create URIs to refer to things they do not own, just as in ordinary language anyone can use whatever name they like for things they do not own.
URI由谁创建和如何使用并不是由某个人或组织控制的。然而某些URI方案(比如URL的http:) 要依赖于集中式系统(比如DNS),而其它一些方案(比如freenet:)则是完全分散式的。这意味着,如其它类型的名称一样,人们不需要特别的权威或权限来为事物创建URI。而且,任何人都可以创建URIs来引用不为他们所拥有的事物,就像在日常语言中任何人都可以用任何他们乐意的名称来称呼不为他们所有拥的事物一样。

As also noted in Section 2.1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts), RDF uses URI references [URIS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uri)] to name subjects, predicates, and objects in RDF statements. A URI reference (or URIref) is a URI, together with an optional fragment identifier at the end. For example, the URI reference http://www.example.org/index.html#section2 consists of the URI http://www.example.org/index.html and (separated by the "#" character) the fragment identifier Section2. RDF URIrefs can contain Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] characters (see [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]), allowing many languages to be reflected in URIrefs.
2.1节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#basicconcepts)所谈到的,RDF使用URI引用(URI references)[URIS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-uri)]来命名RDF陈述中的主体、谓词和客体。一个URI引用(或简称URIref)是一个可以在末尾附加(也可以不附加)片段标识符(fragment identifier)[译注//片段标识符这一术语有历史渊源,它的实际作用也许并不是标识某个片段。]的URI。举例来说,URI引用 http://www.example.org/index.html#section2 包含了URI http://www.example.org/index.html 和(以“#”字符分隔的)片段标识符Section2。RDF URIrefs中可以包含Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)]字符(参见[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]),以允许在URIrefs中使用多种语言。

URIrefs may be either absolute or relative. An absolute URIref refers to a resource independently of the context in which the URIref appears, e.g., the URIref http://www.example.org/index.html. A relative URIref is a shorthand form of an absolute URIref, where some prefix of the URIref is missing, and information from the context in which the URIref appears is required to fill in the missing information. For example, the relative URIref otherpage.html, when appearing in a resource http://www.example.org/index.html, would be filled out to the absolute URIref http://www.example.org/otherpage.html. A URIref without a URI part is considered a reference to the current document (the document in which it appears). So, an empty URIref within a document is considered equivalent to the URIref of the document itself. A URIref consisting of just a fragment identifier is considered equivalent to the URIref of the document in which it appears, with the fragment identifier appended to it. For example, within http://www.example.org/index.html, if #section2 appeared as a URIref, it would be considered equivalent to the absolute URIref http://www.example.org/index.html#section2.
URIrefs可以是绝对的(absolute)相对的(relative)。一个绝对(absolute)URIref是对一个与URIref所在上下文无关的资源的引用,例如URIref http://www.example.org/index.html。相对(relative)URIref是绝对URIref的一种简略记法,其中略去了绝对URIref中的部分前缀。被略去的部分需要通过相对URIref所在上下文中的信息获得。例如,当相对URIref otherpage.html 出现在资源 http://www.example.org/index.html 中时,它所对应的绝对URIref为 http://www.example.org/otherpage.html。 一个没有URI部分的URIref[译注//即一个不含任何字符的URIref(空URIref)或一个只包含片段标识符的URIref]被认为是对当前文档的引用(即它所在的文档)。于是,文档里的空URIref[译注//即不包含任何字符的URIref]等价于该文档自身的URIref;而一个只包含片段标识符(fragment identifier)的URIref等价于它所在文档的URIref加上该片段标识符。例如,在 http://www.example.org/index.html 里,如果 #section2 作为一个URIref出现的话,它将被看作等价于绝对 URIref http://www.example.org/index.html#section2.

[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)] notes that RDF graphs (the abstract models) do not use relative URIrefs, i.e., the subjects, predicates, and objects (and datatypes in typed literals) in RDF statements must always be identified independently of any context. However, a specific concrete RDF syntax, such as RDF/XML, may allow relative URIrefs to be used as a shorthand for absolute URIrefs in certain situations. RDF/XML does permit such use of relative URIrefs, and some of the RDF/XML examples in this Primer illustrate such uses. [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)] should be consulted for further details.
[RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]中提到 RDF graphs(RDF的抽象模型)不使用任何相对URIrefs,即RDF陈述中的主体、谓词和客体(以及类型文字中的数据类型)的标识必须是与上下文无关的。然而,某个特定的具体RDF语法(比如RDF/XML)可以允许在某些情况下将相对URIrefs作为一种绝对URIrefs的简略写法。RDF/XML的确允许这样使用相对URIrefs,前面的一些RDF/XML示例已经说明了这一点。更多细节请参见[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]。

Both RDF and Web browsers use URIrefs to identify things. However, RDF and browsers interpret URIrefs in slightly different ways. This is because RDF uses URIrefs only to identify things, while browsers also use URIrefs to retrieve things. Often there is no effective difference, but in some cases the difference can be significant. One obvious difference is that when a URIref is used in a browser, there is the expectation that it identifies a resource that can actually be retrieved: that something is actually "at" the location identified by the URI. However, in RDF a URIref may be used to identify something, such as a person, that cannot be retrieved on the Web. People sometimes use RDF together with a convention that, when a URIref is used to identify an RDF resource, a page containing descriptive information about that resource will be placed on the Web "at" that URI, so that the URIref can be used in a browser to retrieve that information. This can be a useful convention in some circumstances, although it creates a difficulty in distinguishing the identity of the original resource from the identity of the Web page describing it (a subject discussed further in Section 2.3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties)). However, this convention is not an explicit part of the definition of RDF, and RDF itself does not assume that a URIref identifies something that can be retrieved.
RDF和Web浏览器都使用URIrefs来标识事物,然而它们在解释URIrefs的方式上略有不同。因为在RDF中,URIrefs被用来标识事物,而浏览器还用URIrefs来获取事物。通常,这并没有经常有实际的区别,但在某些情况下区别是显著的。一个显而易见的区别是:当一个URIref被用在浏览器中时,它被期望标识某个可实际获取的资源,即某个确实位于该URI所标识的位置的资源。然而在RDF中,一个URIref可以被用来表示像人这样的不能在Web上获取的事物。人们在用RDF时有时会有这样的惯例:即当一个URIref被用于标识某个RDF资源时,人们习惯于在该URI所标识的位置放一个包含关于这个资源的描述性信息的页面,这样可在浏览器中用该URIref来获取信息。这在某些情况下,这是非常有用的,尽管它在原始资源的标识和描述它的Web页面(详见2.3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#structuredproperties))的标识的区分上造成了一些困难。然而,这一惯例在RDF定义中并没有被明确规定,RDF本身不假定URIref标识任何可获取的事物。

Another difference is in the way URIrefs with fragment identifiers are handled. Fragment identifiers are often seen in the URLs that identify HTML documents, where they serve to identify a specific place within the document identified by the URL. In normal HTML usage, where URI references are used to retrieve the indicated resources, the two URIrefs:

http://www.example.org/index.html
http://www.example.org/index.html#Section2

are related (they both refer to the same document, the second one identifying a location within the first one). However, as noted already, RDF uses URI references purely to identify resources, not to retrieve them, and RDF assumes no particular relationship between these two URIrefs. As far as RDF is concerned, they are syntactically different URI references, and hence may refer to unrelated things. This does not mean that the HTML-defined containment relationship might not exist, just that RDF does not assume that a relationship exists based only on the fact that the URI parts of the URI references are the same.
另一个区别是它们对带片段标识符的URIref的不同处理方式。在URLs(标识某HTML文档)中通常用片段标识符(fragment identifiers)来标识URL所标识文档中的某个特定位置。按正规的HTML用法,URI引用(URI references)是用于获取资源的,因此下面两个URIrefs:

http://www.example.org/index.html
http://www.example.org/index.html#Section2

是相关的(它们都引用了同一个HTML文档,而第二个标识第一个中的一个位置)。但是正如前面谈到的,在RDF中,URI引用纯粹被用于标识资源,而不是获取资源,并且RDF也不假定上述两个URIrefs之间存在任何关系。就RDF来说,它们在语法上是不同的URI引用,因此它们可以引用着不相关的事物。这并不意味着由HTML定义的限制关系不存在,而只表明RDF不会仅根据URI引用的URI部分相同而假定它们之间存在某个关系。

Carrying this point further, RDF does not assume that there is any relationship between URI references that share a common leading string, whether there is a fragment identifier or not. For example, as far as RDF is concerned, the two URIrefs:

http://www.example.org/foo.html
http://www.example.org/bar.html

have no particular relationship even though both of them start with the string http://www.example.org/. To RDF, they are simply different resources, because their URIrefs are different. (They may in fact be two files located in the same directory, but RDF does not assume this or any other relationship exists.)
就这一点再进一步地,RDF不假定具有相同前导字符串的URI引用(不论是否包含片段标识符)之间存在任何关系。例如,就RDF来说,下面两个URIrefs:

http://www.example.org/foo.html
http://www.example.org/bar.html

没有特定的关系,尽管它们有共同的前导字符串 http://www.example.org/。 对于RDF来说,它们仅仅是不同的资源,因为它们的URIrefs是不同的。(尽管它们可能确实是位于同一目录的两个文件,但RDF不假定这一点或任何其他关系存在于它们之间。)

Appendix B: More on the Extensible Markup Language (XML)

附录B:关于可扩展标记语言(Extensible Markup Language,XML)的更多信息

Note: This section is intended to provide a brief introduction to XML. The definitive specification of XML is [XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)], which should be consulted for further details.
注意:附录A旨在提供一个关于XML的简要介绍。XML的权威规范是[XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)],如需了解更多信息请参阅该文档。

The Extensible Markup Language (http://www.w3.org/TR/2000/REC-xml-20001006) [XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)] was designed to allow anyone to design their own document format and then write a document in that format. Like HTML documents (Web pages), XML documents contain text. This text consists primarily of plain text content, and markup in the form of tags. This markup allows a processing program to interpret the various pieces of content (called elements). Both XML content and (with certain exceptions) tags can contain Unicode [UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)] characters, allowing information from many languages to be directly represented. In HTML, the set of permissible tags, and their interpretation, is defined by the HTML specification. However, XML allows users to define their own markup languages (tags and the structures in which they can appear) adapted to their own specific requirements (the RDF/XML language described in Section 3 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml) is one such XML markup language). For example, the following is a simple passage marked up using an XML-based markup language:
可扩展标记语言(Extensible Markup Language) (http://www.w3.org/TR/2000/REC-xml-20001006)[XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)]被设计为允许任何人设计他们自己的文档格式并依照该格式书写文档。像HTML文档(网页)一样,XML文档包含文本。文本主要由平凡文本内容(plain text content)和以标签(tag)为形式的标记(markup)的构成。标记使得处理程序可以解释各个内容片断(称作元素(elements))。XML内容和(在某些特例中)标签(tags)可以包含Unicode[UNICODE (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-unicode)]字符,以允许直接表达多种语言的信息。在HTML中,允许的标签集合以及它们的解释是由HTML规范定义的。而XML允许终于用户定义他们自己的标记语言(markup languages)(标签及标签可出现的结构),以满足在他们的特定需求(第3节 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml)所描述的RDF/XML语言就是这样一种XML标记语言)。例如,下面这段简短的文字就是用一个基于XML的标记语言书写的:

<sentence><person webid="http://example.com/#johnsmith">I</person>
just got a new pet <animal>dog</animal>.</sentence>

Elements delimited by tags (<sentence>, <person>, etc.) are introduced to reflect a particular structure associated with the passage. The tags allow a program written with an understanding of these particular elements, and the way they are structured, to properly interpret the passage. For example, one of the elements in this example is <animal>dog</animal>. This consists of the start-tag <animal>, the element content, and a matching end-tag </animal>. This animal element, together with the person element, are nested as part of the content of the sentence element. The nesting is possibly clearer (and closer to some of the more "structured" XML contained in the rest of this Primer) if the sentence is written:
以标签为界的元素(<sentence>,<person>等)反映了与这段文字相关的特定结构。这些标签允许理解这些特定元素以及它们的构造方式的程序正确地解释上面的文字。比如,本例中的一个元素是<animal>dog</animal>,它包含首标签<animal>、元素内容和一个相应的尾标签</animal>。这个animal元素以及person元素被嵌套在sentence元素中。如果按下面的方式来书写这个句子,也许嵌套体现得更为清楚(并更接近于某些将在后面出现的更"结构化的"XML):

<sentence>

    <person webid="http://example.com/#johnsmith">I</person> 
just got a new pet
<animal>dog</animal>.

</sentence>

In some cases, an element may have no content. This can be written either by enclosing no content within the pair of delimiting start- and end-tags, as in <animal></animal>, or by using a shorthand form of tag called an empty-element tag, as in <animal/>.
在某些情况下,一个元素可以没有内容。可以用两种方式来书写这样的元素:不在首、尾标签括起的部分写入内容,比如<animal></animal>,或者用被称作空元素标签(empty-element tag)的简写形式,比如<animal/>。

In some cases, a start-tag (or empty-element tag) may contain qualifying information other than the tag name, in the form of attributes. For example, the start-tag of the <person> element contains the attribute webid="http://example.com/#johnsmith" (presumably identifying the specific person referred to). An attribute consists of a name, an equal sign, and a value (enclosed in quotes).
在某些情况下,首标签(或空元素标签)除了包含标签名称(tag name)以外,也可以包含限定信息(以属性(attributes)的形式出现)。例如,<person>元素的首标签包含属性webid="http://example.com/#johnsmith"(可能是标识被引用的那个人)。一个属性(attribute)包含名称、等号和值(用引号括起)。

This particular markup language uses the words "sentence," "person," and "animal" as tag names in an attempt to convey some of the meaning of the elements; and they would convey meaning to an English-speaking person reading it, or to a program specifically written to interpret this vocabulary. However, there is no built-in meaning here. For example, to non-English speakers, or to a program not written to understand this markup, the element <person> may mean absolutely nothing. Take the following passage, for example:
这一具体的标记语言使用单词“sentence”、“person”和“animal”作为标签名称,以试图传达元素的某些含义;它们传达含义给懂英语的读者,或一个专门解释该词汇表的程序。然而,这里没有内嵌的含义。例如,对于不懂英语的读者或一个不理解这些标记的程序而言,元素<person>也许没有任何含义。以下面这段文字为例:

<dfgre><reghh bjhbw="http://example.com/#johnsmith">I</reghh>
just got a new pet <yudis>dog</yudis>.</dfgre>

To a machine, this passage has exactly the same structure as the previous example. However, it is no longer clear to an English-speaker what is being said, because the tags are no longer English words. Moreover, others may have used the same words as tags in their own markup languages, but with completely different intended meanings. For example, "sentence" in another markup language might refer to the amount of time that a convicted criminal must serve in a penal institution. So additional mechanisms must be provided to help keep XML vocabulary straight.
对一个机器来说,这段文字和前面的例子有着完全相同的结构。然而,对于懂英语的读者来,他不会明白这段文字表达了什么,因为这里的标签不是英文单词。此外,别人也许已在他们的标记语言中使用了相同的单词,而具有完全不同的含义。例如,在另一个标记语言中“sentence”可能引用一个被定罪的罪犯必须在服役机构服役的时间。因此,必须提供附加的机制来帮助保持XML词汇的条理性。

To prevent confusion, it is necessary to uniquely identify markup elements. This is done in XML using XML Namespaces (http://www.w3.org/TR/REC-xml-names/) [XML-NS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-namespaces)]. A namespace is just a way of identifying a part of the Web (space) which acts as a qualifier for a specific set of names. A namespace is created for an XML markup language by creating a URI for it. By qualifying tag names with the URIs of their namespaces, anyone can create their own tags and properly distinguish them from tags with identical spellings created by others. A convention that is sometimes followed is to create a Web page to describe the markup language (and the intended meaning of the tags) and use the URL of that Web page as the URI for its namespace. However, this is just a convention, and neither XML nor RDF assumes that a namespace URI identifies a retrievable Web resource. The following example illustrates the use of an XML namespace.
为避免混淆,有必要对元素进行唯一标识。在XML中,这是通过使用XML命名空间(Namespaces) (http://www.w3.org/TR/REC-xml-names/)[XML-NS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-namespaces)]实现的。一个命名空间(namespace)即一种标识部分Web(空间)的方式,它作为一个特定集合的名称的限定符(qualifier)。为一个XML标记语言创建命名空间是通过为它创建URI来实现的。通过使用命名空间的URI来限定标签名称,任何人都可以创建他们自己的标签,并正确地区分于别人创建的具有相同拼写的标签。一个时常被遵循的惯例是:创建一个网页来描述标记语言(以及其中标签的含义)并使用该网页的URL作为命名空间的URI。然而,这只是一个惯例,XML和RDF都没有假定一个命名空间URI标识的是一个可获取的Web资源。下面的例子展示了XML命名空间的使用。

<user:sentence xmlns:user="http://example.com/xml/documents/">

   <user:person user:webid="http://example.com/#johnsmith">I</user:person> 

just got a new pet <user:animal>dog</user:animal>.
</user:sentence>

In this example, the attribute xmlns:user="http://example.com/xml/documents/" declares a namespace for use in this piece of XML. It maps the prefix user to the namespace URI http://example.com/xml/documents/. The XML content can then use qualified names (or QNames) like user:person as tags. A QName contains a prefix that identifies a namespace, followed by a colon, and then a local name for an XML tag or attribute name. By using namespace URIs to distinguish specific groups of names, and qualifying tags with the URIs of the namespaces they come from, as in this example, there is no need to worry about tag names conflicting. Two tags having the same spelling are considered the same only if they also have the same namespace URIs.
本例中,属性(attribute)xmlns:user="http://example.com/xml/documents/"为上述XML片段声明了一个命名空间。它将前缀(prefix)user映射到命名空间URI http://example.com/xml/documents/ 上。这样,XML内容可以使用限定名称(简称QNames)作为标签,比如user:person。QName以标识命名空间的前缀打头,后面紧跟一个冒号,然后是一个用于标签或属性名称的内部名(local name)。通过使用命名空间URIs来区分名称的分组,并用命名空间的URIs来限定标签(如本例中这样),就不必为标签名称冲突而担心了。两个拼写相同的标签仅当它们的命名空间URIs也相同时才被认为是相同的标签。

Every XML document is required to be well-formed. This means the XML document must satisfy a number of syntactic conditions, for example, that every start-tag must have a matching end-tag, and that elements must be properly nested within other elements (elements may not overlap). The complete set of well-formedness conditions is defined in [XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)].
每个XML文档必须是良构的(well-formed)。这意味着XML文档必须满足许多语法条件,例如,每个首标签必须有一个与之匹配的尾标签,并且元素之间的嵌套必须是正确的(元素之间不能重叠)。[XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)]定义了完整的良构条件集合。

In addition, an XML document may optionally include an XML document type declaration to define additional constraints on the structure of the document, and to support the use of predefined units of text within the document. The document type declaration (introduced with DOCTYPE) contains or points to declarations that define a grammar for the document. This grammar is known as a document type definition, or DTD. The declarations in a DTD specify such things as which XML elements and attributes may appear in XML documents corresponding to the DTD, the relationships of these elements and attributes (e.g., which elements can be nested within which other elements, or which attributes may appear with which elements), and whether elements or attributes are required or optional. The document type declaration can point to a set of declarations located outside the document (called the external subset, which can be used to allow common declarations to be shared among multiple documents), can include the declarations directly in the document (called the internal subset), or can have both internal and external DTD subsets. The complete DTD for a document consists of both subsets taken together. A simple example of an XML document with a document type declaration is shown in Example 47 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example47):
另外,一个XML文档可以自由选择是否包含一个XML文档类型声明(document type declaration)。文档类型声明对文档的结构定义了附加的限制,并支持在文档中使用预定义的文本单元。文档类型声明(通过DOCTYPE引入XML文档)包含或指向定义了文档语法的声明。这个语法被称为文档类型定义(document type definition,简称DTD)。DTD中的声明指定了哪些XML元素(elements)和属性(attributes)可以在符合该DTD的XML文档中出现、这些元素和属性的关系(例如哪些元素可以嵌套在另一些元素中,哪些属性可以在另一些元素中出现),以及元素或属性是必须的还是可选的。文档类型声明可以指向文档外部的一组声明(称作外部子集,它们可被用来在多个文档间共享一些公用的声明),也可以包含直接在文档中出现的声明(称做内部子集),或者既包含内部子集也包含外部子集。一个文档的完整DTD是它的内部子集与外部子集的总和。例47 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example47)是一个带有文档类型声明的XML文档的简单例子:

Example 47: An XML Document With a Document Type Declaration
例47:一个带有文档类型声明的XML文档

<?xml version="1.0"?>
<!DOCTYPE greeting SYSTEM "http://www.example.org/dtds/hello.dtd">
<greeting>Hello, world!</greeting>

In this case, the document has only an external DTD subset, and the system identifier http://www.example.org/dtds/hello.dtd provides its location (a URIref).
本例中,文档仅有外部DTD子集,系统标识符(system identifier)[译注//系统标识符一词有其历史渊源,将它理解为一种标识符就可以了,不要对其中的“系统”二字产生误解。]为 http://www.example.org/dtds/hello.dtd 给出了它的位置(一个URIref)。

An XML document is valid if it has an associated document type declaration and the document complies with the constraints defined by the document type declaration.
如果一个XML文档有与之关联的文档类型声明,并且符合该文档类型声明中的限制,则该XML文档是有效的(valid)。

An RDF/XML document is only required to be well-formed XML; it is not intended to be validated against an XML DTD (or an XML Schema), and [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)] does not specify a normative DTD that could be used for validating arbitrary RDF/XML (an appendix of [RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)] does provide a non-normative example schema for RDF/XML). As a result, more detailed discussion of XML DTD grammars is beyond the scope of this Primer. Further information on XML DTDs and XML validation can be found in [XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)], and the numerous books on XML.
一个RDF/XML文档仅需是良构的(well-formed)XML;它不用被验证是否符合某个XML DTD或XML模式(XML Schema),并且[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]也没有指定一个可用于验证RDF/XML的规范性DTD(但[RDF-SYNTAX (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-syntax)]在附录中为RDF/XML给出了一个非规范性的模式)。关于XML DTD语法的更详尽的讨论超出了本文档的范围。欲了解更多关于XML DTDs以及XML验证的信息,请参见[XML (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-xml)]和众多关于XML的书籍。

However, there is one use of XML document type declarations that is relevant to RDF/XML, and that is their use in defining XML entities. An XML entity declaration essentially associates a name with a string of characters. When the entity name is used elsewhere within an XML document, XML processors replace the entity name with the corresponding string. This provides a way to abbreviate long strings such as URIrefs, and can help make XML documents containing such strings more readable. Using a document type declaration just to declare XML entities is allowed, and can be useful, even when (as in RDF/XML) the documents are not intended to be validated.
然而,有一个XML文档类型声明的使用与RDF/XML相关的,并且是用在定义XML实体中。实际上,XML实体定义是将一个名称与一个字符串相关联。当实体名称在文档中的别处[译注//指除了它被定义的地方以外]出现时,XML处理器(XML processors)将用相应的字符串来替换该实体名称。这为长字符串(比如URIrefs)的书写提供了一种简略方式,并有助于增强XML文档的可读性。使用只包含XML实体声明的文档类型声明是合法的,并且有时是有用的,即使在文档不用被验证时(比如在RDF/XML中)。

In RDF/XML documents, entities are generally declared within the document itself, i.e., using only an internal DTD subset (one reason for this is that RDF/XML is not intended to be validated, and non-validating XML processors are not required to process external DTD subsets). For example, providing the document type declaration shown in Example 48 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example48) at the beginning of an RDF/XML document allows the URIrefs in that document for the rdf, rdfs, and xsd namespaces to be abbreviated as &rdf;, &rdfs;, and &xsd; respectively, as shown in the example.
在RDF/XML文档中,实体通常在文档内部声明,即只使用内部DTD子集(这样做的一个原因是RDF/XML不用被验证,而非验证的XML处理器不被要求处理外部DTD子集)。例如,在RDF/XML文档的开始部分提供如例48 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#example48)所示的文档类型声明将允许在文档中分别用&rdf;、&rdfs;和&xsd;作为命名空间rdf、rdfs和xsd所对应URIrefs的简写。

Example 48: Some XML Entity Declarations
例48:一些XML实体声明

<?xml version='1.0'?>

<!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 xsd "http://www.w3.org/2001/XMLSchema#">

]>

<rdf:RDF

    xmlns:rdf = "&rdf;" 
xmlns:rdfs = "&rdfs;"
xmlns:xsd = "&xsd;">

...RDF statements...

</rdf:RDF>

附录C:改动

本文档仅对建议推荐标准版本(Proposed Recommendation version) (http://www.w3.org/TR/2003/PR-rdf-primer-20031215/)仅作了微小的编辑与排字上的改动。关于建议推荐标准版本(Proposed Recommendation version) (http://www.w3.org/TR/2003/PR-rdf-primer-20031215/)对更早版本所做的改动请参见它的改动记录 (http://www.w3.org/TR/2003/PR-rdf-primer-20031215/#changes).



rdf_metadata_button.40.gif (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/metadata.rdf)


翻译后记

   W3C RDF Primer推荐标准是一个重要的W3C规范,也是W3C RDF系列规范中一个内容相对简单、适于入门者阅读的文档。鉴于目前还没有系统学习RDF的中文文档,相信这个规范的中译文将帮助更多朋友深入了解RDF。RDF Primer推荐标准于2004年7月6日被确定列入W3CHINA.ORG开放翻译计划(OTP) (http://wiki.w3china.org/)的工作计划,并于7月8日在W3CHINA.ORG讨论区 (http://bbs.w3china.org/)发布了“关于启动翻译 W3C RDF Primer 的倡议” (http://bbs.w3china.org/dispbbs.asp?boardID=2&ID=8689)一文。该倡议得到了众多语义万维网研究人员的热情支持,翻译计划随即启动。


 本文档翻译的顺利完成是团队协作的结果。翻译小组成员均为语义万维网领域研究人员,翻译分工如下:
章节 译者 校对
摘要 forwar(詹子鹏)
目录 admin(徐涵)
第一章 简介 admin(徐涵) orangebench(刘升平)
第二章 资源描述语句 forwar(詹子鹏) orangebench(刘升平)
第三章 RDF的XML语法 admin(徐涵) trevol(朱礼军)
第四章 其它RDF能力特征 orangebench(刘升平) npubird(汪鹏)
第五章 5.1-5.2 trevol(朱礼军) admin(徐涵)
第五章 5.3-5.5 orangebench(刘升平) admin(徐涵)
6.1 都柏林核心元数据计划 Ontoweb orangebench(刘升平)
6.2 PRISM forwar(詹子鹏) orangebench(刘升平)
6.3 XPackage weekend(暴雨) orangebench(刘升平)
6.4 RSS 1.0: RDF Site Summary trevol(朱礼军) monbit(张钋)
6.5 CIM/XML nybon(倪跃) orangebench(刘升平)
6.6 基因本体联盟 nybon(倪跃) orangebench(刘升平)
6.7 设备能力与用户偏好描述 orangebench(刘升平) admin(徐涵)
第七章 RDF规范相关文档 admin(徐涵) orangebench(刘升平)
附录 admin(徐涵) orangebench(刘升平)
致谢 trevol(朱礼军)
统稿 trevol(朱礼军)


Npubird(汪鹏)、Monbit(张钋)等人参加了多个章节的初审。由于RDF Primer中有大量的新词汇,译者力求精准,但是难免会有错误发生,欢迎您发表任何意见.请访问 http://bbs.w3china.org/dispbbs.aspboardID=2&ID=8689 (http://bbs.w3china.org/dispbbs.aspboardID=2&ID=8689)

hongkongtrip http://hktrip.net

个人工具
其它语言
 
 Page execution time: 6842.43 ms.
网上报警 苏ICP备05002329号