Project

General

Profile

Query » History » Version 13

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