Revision 3775
Added by Jing Tao over 16 years ago
docs/user/metacatquery.html | ||
---|---|---|
46 | 46 |
<pathquery version="1.0"> |
47 | 47 |
<meta_file_id>unspecified</meta_file_id> |
48 | 48 |
<querytitle>unspecified</querytitle> |
49 |
<returnfield>resource/dataset/originator/individualName/surName</returnfield> |
|
50 |
<returnfield>resource/dataset/originator/individualName/givenName</returnfield> |
|
51 |
<returnfield>resource/dataset/keywordInfo/keyword</returnfield> |
|
52 |
<returndoctype></returndoctype> |
|
49 |
<returnfield>dataset/title</returnfield> |
|
50 |
<returnfield>keyword</returnfield> |
|
51 |
<returnfield>originator/individualName/surName</returnfield> |
|
52 |
<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype> |
|
53 |
<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype> |
|
53 | 54 |
<querygroup operator="UNION"> |
54 | 55 |
<queryterm casesensitive="false" searchmode="contains"> |
55 |
<value>%</value> |
|
56 |
<value>Datos</value> |
|
57 |
<pathexpr>dataset/title</pathexpr> |
|
56 | 58 |
</queryterm> |
57 | 59 |
<queryterm casesensitive="false" searchmode="contains"> |
58 |
<value>-//NCEAS//resource//EN</value>
|
|
59 |
<pathexpr>returndoc</pathexpr>
|
|
60 |
<value>plant</value>
|
|
61 |
<pathexpr>keyword</pathexpr>
|
|
60 | 62 |
</queryterm> |
61 |
<queryterm casesensitive="false" searchmode="contains"> |
|
62 |
<value>-//NCEAS//eml-dataset//EN</value> |
|
63 |
<pathexpr>returndoc</pathexpr> |
|
64 |
</queryterm> |
|
65 | 63 |
</querygroup> |
66 |
</pathquery>
|
|
64 |
</pathquery> |
|
67 | 65 |
</pre> |
68 | 66 |
|
69 | 67 |
<p>The pathquery document was designed to be flexible enough to query specific |
... | ... | |
71 | 69 |
from a returned document are returned in the initial resultset. Each |
72 | 70 |
<returnfield> parameter specifies a field which the DB will return |
73 | 71 |
for any query hit. The returndoctype fields allows the client to limit the |
74 |
type of documents to be returned. If left blank, all document types are returned.
|
|
72 |
type of documents to be returned. If no returndoctype element , all document types are returned.
|
|
75 | 73 |
A <querygroup> creates an AND or an OR statement of the <queryterm>s |
76 | 74 |
in the group. The operator can be UNION or INTERSECT. A <queryterm> |
77 | 75 |
defines the actual field against which the query is being performed. The value |
... | ... | |
87 | 85 |
another XML document called a resultset document.<p> |
88 | 86 |
|
89 | 87 |
<pre> |
90 |
<resultset>
|
|
88 |
<resultset> |
|
91 | 89 |
<query> |
92 | 90 |
<pathquery version="1.0"> |
93 | 91 |
<meta_file_id>unspecified</meta_file_id> |
94 | 92 |
<querytitle>unspecified</querytitle> |
95 |
<returnfield>resource/dataset/originator/individualName/surName</returnfield> |
|
96 |
<returnfield>resource/dataset/originator/individualName/givenName</returnfield> |
|
97 |
<returnfield>resource/dataset/keywordInfo/keyword</returnfield> |
|
98 |
<returndoctype></returndoctype> |
|
93 |
<returnfield>dataset/title</returnfield> |
|
94 |
<returnfield>keyword</returnfield> |
|
95 |
<returnfield>originator/individualName/surName</returnfield> |
|
96 |
<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype> |
|
97 |
<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype> |
|
99 | 98 |
<querygroup operator="UNION"> |
100 |
<queryterm casesensitive="false" searchmode="contains"> |
|
101 |
<value>%</value> |
|
102 |
</queryterm> |
|
103 |
<queryterm casesensitive="false" searchmode="contains"> |
|
104 |
<value>-//NCEAS//resource//EN</value> |
|
105 |
<pathexpr>returndoc</pathexpr> |
|
106 |
</queryterm> |
|
107 |
<queryterm casesensitive="false" searchmode="contains"> |
|
108 |
<value>-//NCEAS//eml-dataset//EN</value> |
|
109 |
<pathexpr>returndoc</pathexpr> |
|
110 |
</queryterm> |
|
111 |
</querygroup> |
|
112 |
</pathquery> |
|
99 |
<queryterm casesensitive="false" searchmode="contains"> |
|
100 |
<value>Datos</value> |
|
101 |
<pathexpr>dataset/title</pathexpr> |
|
102 |
</queryterm> |
|
103 |
<queryterm casesensitive="false" searchmode="contains"> |
|
104 |
<value>plant</value> |
|
105 |
<pathexpr>keyword</pathexpr> |
|
106 |
</queryterm> |
|
107 |
</querygroup> |
|
108 |
</pathquery> |
|
113 | 109 |
</query> |
114 | 110 |
|
115 | 111 |
<document> |
116 | 112 |
<docid>nceas.44.1</docid> |
117 | 113 |
<docname>resource</docname> |
118 |
<doctype>-//NCEAS//resource//EN</doctype> |
|
119 |
<doctitle>Surgras1.txt</doctitle> |
|
114 |
<doctype>eml://ecoinformatics.org/eml-2.0.1</doctype> |
|
120 | 115 |
<createdate>2001-01-12 16:12:06.0</createdate> |
121 | 116 |
<updatedate>2001-01-12 16:12:06.0</updatedate> |
122 |
<param name="resource/dataset/keywordInfo/keyword">surfgrass</param> |
|
123 |
<param name="resource/dataset/keywordInfo/keyword">intertidal</param> |
|
124 |
<param name="resource/dataset/keywordInfo/keyword">Ventura</param> |
|
125 |
<param name="resource/dataset/keywordInfo/keyword">Los Angeles</param> |
|
126 |
<triple> |
|
127 |
<subject>nceas.46</subject> |
|
128 |
<relationship>provides table-entity information for package</relationship> |
|
129 |
<object>nceas.44</object> |
|
130 |
</triple> |
|
131 |
<triple> |
|
132 |
<subject>nceas.45</subject> |
|
133 |
<relationship>provides eml-physical information for Table</relationship> |
|
134 |
<object>nceas.46</object> |
|
135 |
</triple> |
|
136 |
<triple> |
|
137 |
<subject>nceas.47</subject> |
|
138 |
<relationship>provides access control rules for</relationship> |
|
139 |
<object>nceas.44</object> |
|
140 |
</triple> |
|
141 |
<triple> |
|
142 |
<subject>nceas.47</subject> |
|
143 |
<relationship>provides access control rules for</relationship> |
|
144 |
<object>nceas.45</object> |
|
145 |
</triple> |
|
146 |
<triple> |
|
147 |
<subject>nceas.47</subject> |
|
148 |
<relationship>provides access control rules for</relationship> |
|
149 |
<object>nceas.46</object> |
|
150 |
</triple> |
|
151 |
</document> |
|
117 |
<param name="dataset/title">Datos Meteorologicos</param> |
|
118 |
<param name="keyword">intertidal</param> |
|
119 |
<param name="originator/individualName/surName">Smith</param> |
|
120 |
</document> |
|
152 | 121 |
|
153 | 122 |
<document> |
154 | 123 |
<docid>nceas.42.1</docid> |
155 | 124 |
<docname>resource</docname> |
156 |
<doctype>-//NCEAS//resource//EN</doctype> |
|
157 |
<doctitle>SLottia.txt</doctitle> |
|
125 |
<doctype>eml://ecoinformatics.org/eml-2.0.1</doctype> |
|
158 | 126 |
<createdate>2001-01-12 16:11:31.0</createdate> |
159 | 127 |
<updatedate>2001-01-12 16:11:31.0</updatedate> |
160 |
<param name="resource/dataset/keywordInfo/keyword">lottia</param> |
|
161 |
<param name="resource/dataset/keywordInfo/keyword">intertidal</param> |
|
162 |
<param name="resource/dataset/keywordInfo/keyword">Orange</param> |
|
163 |
<triple> |
|
164 |
<subject>nceas.41</subject> |
|
165 |
<relationship>provides table-entity information for package</relationship> |
|
166 |
<object>nceas.42</object> |
|
167 |
</triple> |
|
168 |
<triple> |
|
169 |
<subject>nceas.40</subject> |
|
170 |
<relationship>provides eml-physical information for Table</relationship> |
|
171 |
<object>nceas.41</object> |
|
172 |
</triple> |
|
173 |
<triple> |
|
174 |
<subject>nceas.39</subject> |
|
175 |
<relationship>provides access control rules for</relationship> |
|
176 |
<object>nceas.40</object> |
|
177 |
</triple> |
|
178 |
<triple> |
|
179 |
<subject>nceas.39</subject> |
|
180 |
<relationship>provides access control rules for</relationship> |
|
181 |
<object>nceas.41</object> |
|
182 |
</triple> |
|
183 |
<triple> |
|
184 |
<subject>nceas.39</subject> |
|
185 |
<relationship>provides access control rules for</relationship> |
|
186 |
<object>nceas.42</object> |
|
187 |
</triple> |
|
128 |
<param name="dataset/title">Ocean Surface Temperature</param> |
|
129 |
<param name="keyword">Plant</param> |
|
130 |
<param name="originator/individualName/surName">Henry</param> |
|
188 | 131 |
</document> |
189 | 132 |
..... |
190 | 133 |
</resultset> |
... | ... | |
198 | 141 |
is docid, docname, doctype, doctitle, createdate and |
199 | 142 |
updatedate. The param tags are present if the document found contained |
200 | 143 |
the returnfield chosen in the pathquery document. The name attribute of the |
201 |
param tag is the full path to the node specified by the returnfield. <relation> |
|
202 |
tags specify any documents to which the returned document is related. Relations |
|
203 |
and packages are talked about <a href="./packages.html">later</a>.<p> |
|
144 |
param tag is the full path to the node specified by the returnfield. <p> |
|
204 | 145 |
|
205 | 146 |
<br> |
206 | 147 |
<a href="./metacatload.html">Back</a> | <a href="./metacattour.html">Home</a> | |
Also available in: Unified diff
Modified the query example which will give user more sense.