Rendering of reStructured text is not possible, please install Docutils.

:status: 草稿 ;LX;完成度75%;

.. contents:: :local:

- `PyCon2010亚洲 <PyCon2010>`_ 

Introduction
======
Socrates 是一个基于关系型数据库和ORM的通用数据库工具。它通过三元语义表达了对动态数据结构的存储和管理功能。使得开发人员可以在关系数据库中管理结构可变的 数据。三元语义可以方便的表达单一信息之间的关系,因此它很适合用来表达有向图,甚至有向有环的网状模型,或路径长度很长的关系。

Socrates is a Model maker tools base on RDB and ORM。 It defines the dynamic structure storage and manage funcitons by triples semantic. Triples semantic can make it easy that descrption relations between data, so it wanderful for directed graph or network graph with circle or long path releations.   

* 预计时长:25分钟
* 难度  Level :面向中级听众
* 类别 Categories:数据库 databases

参考: PyCon2010亚洲

Socratse
=========


Background on project
---------------------------------------

 * We need create a database as fast as, to supoort mulit-reporters. Every one is small and used once but unique. 
 * Need support some unkown data types.
 * Need create networt model, that is varable between nodes, and often been find by path. 
 * Characters and toys in some games, would wery huge if description by RDB table. But it is sparse. 


Problems to solve
------------------------------------

 * The business information of the data sheet has its own internal consistency. it is not efficient or economic to establish a new data model for each and every change.
 * Modify the data table structure when every data change is not actuality.
 * RDB model is not good at description deep recursion as such as tree.

What's socrates?
------------------------------------

 * Socrates 基于三元语义模型,可以方便的表达动态的数据结构和关系
 * Socrates bases on the triple semantic logic model. It can descript model with dynamic structure and releations easy.
 * The model create by two layers: subject and segment
  * Every segment is a triple structure as (subject, predicate, object).
  * A subject is a subject descripted by some segments.
  * The predicate is what owned by the subject. 
  * The object is what subject is in the predicate.
 * Every subject is a structure like dictonary.
 * The predicate must be a readable string, the name is the unique title.
 * The object is any type if the database can use it. 
 * Socrates override RDB's statics and strongly data type, but play as dynamic data structure model.
 * Socrates bases on the python ORM tools named SQLAlchemy, it can use the greate power from SQLAlchemy.  
 * Socrates in database is a unitive creater, a little storage tables, some meta command data. The storage table can create in runtime. 

Why socrates?
------------------------

 * Tiny size data model, access easy for any detail.
 * Socrates can use as dictonary.
  * Every subject is a structure as dictonary, can modify without effect other.
  * Subject and subject can create releations use segments by a easy way.
 * You can uses any RDB and use its specific data type.

Basic recurrence
----------------------------------

 * "One command" create Socrates environment on different database platform.
 * Registe new type and predicate.
 * Write subject, new releation.

More sophisticated recurrence
-------------------------------------------

 * Query segments and subject
 * Find by relation pathes.
 * Access segments in subjects.
 * Predicate Expression.

Other capabilities of socrates
------------------------------

 * Performance
 * Concurrent and Distributed.
 * Multi node by difference databases.

结尾
----------

 * Socrates Supports a flexible way to manage data. It can manager dynamic and complex data in a unitive technique.
 * Socrates need improve at DSL and distributed.
 * Socrates can be speed boost.

.. macro:: -- ZoomQuiet [<<DateTime(2010-01-11T10:44:45+0800)>>]