doc/book/en/04-define-schema.en.txt
author Sandrine Ribeau <sandrine.ribeau@logilab.fr>
Wed, 19 Nov 2008 09:57:22 -0800
changeset 101 c9138325b89f
parent 93 9c919a47e140
permissions -rw-r--r--
[doc] Initial translation for data model chapter.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     1
.. -*- coding: utf-8 -*-
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     2
101
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     3
Data model definition (*schema*)
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     4
================================
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     5
101
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     6
The schema is the core piece of a `CubicWeb` application as it defines
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     7
the data model handled. It is based on entities types already defined
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     8
in the `CubicWeb` standard library and others, more specific, we would 
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     9
expect to find in one or more Python files under the `schema` directory.
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    10
101
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    11
At this point, it is important to make clear the difference between
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    12
relation type and relation definition: a relation type is only a relation
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    13
name with potentially other additionnal properties (see XXXX), whereas a 
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    14
relation definition is a complete triplet 
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    15
"<subject entity type> <relation type> <object entity type>". 
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    16
A relation type could have been implied if none is related to a 
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    17
relation definition of the schema.
c9138325b89f [doc] Initial translation for data model chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
    18
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    19
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    20
.. include:: 04-01-schema-stdlib.en.txt
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    21
.. include:: 04-02-schema-definition.en.txt
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    22