RDF入门 推荐标准
TransWiki - an Open Translation Project(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/)) |
| 说明 |
http://www.w3.org/Consortium/Legal/copyright-documents.html Reserved. W3C liability, trademark, document use and software licensing rules apply.
|
| 译者 |
关于本文档翻译工作的说明、任务分配及进展情况,请参见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)。 |
|
致谢 |
|
建议翻译时保留英文原文,以便于复查和修改。
尽量使用段落编辑(即点击要编辑段落右上方的[编辑]字样)
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 Identifiers或URIs)来标识事物,用简单的属性(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)所示的图:
图1:一个描述Eric Miller的RDF图
Figure 1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1) illustrates that RDF uses URIs to identify:
- individuals, e.g., Eric Miller, identified by http://www.w3.org/People/EM/contact#me
- kinds of things, e.g., Person, identified by http://www.w3.org/2000/10/swap/pim/contact#Person
> - properties of those things, e.g., mailbox, identified by http://www.w3.org/2000/10/swap/pim/contact#mailbox
- values of those properties, e.g. mailto:em@w3.org as the value of the mailbox property (RDF also uses character strings such as "Eric Miller", and values from other datatypes such as integers and dates, as the values of properties)
图1 (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#figure1)展示了RDF用URIs来标识:
- 个体(individual),例如Eric Miller,他被标识为http://www.w3.org/People/EM/contact#me
- 事物的种类,例如Person,它被标识为http://www.w3.org/2000/10/swap/pim/contact#Person
- 上述事物的属性(property),例如mailbox,它被标识为http://www.w3.org/2000/10/swap/pim/contact#mailbox
- 上述属性的值,例如 mailto:em@w3.org是mailbox 属性的值。(RDF也使用字符串(比如"Eric Miller")以及其它数据类型中的值(如整数,日期等)作为属性的值)
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规范的一部分:
- RDF概念和抽象语法 (http://www.w3.org/TR/rdf-concepts/) [RDF-CONCEPTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-concepts)]
- 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词汇描述语言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)]
- RDF语义 (http://www.w3.org/TR/rdf-mt/) [RDF-SEMANTICS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-semantics)]
- RDF测试用例 (http://www.w3.org/TR/rdf-testcases/) [RDF-TESTS (http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#ref-rdf-tests)]
- RDF入门 (http://www.w3.org/TR/rdf-primer/)(本文档)
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术语来说就是:
- the subject is the URL http://www.example.org/index.html
- 主体是URL http://www.example.org/index.html
- the predicate is the word "creator"
- 谓词是词“creator”
- the object is the phrase "John Smith"
- 客体是短语“John Smith”
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陈述来表示:
- a subject http://www.example.org/index.html
- a predicate http://purl.org/dc/elements/1.1/creator
- and an object http://www.example.org/staffid/85740
- 一个主体 http://www.example.org/index.html
- 一个谓词 http://purl.org/dc/elements/1.1/creator
- 和一个客体 http://www.example.org/staffid/85740
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)所示的那样:

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"):

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> <http://purl.org/dc/elements/1.1/creator> <http://www.example.org/staffid/85740> .
<http://www.example.org/index.html> <http://www.example.org/terms/creation-date> "August 16, 1999" .
<http://www.example.org/index.html> <http://purl.org/dc/elements/1.1/language> "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#