引言语义网(Semantic Web)是一种数据的网络,让数据得以共享,而不仅仅是被应用程序束缚。 但语义网也不仅仅是把数据放在互联网上,而是试图将数据联系起来,并产生数据与现实事物的联系,以方便人与机器阅读与理解这些数据。 The Semantic Web isn\’t just about putting data on the web. It is about making links, so that a person or machine can explore the web of data. ——Linked Data Design Issues . Tim Berners-Lee 关联数据(Linked Data)是第一种可行的语义网表达形式,它采用RDF数据模型,利用URI(统一资源标识符)命名数据实体,来发布和部署实例数据和类数据,从而可以通过HTTP协议揭示并获取这些数据,同时强调数据的相互关联、相互联系以及有益于人机理解的语境信息。 Linked data is a set of best practices for publishing and deploying instance and class data using the RDF data model, and uses uniform resource identifiers (URIs) to name the data objects. The approach exposes the data for access via the HTTP protocol, while emphasizing data interconnections, interrelationships and context useful to both humans and machine agents. ——Linked Data FAQ . M.K. Bergman 因为语义网是一项庞大的工程,并相伴着各种困难,使其成为一种长期目标与愿景,而关系数据是一类实践活动,其可行并实用,成为当前语义网实现的一种最佳可行方案。 RDF的特点 资源描述框架(Resource Description Framework),作为XML(Extensible Markup Language)的一种衍生版本,他是关联数据的基本数据模型。蒂姆·伯纳斯-李(Tim Berners-Lee)在设计它的时候面临了以下两个问题: •怎样去设计方便易学易于传播并适合标准化的语言? •怎样去设计离散数据的入口和出口? 为了解决这两个问题,RDF有以下一些特点: •使用XML作为基本语言 •使用URIs作为现实事物的名字 •使用HTTP URIs使人们知道如何通过名字在网络中寻找数据(即创建离散数据入口) •包含与其他URIs的联系,使人们可以通过其找到更多有用的东西(即创建离散数据出口) •使用三元组(Triple)形式存储数据 实际上,一些RDF版本并非使用XML语言,这里主要指的是初始版本。 一个简单的RDF例子 复制代码 代码如下: <?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/\”> <rdf:Description rdf:about=\”http://www.w3.org/\”> <dc:title>World Wide Web Consortium</dc:title> </rdf:Description> </rdf:RDF> 将该RDF例子通过W3C RDF验证服务,会出现以下列表: Triples of the Data Model