Project

General

Profile

Query » History » Revision 13

Revision 12 (Alison Craig, 03/04/2015 12:10 PM) → Revision 13/29 (Alison Craig, 03/04/2015 01:02 PM)

Query 
 ===== 
 The Query parameter are named as 

     /<prefix>/query/<query-parameters> 


 For the Query Protocol, the user will send query parameters as a JSON list, with the format: <tt>{[field1]=[search1],[field2]=[search2],?=[search3]</tt>} where <tt>field1</tt> and <tt>field2</tt> are Name components, <tt>?</tt> indicates an autocomplete search, and <tt>search*</tt> is what to use for searching on. <i>(See [[Schema]])</i> 

 In response, the Query backend of the Catalog will make Data available that includes a list of names that match the query. 

 ---- 

 <b>JSON Schemas</b> 
 <b><i>JSON Query</i></b> Formats</b> 
     Name|Activity|Product|Organization|Model|Experiment|Frequency|modeling realm|variable name|ensemble member 

 ``` Table B (for CESM) 
     Name|Activity|Product|Organization|Model|Ensemble|Experiment|Sample Granularity|Start Time 

 { Table C (For GigaLES) 
     "$schema": "http://json-schema.org/draft-04/schema#", 
     "title": "Catalog Query", 
     "type": "array", 
     "items": { 
         "title": "QueryField", 
         "type": "object", 
         "properties": { 
             "Name": { 
                 "type": "string" 
             }, 
             "Activity": { 
                 "type": "string" 
             }, 
             "Product": { 
                 "type": "string" 
             }, 
             "Organization": { 
                 "type": "string" 
             }, 
             "Model": { 
                 "type": "string" 
             }, 
             "Experiment": { 
                 "type": "string" 
             }, 
             "Frequency": { 
                 "type": "string" 
             }, 
             "modeling realm": { 
                 "type": "string" 
             }, 
             "variable name": { 
                 "type": "string" 
             }, 
             "ensemble member": { 
                 "type": "string" 
             }, 
             "Ensemble": { 
                 "type": "string" 
             },"Sample Granularity": { 
                 "type": "string" 
             },"Start Time": { 
                 "type": "string" 
             },"field campaign": { 
                 "type": "string" 
             }, 
             "optical Name|Activity|Product|Organization|Model|field campaign|optical properties for radiation": { 
                 "type": "string" 
             }, 
             "grid resolution": { 
                 "type": "string" 
             }"output type": { 
                 "type": "string" 
             }, 
             "timestamp": { 
                 "type": "string" 
             }, 
             "?": { 
                 "description": "Autocomplete search field" 
                 "type": "string" 
             } 
         }, 
         "required": [] 
     } 
 } 

 ``` 


 radiation|grid resolution|output type|timestamp| 



 <b><i>Query Results Data TLV</b></i> 

 The Query results TLV Data matches the Query Interest TLV. It has an added Blob (or payload) of the List of Names that match the Query. This Blob is defined by a second TLV such that we have either Name results: 
 <ul> 
   <li>Type = <tt>Name</tt> (0x07)</li> 
   <li>Length = 4000</tt></li> 
   <li>Value = Name</li> 
 </ul> 
 or next fields (with an autocomplete) 
 <ul> 
   <li>Type = <tt>[?]</tt></li> 
   <li>Length = 4000</tt></li> 
   <li>Value = Possible next field</li> 
 </ul>