]> matita.cs.unibo.it Git - helm.git/blob - helm/mathql/homepage/whatsnew.html
- information about the database map added in whatsnew.html
[helm.git] / helm / mathql / homepage / whatsnew.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4   <title>MathQL</title>
5                                                                         
6           
7   <meta http-equiv="content-type"
8  content="text/html; charset=ISO-8859-1">
9                                                
10   <meta name="author" content="Ferruccio Guidi">
11                                                
12   <meta name="description" content="MathQL Home Page">
13 </head>
14   <body>
15                       
16 <h1 align="center">MathQL-1</h1>
17                    
18 <h2 align="center">A query language for RDF metadata</h2>
19                        
20 <table cellpadding="10" cellspacing="2" border="0" width="95%"
21  bgcolor="#ffffff">
22               <tbody>
23                 <tr>
24                   <td valign="top" align="left">                        
25                                                            
26       <ul>
27                     <li><a href="index.html">Forward</a><br>
28                  </li>
29                                                                         
30                       
31       </ul>
32                                                                          
33      
34       <ul>
35                   <li><a href="features.html">Features</a></li>
36                                        
37       </ul>
38                                        
39       <ul>
40              <li>What's new<br>
41              </li>
42                                                                          
43      
44       </ul>
45                                                                          
46      
47       <ul>
48                   <li><a href="documentation.html">Documentation</a></li>
49                                                                         
50                       
51       </ul>
52                                                                        
53       <ul>
54                  <li><a href="implementation.html">Implementation</a><br>
55                  </li>
56                                                                        
57       </ul>
58                                                                        
59       <ul>
60                  <li><a href="authors.html">The authors</a><br>
61                  </li>
62                                                                         
63                       
64       </ul>
65                                                                        
66       <ul>
67                  <li><a href="links.html">Links</a><br>
68                  </li>
69                                                                        
70       </ul>
71                <br>
72                   </td>
73                   <td valign="top">                                     
74                          
75       <div align="right"><b>What's new</b><br>
76         <br>
77                </div>
78    This page reports the newly <a href="implementation.html">implemented</a> 
79  features of MathQL-1 that are not included in the official <a
80  href="documentation.html">documentation</a> yet.<br>
81            <br>
82       <hr width="100%" size="2">
83       <div align="center">
84       <h3>  Changes and additions to MathQL-1 operators:</h3>
85       </div>
86                
87       <ul>
88           <li>The <b>add</b> operator now accepts a syntax extension allowing
89  to specify more than one explicit attribute group.</li>
90                
91       </ul>
92                
93       <blockquote>The syntax now is:</blockquote>
94                
95       <blockquote>&lt;query&gt; := "add" [ "distr" ]? [ &lt;groups&gt; |
96 &lt;avar&gt; ] "in" &lt;query&gt;<br>
97   &lt;groups&gt; := &lt;group&gt; [ ";" &lt;group&gt; ]*<br>
98   &lt;group&gt; := &lt;attribute&gt; [ "," &lt;attribute&gt; ]*<br>
99   &lt;attribute&gt; := &lt;value&gt; "as" &lt;path&gt;<br>
100           <br>
101   Examples:<br>
102   the query <b>add "1" as "a", "2" as "b" in subj "A"</b> gives the result
103          <b>"A" attr {"a"="1"; "b"="2"}</b> while<br>
104   the query <b>add "1" as "a"; "2" as "b" in subj "A"</b> gives the result
105          <b>"A" attr {"a"="1"}, {"b"="2"}</b>.<br>
106         </blockquote>
107                
108       <ul>
109           <li>The new <b>align</b> operator takes an integer <i>i</i> (represented
110  as a string), a multiple string value <i>v</i> and returns the same <i>v</i>
111  where each string with length <i>n &lt; i</i> is prefixed with <i>i - n</i>
112  spaces. The syntax of the add operator is:</li>
113                
114       </ul>
115                
116       <blockquote>&lt;value&gt; := "align" &lt;string&gt; "in" &lt;value&gt;<br>
117           <br>
118   This operators aligns strings containing numbers so that their alphabetic
119  order agrees with their numeric order.<br>
120         </blockquote>
121                           
122       <ul>
123           <li>The <b>intersect</b> operator now intersects the attribute
124 groups  of the matching subject strings set-theoretically rather than making
125 their  "Cartesian product". This semantics reduces the computational costs
126 and makes  intersection the dual of union.</li>
127                
128       </ul>
129                
130       <ul>
131           <li>The <b>property</b> operator now accepts more than one <b>isfalse</b>
132  clause to increase the complexity of the constraint condition used to filter
133  the raw query results. This feature is exploited in the queries produced 
134 by the           <a href="implementation.html">HELM query generator</a>.</li>
135                
136       </ul>
137       <br>
138       <hr width="100%" size="2">
139       <div align="center">
140       <h3>The PostgreSQL database map:</h3>
141       </div>
142 The <b>PostgreSQL database map</b> is a file describing how the MathQL-1
143 interpreter must interact with the underlying PostgreSQL database, when it
144 is run in Postgres mode. Currently this file contains the following information:<br>
145       <ul>
146         <li>the <i>database connection string</i> to be used when the interpreter
147 opens a connection with the database;</li>
148       </ul>
149       <ul>
150         <li>the <i>map</i> describing the correspondence between the metadata
151 access paths used by the <i>property</i> operator and the fields of the database
152 tables.</li>
153       </ul>
154 The format of the file is textual and line oriented, but a corresponding
155 XML syntax will be provided soon.<br>
156 The first line must contain the database connection string and the subsequent
157 lines contain the map with the following syntax:<br>
158       <ul>
159         <li>blank lines: ignored (used for separation);</li>
160       </ul>
161       <ul>
162         <li>lines starting with a # followed by a space: ignored (used for
163 comments);<br>
164         </li>
165       </ul>
166       <ul>
167         <li>&lt;table_name&gt;&nbsp; &lt;field_name&gt; &nbsp;"&lt;-"&nbsp;
168 [&nbsp; &lt;path_component&gt; &nbsp;]*<br>
169         </li>
170       </ul>
171       <blockquote>the information about the metadata denoted by the given
172 path is found in the given field of the given table in the database. For
173 example the line:<br>
174         <br>
175 refobj&nbsp; h_occurrence &nbsp;&lt;-&nbsp; refObj &nbsp;h:occurrence<br>
176         <br>
177 tells that the metadata denoted by the path <b>/"refObj"/"h:occurrence"</b>
178 is found in the field "h_occurrence" of the table "refobj" in the database,
179 while:<br>
180         <br>
181 refobj&nbsp; source &nbsp;&lt;-<br>
182         <br>
183 tells that the metadata denoted by the path <b>/</b> is found in the field
184 "source" of the table "refobj" in the database;<br>
185       </blockquote>
186       <ul>
187         <li>&lt;table_name&gt;&nbsp; &lt;field_name&gt; &nbsp;"&lt;+"&nbsp;
188 [&nbsp; &lt;path_component&gt; &nbsp;]*<br>
189    </li>
190       </ul>
191       <blockquote>same as the previous but defines a default table and field
192 for the given path. This is used to force the interpreter to query a particular
193 table when the information denoted by a path can be found in more than one
194 table and field. For example:<br>
195         <br>
196 objectname&nbsp; source &nbsp;&lt;+<br>
197 refobj&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;source&nbsp; &lt;-<br>
198 refrel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; source&nbsp; &lt;-<br>
199 refsort&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;source &nbsp;&lt;-<br>
200         <br>
201 tells that the metadata denoted by the path <b>/</b> is found in the "source"
202 field of the "objectname", "refobj", "refrel" and "refsort" tables, and that
203 the first choice is preferred;<br>
204       </blockquote>
205       <ul>
206         <li>&lt;table_name&gt; &nbsp;"&lt;-" [ &lt;path_component&gt; &nbsp;]*</li>
207       </ul>
208       <blockquote>the given path denotes a structured metadata whose components
209 are found in the fields of the given table. For example:<br>
210         <br>
211 refobj &nbsp;&lt;- &nbsp;refObj<br>
212         <br>
213 tells that the path <b>/"refObj"</b> denotes a structured metadata whose
214 components are found in the fields of the table "refobj"; <br>
215       </blockquote>
216       <ul>
217         <li>&lt;table_name&gt; &nbsp;"&lt;+" [ &lt;path_component&gt; &nbsp;]*</li>
218       </ul>
219       <blockquote>same as the previous but tells that this is a default &nbsp;correspondence;
220         <br>
221       </blockquote>
222       <ul>
223         <li>&lt;virtual_table_name&gt; &nbsp;"-&gt;" &lt;concrete_table_name&gt;</li>
224       </ul>
225       <blockquote>defines a correspondence between a virtual table name an
226 a concrete table name. All the &lt;table_name&gt; entries represent virtual
227 table names that are mapped to concrete table names using the identity function
228 unless a particular mapping is defined for them using the above construction.
229 This mechanism allows to define several set of metadata on the same database
230 table as in:<br>
231         <br>
232 refobj&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;source&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
233 &nbsp; &nbsp; &nbsp; &nbsp;&lt;-<br>
234 refobj&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;h_occurrence &nbsp;&lt;-
235 &nbsp;refObj&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; h:occurrence<br>
236 backpointer &nbsp;source&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;
237 &nbsp; &lt;- &nbsp;backPointer&nbsp; h:occurrence<br>
238 backpointer &nbsp;h_occurrence&nbsp; &lt;-<br>
239 backpointer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
240 &nbsp; &nbsp; &nbsp; &nbsp;-&gt; &nbsp;refobj<br>
241       </blockquote>
242       <blockquote>which defines four path accessing two virtual tables ("refobj"
243 and "backpointer") and then maps these tables in a single concrete table;<br>
244       </blockquote>
245       <ul>
246         <li>"-&gt;" <br>
247         </li>
248       </ul>
249       <blockquote>a line like this must end the map file.&nbsp; <br>
250       </blockquote>
251 Here you can find the <a
252  href="http://www.cs.unibo.it/cgi-bin/cvsweb/helm/mathql_db_map.txt">current
253 version of PostgreSQL database map for HELM</a>.<br>
254       <br>
255       <b>How does the interpreter use the map?</b> The map file is read during
256 the interpreter initialization process from the file pointed by the MATHQL_DB_MAP
257 environment variable and is used during the execution of each <i>property</i>
258 operation in the issued queries.When executing a <i>property</i> operation,
259 the interpreter uses the map to find the smallest set of database tables
260 containing the information required by the given access paths and then queries
261 these tables to obtain the wanted information. <br>
262                       </td>
263           </tr>
264                        
265   </tbody>      
266 </table>
267       <br>
268 </body>
269 </html>