实化
✍ dations ◷ 2025-04-26 21:32:58 #计算机编程,知识表示
在计算机科学中,实化(英语:reification)或对象化是把抽象的想法(idea)转化为明确的数据模型或程序设计语言创建的其他对象的过程。通过实化,以前是隐式的、未表示的、可能是不可表示的被显式形成可概念(逻辑或计算)操作的。非正式地,实化也常被称作在特定系统范围内把某些东西变为“头等公民”。 实化是概念分析与知识表示中最常用的技术。
在程序设计语言中,把用户程序或者程序设计语言某一部分本来在编译期与运行期是隐式的,表示为语言自身,这一过程称为实化。这使得其对程序可当作普通数据来利用。在具有反射的程序设计语言中,实化的数据表示了相关的被实化的领域。实化的数据常被称作头等对象。
数据实化涉及在形式规范(英语:formal specification)中找到抽象数据类型的更为具体的表示。 例如,抽象数据类型集合(set)可以用map或者array来实化。
概念建模(英语:Conceptual model (computer science))中广泛使用了实化。实化一个关系(relationship)意味着把它视作一个实体。实化一个关系的目的是令其显式,必要时可以增加额外的信息。例如,关系表示某人是某委员会的成员。下图左侧用表的形式列出了人是委员会与的成员;人是委员会成员。
这一关系,也可看作实体。见图示的右侧。称作该实体实化了这个关系。这个实体类型为Membership
。现在,可以给这个关系实体增加新的信息,如某人属于某委员会是由谁来提名加入的,可表示为。
与其密切相关的用法见实化 (知识表示)(英语:Reification (knowledge representation))。
UML提供了关联类(association class)用于构建被实化的关系类型。关联类既是关联又是类。
In Semantic Web languages, such as Resource Description Framework (RDF) and Web Ontology Language (OWL), a statement is a binary relation. It is used to link two individuals or an individual and a value. Applications sometimes need to describe other RDF statements, for instance, to record information like when statements were made, or who made them, which is sometimes called "provenance" information. As an example, we may want to represent properties of a relation, such as our certainty about it, severity or strength of a relation, relevance of a relation, and so on.
The example from the conceptual modeling section describes a particular person with URIref person:p1
, who is a member of the committee:c1
. The RDF triple from that description is
person:p1 committee:isMemberOf committee:c1 .
Consider to store two further facts: (i) to record who nominated this particular person to this committee (a statement about the membership itself), and (ii) to record who added the fact to the database (a statement about the statement).
The first case is a case of classical reification like above in UML: reify the membership and store its attributes and roles etc.:
committee:Membership rdf:type owl:Class . committee:membership12345 rdf:type committee:Membership . committee:membership12345 committee:ofPerson person:p1 . committee:membership12345 committee:inCommittee committee:c1 . person:p2 committee:nominated committee:membership12345 .
Additionally, 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
.
Using the reification vocabulary, a reification of the statement about the person's membership would be given by assigning the statement a URIref such as committee:membership12345
so that describing statements can be written as follows:
committee:membership12345Stat rdf:type rdf:Statement . committee:membership12345Stat rdf:subject person:p1 . committee:membership12345Stat rdf:predicate committee:isMemberOf . committee:membership12345Stat rdf:object committee:c1 .
These statements say that the resource identified by the URIref committee:membership12345Stat
is an RDF statement, that the subject of the statement refers to the resource identified by person:p1
, the predicate of the statement refers to the resource identified by committee:isMemberOf
, and the object of the statement refers to the resource committee:c1
. Assuming that the original statement is actually identified by committee:membership12345
, 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. Therefore, they are sometimes referred to as the "reification quad".
Using reification according to this convention, we could record the fact that person:p3
added the statement to thedatabase by
person:p3 committee:addedToDatabase committee:membership12345Stat .
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. Note that the described triple (subject predicate object)
itself is not implied by such a reification quad (and it is not necessary that it actually exists in the database). This allows also to use this mechanism to express which triples do hold.
The power of the reification vocabulary in RDF is restricted by the lack of a built-in means for assigning URIrefs to statements, so in order to express "provenance" information of this kind in RDF, one has to use some mechanism (outside of RDF) to assign URIs to individual RDF statements, then make further statements about those individual statements, using their URIs to identify them.
In an XML Topic Map (XTM), only a topic can have a name or play a role in an association. One may use an association to make an assertion about a topic, but one cannot directly make assertions about that assertion. However, it is possible to create a topic that reifies a non-topic construct in a map, thus enabling the association to be named and treated as a topic itself.
In Semantic Web languages, such as RDF and OWL, a property is a binary relation used to link two individuals or an individual and a value. However, in some cases, the natural and convenient way to represent certain concepts is to use relations to link an individual to more than just one individual or value. These relations are called n-ary relations. Examples are representing relations among multiple individuals, such as a committee, a person who is a committee member and another person who has nominated the first person to become the committee member, or a buyer, a seller, and an object that was bought when describing a purchase of a book.
A more general approach to reification is to create an explicit new class and n new properties to represent an n-ary relation, making an instance of the relation linking the n individuals an instance of this class. This approach can also be used to represent provenance information and other properties for an individual relation instance.
:p1 a :Person ; :has_membership _:membership_12345 ._:membership_12345 a :Membership ; :committee :c1; :nominated_by :p2 .
Reification vs. quotation
It is also important to note that the reification described here is not the same as "quotation" found in other 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:
committee:membership12345 rdf:subject person:p1 .
describing the rdf:subject
of the original statement says that the subject of the statement is the resource (the person) identified by the URIref person:p1
. It does not state that the subject of the statement is the URIref itself (i.e., a string beginning with certain characters), as quotation would.
相关
- NotchNotch信号通路是大多数多细胞生物体中存在的高度保守的细胞信号转导系统。哺乳动物具有四种不同的notch受体,分别称为NOTCH1, NOTCH2, NOTCH3, NOTCH4。Notch受体是单跨膜的
- 博施卡尔·博施(Carl Bosch)(1874年8月27日-1940年4月26日)是德国化学家与工程师。1931年诺贝尔化学奖以及1939年歌德奖获得者。卡尔出生于科隆。他在1892至1898年间就读于查诺顿堡的
- 速写速写,指快速绘画。大部分的速写都是快速的素描,仅勾勒出轮廓,形体,而不加绘肌理,光影的细节。对于学习艺术的入门者来说,速写是大量练习的技巧,也是观察和美感培养的日记。对于设计
- 月经杯月经杯又称为月亮杯、月事杯,为由硅胶、乳胶或者热塑性塑料制成、可以置放在阴道内使用的经期用品,柔软、富有弹性。一般多为钟形,下方为短柄状(或者也有环状、球状柄)。钟形部分
- 御节料理御节料理 (日式年菜)是日本在节日时所做的特殊料理,特别是在过年时的主要料理,所以又称正月料理,通常也只说“御節、おせち”即可。在日本有人日(人日、じんじつ)、上巳节(上巳、
- 荷兰加勒比区荷兰加勒比区(荷兰语:Caribisch Nederland)是属于荷兰本土的三个公共实体:博奈尔、圣尤斯特歇斯和萨巴的集体名称,又称BES群岛,其地名已在国际标准化组织的ISO 3166-1国际标准注册
- 玉子 (电影)《玉子》(英语:,韩语:옥자 )是一部于2017年韩国和美国合拍的动作冒险片,由奉俊昊执导并和强·朗森(英语:Jon Ronson)共同编剧。电影由韩国童星安瑞贤、英国演员蒂尔达·斯温顿、美国
- 曹云金曹云金(1984年1月26日-),本名曹金,天津人,中国相声演员,原德云社成员,曾拜师郭德纲学习相声,2010年宣布已退出德云社。搭档为刘云天。曹亮1984年出生于天津,2000年,其受到相声演员田立
- 副长吻猴属副长吻猴(学名:)是已灭绝的猴子,生存于中上新世至早更新世的欧亚大陆,该属与猕猴关系密切,具有相似的颅骨形态。它的踝关节构造与南方古猿相似,被认为具有两足行走的能力。
- 阿图罗·弗朗迪西阿图罗·弗朗迪西·埃尔克里(西班牙语:Arturo Frondizi Ercoli;1908年10月28日-1995年3月18日),是阿根廷总统,执政期间推动国有企业部分私有化,大力发展基础工业,并对外开放吸收外资