何为知识图谱:理解世界的结构化方式 | Knowledge Graphs: A Structured Approach to Understanding the World
第 1 章:何为知识图谱:理解世界的结构化方式
Chapter 1: Knowledge Graphs: A Structured Approach to Understanding the World
当我们走进一座图书馆,面对浩如烟海的书籍时,我们并不会感到完全的无助。书架上的分类标签、书架之间的导航指示、目录卡片柜中的索引系统——这些看似简单的组织方式,实际上帮助我们在数以百万计的书中迅速定位我们需要的信息。图书馆员们经过数百年的实践,发展出了一套被称为“图书分类法”的知识组织体系,其中最具代表性的便是杜威十进分类法(Dewey Decimal Classification)和美国国会图书馆分类法(Library of Congress Classification)。这些分类系统的共同特点是将所有知识划分为若干大类,每一大类再细分为中类,中类再细分为小类,形成一个层层递进的树状结构。
When we walk into a library and face the vast ocean of books, we are not completely helpless. The classification labels on the shelves, the navigation guides between bookshelves, and the index system in the card catalog—these seemingly simple organizational methods actually help us quickly locate the information we need among millions of books. Through hundreds of years of practice, librarians have developed a knowledge organization system known as the "book classification method," with the most representative being the Dewey Decimal Classification (DDC) and the Library of Congress Classification. The common feature of these classification systems is that all knowledge is divided into several major categories, each major category is further subdivided into middle categories, which are then subdivided into smaller categories, forming a hierarchical tree-like structure.
这种树状分类思想深深影响了人类知识组织的传统。我们习惯于用“是...的一种”来描述概念之间的关系:猫“是”动物的一种,动物“是”生物的一种,生物“是”物质的一种。这种“一对一”的从属关系虽然清晰明了,但在面对更加复杂的现实世界时,却显得有些力不从心。当我们试图描述“张三和李四是夫妻”、“王五住在北京市海淀区”、“赵六是某公司的技术总监同时也是某大学的兼职教授”这样复杂的关系时,简单的树状结构就难以胜任了。
This tree-like classification thinking has deeply influenced the tradition of human knowledge organization. We are accustomed to describing relationships between concepts using "is a kind of": a cat "is a kind of" animal, an animal "is a kind of" living thing, a living thing "is a kind of" matter. Although these one-to-one subordinate relationships are clear and straightforward, they seem somewhat inadequate when facing the more complex real world. When we try to describe complex relationships such as "Zhang San and Li Si are married," "Wang Wu lives in Haidian District, Beijing," or "Zhao Liu is the technical director of a company and also a part-time professor at a university," the simple tree structure becomes inadequate.
什么是知识图谱
What is a Knowledge Graph
知识图谱(Knowledge Graph)正是为了解决这一问题而诞生的。2012年,谷歌(Google)公司正式提出了“知识图谱”这一术语,旨在构建一个大规模的语义网络,帮助搜索引擎更好地理解用户查询的意图,提供更加准确和丰富的搜索结果。如今,知识图谱已经成为人工智能(Artificial Intelligence, AI)领域最重要的基础设施之一,被广泛应用于智能问答、推荐系统、语义搜索、知识推理等众多场景。
The knowledge graph was born precisely to solve this problem. In 2012, Google formally proposed the term "Knowledge Graph," aiming to build a large-scale semantic network to help search engines better understand the intent behind user queries and provide more accurate and rich search results. Today, knowledge graphs have become one of the most important infrastructure components in the field of artificial intelligence (AI), widely applied in many scenarios such as intelligent question answering, recommendation systems, semantic search, and knowledge reasoning.
从本质上讲,知识图谱是一种用图(Graph)结构来表示和组织知识的技术。在这里,“图”是数学和计算机科学中的一个专业术语,它由节点(Node)和边(Edge)组成。节点代表各种各样的实体(Entity),如人物、地点、组织、概念、事件等;边则代表实体之间的关系(Relation),如“是”、“属于”、“发现于”、“居住于”、“创办”等。通过节点和边的组合,知识图谱能够以一种直观、结构化的方式描述现实世界中纷繁复杂的知识。
Essentially, a knowledge graph is a technology that uses graph structures to represent and organize knowledge. Here, "graph" is a specialized term in mathematics and computer science, consisting of nodes (also called vertices) and edges. Nodes represent various entities (Entity), such as people, places, organizations, concepts, events, etc.; edges represent relationships (Relation) between entities, such as "is," "belongs to," "discovered in," "lives in," "founded," etc. Through the combination of nodes and edges, knowledge graphs can describe the complex knowledge of the real world in an intuitive and structured way.
让我们用一个具体的例子来说明。假设我们要用知识图谱来表示“牛顿发现万有引力定律”这一知识点。在知识图谱中,我们至少需要创建三个节点:“艾萨克·牛顿”(一个具体的人物实体)、“万有引力定律”(一个抽象的物理定律实体)、以及“1687年”(一个表示时间的实体)。然后,我们需要创建两条边:一条是“牛顿”和“万有引力定律”之间的关系,边的类型可以是“发现”或“提出”;另一条是“万有引力定律”和“1687年”之间的关系,边的类型可以是“发现于”或“提出于”。这样,通过节点和边的组合,我们就以一种机器可理解、结构化的方式表达了这个知识点。
Let us use a concrete example to illustrate. Suppose we want to represent the knowledge point "Newton discovered the law of universal gravitation" in a knowledge graph. In the knowledge graph, we need to create at least three nodes: "Isaac Newton" (a specific person entity), "Law of Universal Gravitation" (an abstract physics law entity), and "1687" (an entity representing time). Then, we need to create two edges: one is the relationship between "Newton" and "Law of Universal Gravitation," where the edge type can be "discovered" or "proposed"; the other is the relationship between "Law of Universal Gravitation" and "1687," where the edge type can be "discovered in" or "proposed in." In this way, through the combination of nodes and edges, we have expressed this knowledge point in a machine-readable and structured manner.
三大基本要素:实体、关系与属性
Three Basic Elements: Entities, Relations, and Attributes
深入理解知识图谱,我们需要掌握其三大基本要素:实体(Entity)、关系(Relation)和属性(Attribute)。这三个要素共同构成了知识图谱的核心骨架,缺一不可。
To deeply understand knowledge graphs, we need to master their three basic elements: Entity, Relation, and Attribute. These three elements together form the core skeleton of a knowledge graph, and none can be missing.
实体:知识的基本单元
Entities: The Basic Units of Knowledge
实体是知识图谱中最基本的组成单位,代表客观世界中可区分的个体或概念。在不同的应用场景中,实体的类型可以是多种多样的,主要包括以下几类:
Entities are the most fundamental building blocks of a knowledge graph, representing distinguishable individuals or concepts in the objective world. In different application scenarios, entity types can be diverse, mainly including the following categories:
人物实体(Person Entity)是最常见也是最重要的实体类型之一。每个人都有独特的身份标识,都可以作为一个独立的实体存在。例如,“爱因斯坦”、“居里夫人”、“马云”等都是典型的人物实体。人物实体通常具有丰富的属性,如出生日期、出生地点、国籍、职业、教育背景等。
Person entities are one of the most common and important entity types. Every person has a unique identity and can exist as an independent entity. For example, "Einstein," "Marie Curie," and "Jack Ma" are all typical person entities. Person entities usually have rich attributes, such as date of birth, place of birth, nationality, occupation, educational background, etc.
地点实体(Location Entity)包括地理位置、行政区划、建筑、自然景观等。故宫、长城、北京市、黄河、珠穆朗玛峰都是典型的地点实体。与人物实体类似,地点实体也具有丰富的属性,如面积、人口、海拔、经纬度坐标等。
Location entities include geographical locations, administrative divisions, buildings, natural landscapes, etc. The Forbidden City, Great Wall, Beijing, Yellow River, and Mount Everest are all typical location entities. Similar to person entities, location entities also have rich attributes, such as area, population, altitude, latitude and longitude coordinates, etc.
组织实体(Organization Entity)包括公司、学校、政府机构、非营利组织等。苹果公司、清华大学、联合国、世界卫生组织都是典型的组织实体。组织实体的属性可能包括成立时间、总部位置、创始人、员工数量、业务范围等。
Organization entities include companies, schools, government agencies, non-profit organizations, etc. Apple Inc., Tsinghua University, the United Nations, and the World Health Organization are all typical organization entities. The attributes of organization entities may include founding date, headquarters location, founders, number of employees, business scope, etc.
概念实体(Conceptual Entity)代表抽象的概念或类别,如“物理学”、“民主制度”、“人工智能”等。概念实体用于表达抽象的知识,是知识图谱中连接具体实体的重要桥梁。
Conceptual entities represent abstract concepts or categories, such as "physics," "democratic system," and "artificial intelligence." Conceptual entities are used to express abstract knowledge and serve as important bridges connecting specific entities in knowledge graphs.
事件实体(Event Entity)代表在特定时间、地点发生的事情,如“第一次世界大战”、“辛亥革命”、“新冠疫情”等。事件实体具有时间维度的属性,可以与其他实体建立时间上的关联。
Event entities represent things that happened at specific times and places, such as "World War I," "Xinhai Revolution," and "COVID-19 pandemic." Event entities have temporal attributes and can establish temporal connections with other entities.