# HG changeset patch # User Nicolas Chauvat <nicolas.chauvat@logilab.fr> # Date 1255619810 -7200 # Thu Oct 15 17:16:50 2009 +0200 # Node ID 02cc9590f96449745224efd92d59905fb29de3cf # Parent eff0513d21e855e55ab27d0ef4662249c200a26d [doc] document ILIKE operator diff --git a/doc/specifications_en.txt b/doc/specifications_en.txt --- a/doc/specifications_en.txt +++ b/doc/specifications_en.txt @@ -1,6 +1,6 @@ .. -*- coding: utf-8 -*- - + =================================================== Specification "Relations Query Language" (Hercules) =================================================== @@ -17,7 +17,7 @@ language not to see virtually no difference between an attribute and a relation). -RQL is inspired by SQL but is the highest level. A knowledge of the +RQL is inspired by SQL but is the highest level. A knowledge of the `CubicWeb` schema defining the application is necessary. Comparison with existing languages @@ -27,8 +27,8 @@ ``` RQL builds on the features of SQL but is at a higher level (the current implementation of RQL generates SQL). For that it is limited -to the way of browsing relations and introduces variables. -The user does not need to know the model underlying SQL, but the `CubicWeb` +to the way of browsing relations and introduces variables. +The user does not need to know the model underlying SQL, but the `CubicWeb` scheam defining the application. Versa @@ -36,10 +36,10 @@ Should I look in more detail, but here is already some ideas for the moment ... Versa_ is the language most similar to what we wanted to do, but the model underlying data being RDF, there is some -number of things such as namespaces or handling of the RDF types which +number of things such as namespaces or handling of the RDF types which does not interest us. On the functionality level, Versa_ is very comprehensive including through many functions of conversion and basic types manipulation, -which may need to be guided at one time or another. +which may need to be guided at one time or another. Finally, the syntax is a little esoteric. See also @@ -156,7 +156,7 @@ The restriction can define variables used in assignments. -Caution, if a restriction is specified, the insertion is done for +Caution, if a restriction is specified, the insertion is done for *each line results returned by the restriction*. - *Insert a new person named 'foo'* @@ -170,7 +170,7 @@ INSERT Person X, Person Y: X name 'foo', Y name 'nice', X friend Y -- *Insert a new person named 'foo' and a 'friend' relation with an existing +- *Insert a new person named 'foo' and a 'friend' relation with an existing person called 'nice'* :: @@ -189,7 +189,7 @@ SET X name 'bar', X first_name 'original' where X is Person X name 'foo' -- *Insert a relation of type 'know' between objects linked by +- *Insert a relation of type 'know' between objects linked by the relation of type 'friend'* :: @@ -227,7 +227,7 @@ DISTINCT, INSERT, SET, DELETE, WHERE, AND, OR, NOT - IN, LIKE, + IN, LIKE, ILIKE, TRUE, FALSE, NULL, TODAY, NOW GROUPBY, ORDERBY, ASC, DESC @@ -289,21 +289,23 @@ ```````````````````` :: - =, <, <=, >=, > = ~, IN, LIKE + =, <, <=, >=, > = ~, IN, LIKE, ILIKE * The operator `=` is the default operator. * The operator `LIKE` equivalent to `~=` can be used with the - special character `%` in a string to indicate that the chain + special character `%` in a string to indicate that the chain must start or finish by a prefix/suffix: :: Any X WHERE X name =~ 'Th%' Any X WHERE X name LIKE '%lt' +* The operator `ILIKE` is a case-insensitive version of `LIKE`. + * The operator `IN` provides a list of possible values: :: - + Any X WHERE X name IN ( 'chauvat', 'fayolle', 'di mascio', 'thenault') @@ -410,7 +412,7 @@ relation ::= 'NOT'? VARIABLE R_TYPE COMP_OP? expression | 'NOT'? R_TYPE VARIABLE 'IN' '(' expression (',' expression)* ')' - + expression ::= var_or_func_or_const (MATH_OP var_or_func_or_const) * | '(' expression ')' @@ -423,7 +425,7 @@ # tokens LOGIC_OP ::= ',' | 'GOLD' | 'AND' MATH_OP ::= '+' | '-' | '/' | '*' - COMP_OP ::= '>' | '>=' | '=' | '<=' | '<' | '~=' | 'LIKE' + COMP_OP ::= '>' | '>=' | '=' | '<=' | '<' | '~=' | 'LIKE' | 'ILIKE' FUNCTION ::= 'MIN' | 'MAX' | 'SUM' | 'AVG' | 'COUNT' | 'upper' | 'LOWER' @@ -464,7 +466,7 @@ Identity ```````` -You can use the special relation `identity` in a query to +You can use the special relation `identity` in a query to add an identity constraint between two variables. This is equivalent to ``is`` in python:: @@ -480,7 +482,7 @@ Internal representation (syntactic tree) ---------------------------------------- -The tree research does not contain the selected variables +The tree research does not contain the selected variables (e.g. there is only what follows "WHERE"). The insertion tree does not contain the variables inserted or relations @@ -523,10 +525,10 @@ ------- - The current implementation does not support linking two relations of type - 'is' with a OR. I do not think that the negation is supported on this type + 'is' with a OR. I do not think that the negation is supported on this type of relation (XXX FIXME to be confirmed). -- Relations defining the variables must be left to those using them. +- Relations defining the variables must be left to those using them. For example:: Point P where P abs X, P ord Y, P value X+Y @@ -567,7 +569,7 @@ Document class Type <-> Document occurence_of Fiche class Type Sheet class Type <-> Form collection Collection class Type - + Therefore 1. becomes:: Document X where diff --git a/doc/specifications_fr.txt b/doc/specifications_fr.txt --- a/doc/specifications_fr.txt +++ b/doc/specifications_fr.txt @@ -224,13 +224,13 @@ Mots clés réservés ------------------ -Les mots clés ne sont pas sensibles à la casse. +Les mots clés ne sont pas sensibles à la casse. :: DISTINCT, INSERT, SET, DELETE, WHERE, AND, OR, NOT - IN, LIKE, + IN, LIKE, ILIKE, TRUE, FALSE, NULL, TODAY, NOW GROUPBY, ORDERBY, ASC, DESC @@ -292,17 +292,20 @@ ````````````````````````` :: - =, <, <=, >=, >, ~=, IN, LIKE + =, <, <=, >=, >, ~=, IN, LIKE, ILIKE * L'opérateur `=` est l'opérateur par défaut. -* L'opérateur `LIKE` équivalent à `~=` permet d'utiliser le caractère `%` dans - une chaine de caractère pour indiquer que la chaîne doit commencer ou terminer +* L'opérateur `LIKE` équivalent à `~=` permet d'utiliser le caractère `%` dans + une chaine de caractère pour indiquer que la chaîne doit commencer ou terminer par un préfix/suffixe:: - + Any X WHERE X nom ~= 'Th%' Any X WHERE X nom LIKE '%lt' +* L'opérateur `ILIKE` est une version de `LIKE` qui n'est pas sensible à la + casse. + * L'opérateur `IN` permet de donner une liste de valeurs possibles:: Any X WHERE X nom IN ('chauvat', 'fayolle', 'di mascio', 'thenault')