Project

General

Profile

Schema » History » Version 11

susmit shannigrahi, 04/02/2015 09:34 AM

1 1 Alison Craig
Schema
2
======
3 2 Alison Craig
Within the <a href="http://www.postgresql.org">PostgreSQL</a>, the database is divided by Tables. For the CMIP5 dataset, datasets have differing variables (and, therefore, differing Name schemes) from the Models the dataset is based upon. As such, each Table is determined by the Model. From there, we have the Columns which are each component of the Name. And, finally, the Rows are the individual Name entries for each dataset.
4
5
While a tempting optimization would be to combine Models with the same Name schemes, it is unknown if the Name schemes will always be the same. As such, it is recommended they stay separate.
6
7 9 Alison Craig
The Tables include a first Column of the full URI NDN Name. All Columns use <a href="http://named-data.net/doc/ndn-tlv/name.html#ndn-uri-scheme" alt="NDN URI scheme">URI</a> (String) types. 
8 7 Alison Craig
9 4 susmit shannigrahi
<b>Example</b><br>
10 10 Alison Craig
<b><i>Table A (for CIMP5)</i></b><br>
11 11 susmit shannigrahi
<tt>Name|sha256|Activity|Product|Organization|Model|Experiment|Frequency|modeling realm|variable name|ensemble member</tt>
12 10 Alison Craig
13
14
<b><i>Table B (for CESM)</i></b><br>
15 11 susmit shannigrahi
<tt>Name|sha256|Activity|Product|Organization|Model|Ensemble|Experiment|Sample Granularity|Start Time</tt>
16 10 Alison Craig
17
18
<b><i>Table C (For GigaLES)</i></b><br>
19 11 susmit shannigrahi
<tt>Name|sha256|Activity|Product|Organization|Model|field campaign|optical properties for radiation|grid resolution|output type|timestamp|</tt>
20 4 susmit shannigrahi
21 2 Alison Craig
22
----
23
24
On a search, the standard queries are defined as "[field]=[search]" with [field] being a Column and [search] being any exact matches in those Columns. These are comma-seperated lists, so we can continue to use <tt>JOIN</tt>s to narrow the results down. If <i>any</i> of the fields are Model, then we can identify the Table and eliminate a large portion of the search; Model was chosen as it was observed to be the most commonly and first used for narrowing down results by users.
25
26
In the autocomplete query case, the query follows a "?=[search]" pattern. The question mark indicates we do not know what to look for, and the search is what has already been entered by the user. The autocomplete can be used with the standard query to do an initial narrowing down of results, prior to doing a regular expression search for what can come next.