The Object-Relation-Kin Model

本文提出了一种新的数据模型——对象-关系-亲缘模型(OR-Kin),旨在解决对象技术和关系模型之间的不匹配问题。该模型从关系模型和实体-关系模型出发,通过引入独特的对象图和亲缘字段等概念,实现对象技术与关系数据库的有效融合。文章还探讨了基于Java编程语言的实际应用案例。
The Object-Relation-Kin Model
Toward Relational Analysis and Design in General Object Oriented
Languages

Abstract:
The relational model is in use by many database systems. Object oriented technology is also widely used in database
application development. But “object-relational impedance mismatch” was found between the two approaches.
However, in the study behind this paper, the REAL mismatch is revaluated, and the Object-Relational Mapping
approach is found being actually mapping between the Network Model and the SQL interface.
A new data model - the Object-Relation-Kin model is then derived from the relational model and the entityrelationship
model, to better consolidate object technology and the relational model without defective mappings.
Ableverse™ TheObjectBase as the DBMS and WebOfWeb as the blueprint project are showing a feasible solution in
the Java™ programming language as realworld practices, on the basis of this new data model.


全文见:
[url]http://www.ableverse.org/articles/orkm.pdf[/url]

[url]http://www.ableverse.org/articles/orkm.html[/url]


Table of Contents:
1 . Introduction
1 .1. Backgrounds
1 .1.1. The Relational Model and the Entity-Relationship Model
1 .1.2. Conventional Relational Databases and SQL
1 .2. New Situations
1 .2.1. Impedance Mismatch Problems and SQL's Limitations
1 .2.2. Physical RAM Capacity Increased to Hold Mass Data
1 .2.3. Developed Garbage Collection Technologies
1 .2.4. More CPUs, More Cores, Sharing a Same Memory Space
1 .3. New Ideas
1 .3.1. Adding Persistence Ability to Application Object Model
1 .3.2. Unique Object Graph
1 .3.3. Relational Data Traverse for Embedded DB Access
1 .3.4. Hosting Based Interfacing for Distributed DB Access
2 . Premised Object Orientation
2 .1. Object Oriented Analysis and Design
2 .2. The Java Programming Language
3 . The Object-Relation-Kin Model
3 .1. Data in Object Models: Exposed Properties and Encapsulated Fields
3 .2. Multilevel Views of Data
3 .3. Information Concerning Entities and Relationships (Level 1)
3 .3.1. Entity and Relation Objects
3 .3.1.1. Entity Object Inheritance
3 .3.1.2. Relation Object Inheritance
3 .3.2. Role in Relationship
3 .3.3. Properties, Value and Type
3 .3.4. Conceptual Information Structure
3 .4. Information Structure (Level 2)
3 .4.1. Object Identifiers
3 .4.2. Data Fields Encapsulated by Objects
3 .4.3. Entity and Relation Classes
3 .5. Object Graph in Operational Memory (Level 4)
3 .5.1. Relation Object Ties Other Objects with Tie Fields
3 .5.1.1. Tie Field Name reflects Role
3 .5.1.2. Behaviors of Tie Reference Object
3 .5.2. Related Objects Reach Each Others through Kin Fields
3 .5.2.1. Kin Field and Kin Set Field
3 .5.2.2. Source Relation, Self Roles and Target Roles
3 .5.2.3. Kin Reference
3 .5.3. Derive 3NF Schema from E-R Schema, Direct Kin
3 .6. Tabular Object States in Permanent Storage (Level 3)
3 .7. Object Swapping and Swap Engine
3 .7.1. Update Tables On Transaction Commit
3 .7.2. Inflate Objects On Initial Access
4 . Persistence System Design with ORK Model
4 .1. Database Management System for ORK Model
4 .2. Create Domain Model with Persistent Objects
4 .2.1. Design Domain Object Topography
4 .2.2. Design Object Behaviors (Domain Logics)
4 .2.2.1. Concern Persistence Behaviors
4 .3. Provide Access to the System
4 .3.1. Define and Implement Service Interfaces
4 .3.1.1. Create Domain Objects
4 .3.1.2. Find Domain Objects
4 .3.1.2.1. Query Persistent Objects using SQL
4 .3.1.2.2. More Query Mechanisms
4 .3.1.3. Delete Domain Objects
4 .3.1.4. Invoke Domain Object Methods
4 .3.1.4.1. Methods Read Persistent Fields
4 .3.1.4.2. Methods Write Persistent Fields
4 .3.1.4.3. Methods Update Tie Fields
4 .3.2. Host Foreign Task Agents with Domain Model Environment
4 .3.2.1. Enable Task Agent Transmission
4 .3.2.2. Impose Security Constraints
4 .4. Design Data Analytical Applications using SQL
5 . Object-Relation-Kin Diagram
6 . Software Products for Reference
### 基于BERT的人物关系提取方法 #### 方法概述 基于BERT的人物关系提取是一种结合自然语言处理技术和预训练模型的任务,目标是从文本或其他结构化数据中自动识别并分类人物之间的关系。这种方法通常依赖于BERT强大的语义表示能力以及特定的关系建模技术。 一种常见的实现方式是将知识图谱中的三元组(主体、谓词、客体)转化为适合BERT输入的形式[^1]。例如,在ClinicalBERT的研究中提到,可以通过构造特殊的输入句子来融合外部知识,从而提升关系预测的效果[^4]。具体来说,可以设计如下形式的输入: ```text [CLS] 主体 文本描述 客体 [SEP] 关系提示信息 [SEP] ``` 其中,“关系提示信息”可以根据领域需求灵活调整,比如直接提供可能的关系类别作为辅助信号。 #### 数据准备与特征工程 为了有效利用BERT进行人物关系提取,需要精心准备训练数据。这包括但不限于以下几个方面: - **标注数据集**:构建高质量的数据集对于监督学习至关重要。如果缺乏现成资源,则可通过 distant supervision 或其他弱监督手段自动生成初始标签[^2]。 - **上下文扩展**:考虑到单一句子可能不足以捕捉复杂的人物互动模式,因此建议引入更大范围内的文档级上下文支持跨句推理[^3]。 此外,还可以借助语法依存树等工具获取额外的语言学特性,帮助理解句子内部结构及其对齐情况[^5]。 #### 实验设置与评估指标 在实验阶段,应明确设定评价标准以便客观衡量算法性能。常用的度量有精确率(Precision)、召回率(Recall) 和 F1分数(F1-Score),它们能够全面反映系统的准确性与覆盖广度。 以下是简单的Python代码片段展示如何加载预训练好的BERT模型并通过微调适应新任务: ```python from transformers import BertTokenizer, BertForSequenceClassification import torch tokenizer = BertTokenizer.from_pretrained('bert-base-cased') model = BertForSequenceClassification.from_pretrained('bert-base-cased', num_labels=NUM_RELATIONS) def encode_example(example_text_pair): encoding = tokenizer.encode_plus( example_text_pair[0], # Subject context. example_text_pair[1], # Object context plus optional hint. max_length=MAX_SEQ_LEN, padding='max_length', truncation=True, return_tensors="pt" ) return { 'input_ids': encoding['input_ids'].flatten(), 'attention_mask': encoding['attention_mask'].flatten() } # Example usage during training loop... for batch in dataloader: inputs = {k:v.to(device) for k,v in map(encode_example,batch)} outputs = model(**inputs) loss = criterion(outputs.logits, labels) ... ``` 以上仅作示意用途,请依据实际应用场景做适当修改优化。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值