Query » History » Version 17
Anonymous, 03/04/2015 01:28 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 | 15 | Alison Craig | with a response of |
8 | 6 | Alison Craig | |
9 | 15 | Alison Craig | /<prefix>/query/<query-parameters>/output |
10 | |||
11 | |||
12 | 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> |
13 | 1 | Alison Craig | |
14 | In response, the Query backend of the Catalog will make Data available that includes a list of names that match the query. |
||
15 | |||
16 | ---- |
||
17 | |||
18 | 13 | Alison Craig | <b>JSON Schemas</b> |
19 | 14 | Alison Craig | |
20 | 13 | Alison Craig | <b><i>JSON Query</i></b> |
21 | 15 | Alison Craig | The query name is formatted JSON stored in the query-parameters of the Interest: |
22 | 1 | Alison Craig | |
23 | 15 | Alison Craig | /<prefix>/query/<query-parameters> |
24 | |||
25 | 13 | Alison Craig | ``` |
26 | 1 | Alison Craig | |
27 | 13 | Alison Craig | { |
28 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
29 | 16 | Anonymous | "title": "catalog query", |
30 | "type": "object", |
||
31 | 13 | Alison Craig | "items": { |
32 | 16 | Anonymous | "title": "query parameters", |
33 | 13 | Alison Craig | "type": "object", |
34 | "properties": { |
||
35 | 16 | Anonymous | "name": { |
36 | 13 | Alison Craig | "type": "string" |
37 | }, |
||
38 | 16 | Anonymous | "activity": { |
39 | 13 | Alison Craig | "type": "string" |
40 | }, |
||
41 | 16 | Anonymous | "product": { |
42 | 13 | Alison Craig | "type": "string" |
43 | }, |
||
44 | 16 | Anonymous | "organization": { |
45 | 13 | Alison Craig | "type": "string" |
46 | }, |
||
47 | 16 | Anonymous | "model": { |
48 | 13 | Alison Craig | "type": "string" |
49 | }, |
||
50 | 16 | Anonymous | "experiment": { |
51 | 13 | Alison Craig | "type": "string" |
52 | }, |
||
53 | 16 | Anonymous | "frequency": { |
54 | 13 | Alison Craig | "type": "string" |
55 | }, |
||
56 | 1 | Alison Craig | "modeling realm": { |
57 | "type": "string" |
||
58 | }, |
||
59 | "variable name": { |
||
60 | "type": "string" |
||
61 | 13 | Alison Craig | }, |
62 | "ensemble member": { |
||
63 | "type": "string" |
||
64 | }, |
||
65 | 16 | Anonymous | "ensemble": { |
66 | 13 | Alison Craig | "type": "string" |
67 | 16 | Anonymous | }, |
68 | 17 | Anonymous | "sample granularity": { |
69 | 13 | Alison Craig | "type": "string" |
70 | 16 | Anonymous | }, |
71 | "start time": { |
||
72 | 13 | Alison Craig | "type": "string" |
73 | 16 | Anonymous | }, |
74 | "field campaign": { |
||
75 | 13 | Alison Craig | "type": "string" |
76 | }, |
||
77 | "optical properties for radiation": { |
||
78 | "type": "string" |
||
79 | }, |
||
80 | "grid resolution": { |
||
81 | "type": "string" |
||
82 | 16 | Anonymous | }, |
83 | "output type": { |
||
84 | 13 | Alison Craig | "type": "string" |
85 | }, |
||
86 | "timestamp": { |
||
87 | "type": "string" |
||
88 | }, |
||
89 | "?": { |
||
90 | "description": "Autocomplete search field" |
||
91 | "type": "string" |
||
92 | } |
||
93 | }, |
||
94 | "required": [] |
||
95 | 1 | Alison Craig | } |
96 | } |
||
97 | |||
98 | ``` |
||
99 | |||
100 | |||
101 | 15 | Alison Craig | <b><i>Query Results Data JSON</b></i> |
102 | With the query results, the Data returns the Query Results by using the query parameters (above) in the Name produced and a JSON Blob for the results: |
||
103 | 1 | Alison Craig | |
104 | 15 | Alison Craig | /<prefix>/query/<query-parameters>/output |
105 | |||
106 | |||
107 | |||
108 | ``` |
||
109 | { |
||
110 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
111 | "title": "Catalog Query Result", |
||
112 | "type": "array", |
||
113 | "items": { |
||
114 | "title": "QueryResults", |
||
115 | "type": "object", |
||
116 | "properties": { |
||
117 | "Length": { |
||
118 | "description": "Total number of results" |
||
119 | "type": "integer" |
||
120 | }, |
||
121 | "View": { |
||
122 | "minimum": 2 |
||
123 | "maximum": 2 |
||
124 | "description": "Pair of integers indicating which subset of the results we are receiving (first value being the lower index, second the upper index)" |
||
125 | "type": Array |
||
126 | }, |
||
127 | "Results": { |
||
128 | "description": "List of NDN names" |
||
129 | "type": Array |
||
130 | }, |
||
131 | "Next": { |
||
132 | "description": "Autocomplete search potential next field(s)" |
||
133 | "type": Array |
||
134 | } |
||
135 | }, |
||
136 | "required": [Length,View] |
||
137 | }, |
||
138 | |||
139 | } |
||
140 | ``` |