Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Socrates intro.
Search
Zoom.Quiet
December 03, 2009
Programming
75
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Socrates intro.
091203}COFFEE.55 Socrates项目进展
讲师:刘鑫
时间:16:30-18:00
地点:金山大厦11F中会议室
列席:KSPEG全体
Zoom.Quiet
December 03, 2009
More Decks by Zoom.Quiet
See All by Zoom.Quiet
PyCon2014China-Zhuhai-high performance
zoomquiet
0
200
PyCon2014China-Zhuhai-meta programming
zoomquiet
1
180
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
160
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
150
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
150
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
170
PyCon2014China-Zhuhai-jeff
zoomquiet
0
160
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
200
DevFest2014-Zhuhai-Polymer
zoomquiet
0
490
Other Decks in Programming
See All in Programming
Java 27新機能 / Java 27 new features
kishida
2
150
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
150
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
360
The Rails Doctrine Decade
koic
2
160
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
300
Heart of Swift Concurrency
koher
0
920
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
530
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
160
Are APIs Still Relevant in the AI Era?
soyuka
0
270
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
7.6k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
200
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
200
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
Abbi's Birthday
coloredviolet
4
10k
エンジニアに許された特別な時間の終わり
watany
109
250k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
700
How to Think Like a Performance Engineer
csswizardry
28
2.8k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Prompt Engineering for Job Search
mfonobong
0
450
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Transcript
Socrates 项目介绍
什么是Socrates? 三元语义模型 subject predicate object 通过 subject 和 predicate 组织
object 数据的关系 object 可扩展,支持任意存储层数据类型 解决关系型数据库结构固定,不容易修改的问题 解决稀疏表的存储问题 建立于数据存储层之上,兼容不同类型的数据库 规则简单 元数据信息,自描述 结构开放,可以开发第三方接口 结构简单,基于递归和引用,容易使用 数据粒度小,伸缩性好,容易并发 可插入到其它体系中使用
Socrates 使用 基于SQLALchemy Storage 基于URI,支持自反射,容易联接 Storage(uri) 基于元语的存储层注册机制 Storage.registe Storage.registed_type 条目ID自管理
透明、跨平台的统一序列生成器 基于三元语义的访问模型 writePredicate(name, type) writeSubject(subject_id, segments, **{segments})
Socrates元语——基础指令 SUBJECT = 1 PREDICATE = 2 IS = 3
OBJTYPE = 4 TYPE = 5 STRING = 6 NAME = 7 HAS = 8 SET = 9 STORAGE = 10
Socrates元语——基础定义 - subject is subject - subject has name -
predicate is subject - predicate has name - is is predicate - is has name - is objType subject - objType is predicate - objType has name - objType objType subject - type is subject - type has name
Socrates示例--KUSE日志系统 storage.registe('datetime', DateTime, create=True) storage.writePredicate('kssoid', 'string') storage.writePredicate('who', 'subject') storage.writePredicate('when', 'datetime')
storage.writePredicate('search', 'string') storage.writePredicate('visit snapshot', 'string') storage.writePredicate('visit url', 'string')
Socrates示例--KUSE日志系统 storage.writeSubject(None, {"search":keywords} when=datetime.now, who="kssoid subject")->new subject id
Socrates已实现的技术点 Storage() 使用SQLAlchemy URL 允许指定schema 自引导 新建基础结构 读取已有结构 registed 允许运行时建立存储类型
可以指定存储表 存储定义持久化
Socrates已实现的技术点 registed_type 直接存储table对象,构建查询时无需考虑schema问题 查询时遍历此map 允许多类型存储于同一表(即同义类型)
Socrates讨论——正在谋求解决的问题 多重语义谓词: 涉及数值的谓词往往要隐式支持多类型 avg sum ... 日期与时间类型 date datetime 解决:
谓词重定义 sum objType integer sum objType float sum objType decimal
Socrates讨论——正在谋求解决的问题 多重语义谓词: 写入时的类型判断 解决: 多重谓词必须显式引用 predicate:objType "predicate words":objType 谓词语句化: 允许引号包含的文本化谓词
以上需要简单的语法分析器支持 逃逸字符过滤 引号提取 词法分析
Socrates讨论——正在谋求解决的问题 匿名条目 KSSOID 解决: 直接编写 predicate object 子句
Socrates讨论——正在谋求解决的问题 查询 需要多次select 解决: 先使用 SQLAlchemy的查询功能 积累常用基础指令集: find predicate by
name find segment by query(predicate, object) search by object search by predicate search by name