author | Julien Jehannet <julien.jehannet@logilab.fr> |
Wed, 07 Jul 2010 10:53:03 +0200 | |
changeset 5924 | b218df942dd4 |
parent 5400 | b7ab099b128a |
child 5953 | af48c527aea7 |
permissions | -rw-r--r-- |
5400
b7ab099b128a
[doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5189
diff
changeset
|
1 |
|
b7ab099b128a
[doc/book] various content fixes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
5189
diff
changeset
|
2 |
.. _rql_intro: |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
3 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
4 |
Introduction |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
5 |
------------ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
6 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
7 |
Goals of RQL |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
8 |
~~~~~~~~~~~~ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
9 |
|
5924
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
10 |
The goal is to have a semantic language in order to: |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
11 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
12 |
- query relations in a clear syntax |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
13 |
- empowers access to data repository manipulation |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
14 |
- making attributes/relations browsing easy |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
15 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
16 |
As such, attributes will be regarded as cases of special relations (in |
5189
84d4587a92bc
[doc/book] rql/dbapi cleanup, rip cachekey (prematurely ?)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2535
diff
changeset
|
17 |
terms of usage, the user should see no syntactic difference between an |
84d4587a92bc
[doc/book] rql/dbapi cleanup, rip cachekey (prematurely ?)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2535
diff
changeset
|
18 |
attribute and a relation). |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
19 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
20 |
Comparison with existing languages |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
21 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
22 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
23 |
SQL |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
24 |
``` |
2535
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
25 |
|
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
26 |
RQL may remind of SQL but works at a higher abstraction level (the *CubicWeb* |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
27 |
framework generates SQL from RQL to fetch data from relation databases). RQL is |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
28 |
focused on browsing relations. The user needs only to know about the *CubicWeb* |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
29 |
data model he is querying, but not about the underlying SQL model. |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
30 |
|
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
31 |
Sparql |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
32 |
`````` |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
33 |
|
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
34 |
The query language most similar to RQL is SPARQL_, defined by the W3C to serve |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
35 |
for the semantic web. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
36 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
37 |
Versa |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
38 |
````` |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
39 |
|
2535
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
40 |
We should look in more detail, but here are already some ideas for the moment |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
41 |
... Versa_ is the language most similar to what we wanted to do, but the model |
5189
84d4587a92bc
[doc/book] rql/dbapi cleanup, rip cachekey (prematurely ?)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2535
diff
changeset
|
42 |
underlying data being RDF, there are some things such as namespaces or |
2535
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
43 |
handling of the RDF types which does not interest us. On the functionality |
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
44 |
level, Versa_ is very comprehensive including through many functions of |
5189
84d4587a92bc
[doc/book] rql/dbapi cleanup, rip cachekey (prematurely ?)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
2535
diff
changeset
|
45 |
conversion and basic types manipulation, which we may want to look at one time |
2535
c7b736929a58
[doc] a bit of rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2175
diff
changeset
|
46 |
or another. Finally, the syntax is a little esoteric. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
47 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
48 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
49 |
The different types of queries |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
50 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
51 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
52 |
Search (`Any`) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
53 |
Extract entities and attributes of entities. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
54 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
55 |
Insert entities (`INSERT`) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
56 |
Insert new entities or relations in the database. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
57 |
It can also directly create relationships for the newly created entities. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
58 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
59 |
Update entities, create relations (`SET`) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
60 |
Update existing entities in the database, |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
61 |
or create relations between existing entities. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
62 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
63 |
Delete entities or relationship (`DELETE`) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
64 |
Remove entities or relations existing in the database. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
65 |
|
2172
cf8f9180e63e
delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
66 |
|
5924
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
67 |
Concepts |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
68 |
~~~~~~~~ |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
69 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
70 |
Entity type |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
71 |
``````````` |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
72 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
73 |
RQL manipulates variables that are instances of entities. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
74 |
Each entity has its own type which are used in backend to improve the query |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
75 |
execution plan. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
76 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
77 |
Restrictions |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
78 |
```````````` |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
79 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
80 |
They are conditions used to limit the perimeter of the result set. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
81 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
82 |
Relations |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
83 |
````````` |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
84 |
A relation is a `3-expression` defined as follows: |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
85 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
86 |
.. image:: Graph-ex.gif |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
87 |
:alt: <subject> <predicate> <object> |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
88 |
:align: center |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
89 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
90 |
A RQL relation contains three components: |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
91 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
92 |
* the subject, which is an entity type |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
93 |
* the predicate, which is an oriented graph |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
94 |
* the object, which is either an attribute or a relation to another entity |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
95 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
96 |
In cubicweb, the term `relation` is often found without ambiguity instead of `predicate`. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
97 |
This predicate is also known as the `property` of the triple in `RDF concepts`_ |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
98 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
99 |
A relation is always expressed in the order: subject, predicate, object. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
100 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
101 |
It's important to determine if entity type is subject or object to construct a |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
102 |
valid expression. An inversion subject/object is equivalent to an RQL error |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
103 |
since the supposed relation cannot be found in schema. If you don't have access |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
104 |
to the code, you could find the order by looking at the schema image in manager |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
105 |
views (the subject is located at the beginning of the arrow). |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
106 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
107 |
.. _SQL: http://www.firstsql.com/tutor5.htm |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
108 |
.. _RDF concepts: http://www.w3.org/TR/rdf-concepts/ |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
109 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
110 |
Cardinality |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
111 |
``````````` |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
112 |
XXX |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
113 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
114 |
Cardinality is an important concept to model your business rules. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
115 |
They determine nu./tutorials/advanced/index.rst |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
116 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
117 |
Please refer to the `datamodel definitions`_ for a deep understanding. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
118 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
119 |
`Relations`_ are always expressed by cardinality rules (`**` by default) |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
120 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
121 |
.. _datamodel definitions: ./devrepo/datamodel/definition.rst |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
122 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
123 |
Transaction |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
124 |
``````````` |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
125 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
126 |
RQL supports notion of **transactions**; i.e. sequences of RQL statements |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
127 |
without invoking security hooks of the instance's schema. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
128 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
129 |
When you're ready to make persistent the changes, you have to *commit* the |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
130 |
modification in calling `commit()`. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
131 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
132 |
If an error is found (typically in raising a ValidationError), you have the |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
133 |
possibility to roll back the transaction in invoking `rollback()` function; i.e |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
134 |
to come back to the initial state of the transaction. |
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
135 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
136 |
Please, refer to the :ref:`Migration` chapter if you want more details. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
137 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
138 |
|
5924
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
139 |
|
b218df942dd4
[book] update rql documentation and some erroneous/deprecated examples
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5400
diff
changeset
|
140 |
.. _Versa: http://wiki.xml3k.org/Versa |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
141 |
.. _SPARQL: http://www.w3.org/TR/rdf-sparql-query/ |