1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7 <meta http-equiv="content-type"
8 content="text/html; charset=ISO-8859-1">
10 <meta name="author" content="Ferruccio Guidi">
12 <meta name="description" content="MathQL Home Page">
16 <h1 align="center">MathQL-1</h1>
18 <h2 align="center">A query language for RDF metadata</h2>
20 <table cellpadding="10" cellspacing="2" border="0" width="95%"
24 <td valign="top" align="left">
28 <li><a href="index.html">Forward</a><br>
36 <li><a href="features.html">Features</a></li>
49 <li><a href="documentation.html">Documentation</a></li>
56 <li><a href="implementation.html">Implementation</a><br>
64 <li><a href="authors.html">The authors</a><br>
72 <li><a href="links.html">Links</a><br>
81 <div align="right"><b>What's new</b><br>
84 This page reports the newly <a href="implementation.html">implemented</a>
85 features of MathQL-1 that are not included in the official <a
86 href="documentation.html">documentation</a> yet.<br>
89 <hr width="100%" size="2"><br>
90 <h3 align="center"><img
91 src="http://www.cs.unibo.it/%7Efguidi/download/bbb11.png" alt="New"
92 width="38" height="37" align="top">
93 MathQL-1 version 4 now under development ...</h3>
94 We are now implementing the new unstable version of MathQL-1 (i.e. MathQL-1.4).
95 The main goals of this release are:<br>
97 <li>A clear distinction between the core language and the auxiliary
98 functions, which should be part of an extensible library.<br>
102 <li>The elimination of the explicit casts between the <query>
103 and <value> types in queries.<br>
107 <li>A tight connection with a query generator (i.e <a
108 href="implementation.html">HELM query generator</a>).<br>
111 <hr width="100%" size="2">
113 <h3>Changes and additions to MathQL-1 operators:</h3>
117 <li>The <b>add</b> operator now accepts a syntax extension allowing
118 to specify more than one explicit attribute group.</li>
122 <blockquote>The syntax now is:</blockquote>
124 <blockquote><query> := "add" [ "distr" ]? [ <groups> |
125 <avar> ] "in" <query><br>
126 <groups> := <group> [ ";" <group> ]*<br>
127 <group> := <attribute> [ "," <attribute> ]*<br>
128 <attribute> := <value> "as" <path><br>
131 the query <b>add "1" as "a", "2" as "b" in subj "A"</b> gives the result
132 <b>"A" attr {"a"="1"; "b"="2"}</b> while<br>
133 the query <b>add "1" as "a"; "2" as "b" in subj "A"</b> gives the result
134 <b>"A" attr {"a"="1"}, {"b"="2"}</b>.<br>
138 <li>The new <b>align</b> operator takes an integer <i>i</i> (represented
139 as a string), a multiple string value <i>v</i> and returns the same <i>v</i>
140 where each string with length <i>n < i</i> is prefixed with <i>i - n</i>
141 spaces. The syntax of the add operator is:</li>
145 <blockquote><value> := "align" <string> "in" <value><br>
147 This operators aligns strings containing numbers so that their alphabetic
148 order agrees with their numeric order.<br>
152 <li>The <b>intersect</b> operator now intersects the attribute
153 groups of the matching subject strings set-theoretically rather than making
154 their "Cartesian product". This semantics reduces the computational costs
155 and makes intersection the dual of union.</li>
160 <li>The <b>property</b> operator now accepts more than one <b>isfalse</b>
161 clause to increase the complexity of the constraint condition used to filter
162 the raw query results. This feature is exploited in the queries produced
163 by the <a href="implementation.html">HELM query generator</a>.</li>
168 <hr width="100%" size="2">
170 <h3>The PostgreSQL database map:</h3>
172 The <b>PostgreSQL database map</b> is a file describing how the MathQL-1
173 interpreter must interact with the underlying PostgreSQL database, when
174 it is run in Postgres mode. Currently this file contains the following information:<br>
177 <li>the <i>database connection string</i> to be used when the interpreter
178 opens a connection with the database;</li>
183 <li>the <i>map</i> describing the correspondence between the metadata
184 access paths used by the <i>property</i> operator and the fields of the
185 database tables.</li>
188 The format of the file is textual and line oriented, but a corresponding
189 XML syntax will be provided soon.<br>
190 The first line must contain the database connection string and the subsequent
191 lines contain the map with the following syntax:<br>
194 <li>blank lines: ignored (used for separation);</li>
199 <li>lines starting with a # followed by a space: ignored (used
206 <li><table_name> <field_name> "<-"
207 [ <path_component> ]*<br>
212 <blockquote>the information about the metadata denoted by the given
213 path is found in the given field of the given table in the database. For
214 example the line:<br>
216 refobj h_occurrence <- refObj h:occurrence<br>
218 tells that the metadata denoted by the path <b>/"refObj"/"h:occurrence"</b>
219 is found in the field "h_occurrence" of the table "refobj" in the database,
222 refobj source <-<br>
224 tells that the metadata denoted by the path <b>/</b> is found in the field
225 "source" of the table "refobj" in the database;<br>
229 <li><table_name> <field_name> "<+"
230 [ <path_component> ]*<br>
235 <blockquote>same as the previous but defines a default table and field
236 for the given path. This is used to force the interpreter to query a particular
237 table when the information denoted by a path can be found in more than one
238 table and field. For example:<br>
240 objectname source <+<br>
241 refobj source <-<br>
242 refrel source
244 refsort source <-<br>
246 tells that the metadata denoted by the path <b>/</b> is found in the "source"
247 field of the "objectname", "refobj", "refrel" and "refsort" tables, and
248 that the first choice is preferred;<br>
252 <li><table_name> "<-" [ <path_component> ]*</li>
256 <blockquote>the given path denotes a structured metadata whose components
257 are found in the fields of the given table. For example:<br>
259 refobj <- refObj<br>
261 tells that the path <b>/"refObj"</b> denotes a structured metadata whose
262 components are found in the fields of the table "refobj"; <br>
266 <li><table_name> "<+" [ <path_component> ]*</li>
270 <blockquote>same as the previous but tells that this is a default correspondence;
275 <li><virtual_table_name> "->" <concrete_table_name></li>
279 <blockquote>defines a correspondence between a virtual table name an
280 a concrete table name. All the <table_name> entries represent virtual
281 table names that are mapped to concrete table names using the identity function
282 unless a particular mapping is defined for them using the above construction.
283 This mechanism allows to define several set of metadata on the same database
286 refobj source
287 <-<br>
288 refobj h_occurrence <-
289 refObj h:occurrence<br>
290 backpointer source
291 <- backPointer h:occurrence<br>
292 backpointer h_occurrence <-<br>
293 backpointer
294 -> refobj<br>
297 <blockquote>which defines four path accessing two virtual tables ("refobj"
298 and "backpointer") and then maps these tables in a single concrete table;<br>
307 <blockquote>a line like this must end the map file. <br>
309 Here you can find the <a
310 href="http://www.cs.unibo.it/cgi-bin/cvsweb/helm/mathql_db_map.txt">current
311 version of PostgreSQL database map for HELM</a>.<br>
313 <b>How does the interpreter use the map?</b> The map file is read
314 during the interpreter initialization process from the file pointed by the
315 MATHQL_DB_MAP environment variable and is used during the execution of each
316 <i>property</i> operation in the issued queries.When executing a <i>property</i>
317 operation, the interpreter uses the map to find the smallest set of database
318 tables containing the information required by the given access paths and then
319 queries these tables to obtain the wanted information. <br>