Changes between Version 20 and Version 21 of SemanticQuery
- Timestamp:
- Jan 2, 2014, 3:17:59 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SemanticQuery
v20 v21 84 84 85 85 Atoms, strings, integers and properties can be used in comparisons. 86 The language uses {{{/=, ==, >=, =<, <, > }}} and {{{~}}}.86 The language uses {{{/=, ==, >=, =<, <, >, ~}}} and {{{in}}}. 87 87 The results of comparisons are the same as in Erlang. 88 88 The resulting expressions can be combined by {{{and}}}, {{{or}}}, and {{{not}}} operators, and parentheses can be used, too. 89 89 The {{{~}}} operator is a regular expression matching operator, and it can be used anywhere, 90 where other binary comparison operators can be used. The same expressions can be used, which can be used in the {{{re}}} module. 90 where other binary comparison operators can be used. The same expressions can be used, which can be used in the {{{re}}} module. 91 The {{{in}}} operator is similar to the {{{in}}} operator defined in SQL. To illustrate its usage, consider the following 2 semantic queries, 92 which are semantically equivalent with each other. 93 * mods.funs[name = a or name = b or name = c] 94 * mods.funs[name in |a,b,c|] 91 95 92 96 The operator precedence for the filters is as follows: … … 95 99 ||{{{not}}} ||unary || 96 100 ||{{{/=, ==, >=, =<, <, >, =:=, =/=, ~}}} ||left associative || 101 ||{{{in}}} ||left associative || 97 102 ||{{{and}}} ||left associative || 98 103 ||{{{or}}} ||left associative || … … 111 116 }}} 112 117 118 ''Example:'' you may be interested in all the module, whose name equals with one element of the following set : {a,b,c} 119 {{{ 120 mods[ name in |a,b,c| ] 121 }}} 113 122 114 123 ==== Embedded queries ====