Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/repo_explore_content.html @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 <p> | |
2 Exploring an LTPDA repository is most easily achieved using the purpose-built graphical user interface. This | |
3 interace is accesible either from the LTPDA workbench, or via a toolbar button the workspace browser. | |
4 </p> | |
5 <p> | |
6 The figure belows shows the query dialog that appears through either interface: | |
7 <br> | |
8 <img src="images/querydialog.png" alt="LTPDA Query Builder" border="3"> | |
9 <br> | |
10 </p> | |
11 <p> | |
12 You can construct a query by use of the drop-down menus and buttons, then execute | |
13 the query to retreive a table of results, like the one shown below: | |
14 <br> | |
15 <img src="images/queryresults.png" alt="LTPDA Query Results" border="3"> | |
16 <br> | |
17 </p> | |
18 <p> | |
19 If the query dialog is launched from within the LTPDA Workbench, the results table has an | |
20 additional button which can be used to create constructor blocks on the current pipeline | |
21 corresponding to the selected records in the results table. | |
22 </p> | |
23 | |
24 | |
25 <!-- | |
26 <p> | |
27 Since an LTPDA repository is just a MySQL database, you can query the database using standard | |
28 SQL commands via any of the popular MySQL clients. In addition, the LTPDA toolbox provides a | |
29 simplified command that can be used to execute simple queries with only basic SQL knowledge. | |
30 </p> | |
31 <p> | |
32 The command is <tt>utils.mysql.dbquery</tt> and it can be used to perform various queries. | |
33 It takes the following input arguments: | |
34 <table border="1" cellpadding="2" width="30%" bgcolor="#DDDDDD"> | |
35 <tr valign="top"> | |
36 <td><tt>conn</tt></td><td>A database connection object</td> | |
37 </tr> | |
38 <tr valign="top"> | |
39 <td><tt>tablename</tt></td><td>The name of a table to search</td> | |
40 </tr> | |
41 <tr valign="top"> | |
42 <td><tt>query</tt></td><td>The query string written in MySQL SQL syntax</td> | |
43 </tr> | |
44 </table> | |
45 <br> | |
46 Examples of usage are: | |
47 | |
48 </p> | |
49 | |
50 <h2>Searching particular tables</h2> | |
51 | |
52 <p> | |
53 <div class="fragment"><pre> | |
54 >> info = utils.mysql.dbquery(conn, 'select * from objmeta where id>1000 and id<2000'); | |
55 >> info = utils.mysql.dbquery(conn, 'ao', 'id>1000 and id<2000'); | |
56 >> info = utils.mysql.dbquery_dbquery(conn, 'objmeta', 'name like "x12"'); | |
57 >> info = utils.mysql.dbquery(conn, 'users', 'username="aouser"'); | |
58 >> info = utils.mysql.dbquery(conn, 'collections', 'id=3'); | |
59 >> info = utils.mysql.dbquery(conn, 'collections', 'obj_ids="1,2"'); | |
60 >> info = utils.mysql.dbquery(conn, 'transactions', 'user_id=3'); | |
61 >> info = utils.mysql.dbquery(conn, 'transactions', 'obj_id=56'); | |
62 </pre></div> | |
63 </p> | |
64 | |
65 <h2>Retrieving a list of tables</h2> | |
66 | |
67 <p> | |
68 You can retrieve a list of the tables in a database with the call: | |
69 <div class="fragment"><pre> | |
70 >> info = utils.mysql.dbquery(conn) | |
71 </pre></div> | |
72 | |
73 </p> | |
74 | |
75 | |
76 <h2>High-level queries</h2> | |
77 <p> | |
78 Various standard queries are envisaged which ask typical questions, such as: | |
79 "Give me data for a particular signal spanning a particular time-span". | |
80 </p> | |
81 <p> | |
82 Formulating this question as an SQL query requires a good knowledge of the SQL | |
83 syntax used by MySQL. The query has to search across multiple tables in order | |
84 to gather the IDs of the objects that fulfill the query. For these standard questions, | |
85 high-level functions will be built which perform the query given some input information. This | |
86 avoids the user having to formulate complicated SQL statements. | |
87 </p> | |
88 <p> | |
89 The following high-level queries currently exist in the toolbox: | |
90 <table border="1" cellpadding="2" bgcolor="#DDDDDD"> | |
91 <tr valign="top"> | |
92 <td><tt>ltpda_getAOsInTimeSpan</tt></td><td>Retrieve particular AOs in the given time-span</td> | |
93 </tr> | |
94 </table> | |
95 </p> | |
96 | |
97 --> |