Query » History » Version 14
Alison Craig, 03/04/2015 01:03 PM
1 | 1 | Alison Craig | Query |
---|---|---|---|
2 | ===== |
||
3 | 8 | Alison Craig | The Query parameter are named as |
4 | 9 | Alison Craig | |
5 | /<prefix>/query/<query-parameters> |
||
6 | |||
7 | 6 | Alison Craig | |
8 | 11 | Alison Craig | 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> |
9 | 1 | Alison Craig | |
10 | In response, the Query backend of the Catalog will make Data available that includes a list of names that match the query. |
||
11 | |||
12 | ---- |
||
13 | |||
14 | 13 | Alison Craig | <b>JSON Schemas</b> |
15 | 14 | Alison Craig | |
16 | 13 | Alison Craig | <b><i>JSON Query</i></b> |
17 | 1 | Alison Craig | |
18 | 13 | Alison Craig | ``` |
19 | 1 | Alison Craig | |
20 | 13 | Alison Craig | { |
21 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
22 | "title": "Catalog Query", |
||
23 | "type": "array", |
||
24 | "items": { |
||
25 | "title": "QueryField", |
||
26 | "type": "object", |
||
27 | "properties": { |
||
28 | "Name": { |
||
29 | "type": "string" |
||
30 | }, |
||
31 | "Activity": { |
||
32 | "type": "string" |
||
33 | }, |
||
34 | "Product": { |
||
35 | "type": "string" |
||
36 | }, |
||
37 | "Organization": { |
||
38 | "type": "string" |
||
39 | }, |
||
40 | "Model": { |
||
41 | "type": "string" |
||
42 | }, |
||
43 | "Experiment": { |
||
44 | "type": "string" |
||
45 | }, |
||
46 | "Frequency": { |
||
47 | "type": "string" |
||
48 | }, |
||
49 | "modeling realm": { |
||
50 | "type": "string" |
||
51 | }, |
||
52 | "variable name": { |
||
53 | "type": "string" |
||
54 | }, |
||
55 | "ensemble member": { |
||
56 | "type": "string" |
||
57 | }, |
||
58 | "Ensemble": { |
||
59 | "type": "string" |
||
60 | },"Sample Granularity": { |
||
61 | "type": "string" |
||
62 | },"Start Time": { |
||
63 | "type": "string" |
||
64 | },"field campaign": { |
||
65 | "type": "string" |
||
66 | }, |
||
67 | "optical properties for radiation": { |
||
68 | "type": "string" |
||
69 | }, |
||
70 | "grid resolution": { |
||
71 | "type": "string" |
||
72 | }"output type": { |
||
73 | "type": "string" |
||
74 | }, |
||
75 | "timestamp": { |
||
76 | "type": "string" |
||
77 | }, |
||
78 | "?": { |
||
79 | "description": "Autocomplete search field" |
||
80 | "type": "string" |
||
81 | } |
||
82 | }, |
||
83 | "required": [] |
||
84 | } |
||
85 | } |
||
86 | 12 | Alison Craig | |
87 | 13 | Alison Craig | ``` |
88 | 12 | Alison Craig | |
89 | 3 | Alison Craig | |
90 | <b><i>Query Results Data TLV</b></i> |
||
91 | 4 | Alison Craig | |
92 | 5 | Alison Craig | 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: |
93 | <ul> |
||
94 | <li>Type = <tt>Name</tt> (0x07)</li> |
||
95 | <li>Length = 4000</tt></li> |
||
96 | <li>Value = Name</li> |
||
97 | </ul> |
||
98 | or next fields (with an autocomplete) |
||
99 | <ul> |
||
100 | <li>Type = <tt>[?]</tt></li> |
||
101 | <li>Length = 4000</tt></li> |
||
102 | <li>Value = Possible next field</li> |
||
103 | </ul> |