1
|
<!--
|
2
|
* metacatquery.html
|
3
|
*
|
4
|
* Authors: Jivka Bojilova
|
5
|
* Copyright: 2000 Regents of the University of California and the
|
6
|
* National Center for Ecological Analysis and Synthesis
|
7
|
* For Details: http://www.nceas.ucsb.edu/
|
8
|
* Created: 2000 April 5
|
9
|
* Version: 0.01
|
10
|
* File Info: '$Id: metacatquery.html 2476 2005-04-08 16:27:21Z costa $'
|
11
|
*
|
12
|
* October Meeting SDSC, 2000
|
13
|
-->
|
14
|
<HTML>
|
15
|
<HEAD>
|
16
|
<TITLE>Metacat</TITLE>
|
17
|
<link rel="stylesheet" type="text/css" href="@docrooturl@default.css">
|
18
|
</HEAD>
|
19
|
<BODY>
|
20
|
<table width="100%">
|
21
|
<tr>
|
22
|
<td class="tablehead" colspan="2"><p class="label">Queries and Results</p></td>
|
23
|
<td class="tablehead" colspan="2" align="right">
|
24
|
<a href="./metacatload.html">Back</a> | <a href="./metacattour.html">Home</a> |
|
25
|
<a href="./metacatread.html">Next</a>
|
26
|
</td>
|
27
|
</tr>
|
28
|
</table>
|
29
|
<P>The Metacat Server provides
|
30
|
an interface for searching of metadata stored in the Metacat database.
|
31
|
<P> <img alt="architecture diagram of a Metacat query" src="metadataquery.gif">
|
32
|
<br><br><b>Steps to perform a query in Metacat</b>
|
33
|
<ol>
|
34
|
<li>A pathquery document is created from the search criteria provided through
|
35
|
the servlet parameters.</li>
|
36
|
<li>This pathquery document is sent to DBQuery where it
|
37
|
is processed and translated into SQL statements.</li>
|
38
|
<li>The SQL statements are executed against the database and the resultsets
|
39
|
are translated into an xml document of doctype "resultset".</li>
|
40
|
<li>The resultset document is either returned directly to the client as XML
|
41
|
or is transformed through XSLT and returned as HTML.</li>
|
42
|
</ol>
|
43
|
|
44
|
<b>The Pathquery Document</b>
|
45
|
<pre>
|
46
|
<pathquery version="1.0">
|
47
|
<meta_file_id>unspecified</meta_file_id>
|
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>
|
53
|
<querygroup operator="UNION">
|
54
|
<queryterm casesensitive="false" searchmode="contains">
|
55
|
<value>%</value>
|
56
|
</queryterm>
|
57
|
<queryterm casesensitive="false" searchmode="contains">
|
58
|
<value>-//NCEAS//resource//EN</value>
|
59
|
<pathexpr>returndoc</pathexpr>
|
60
|
</queryterm>
|
61
|
<queryterm casesensitive="false" searchmode="contains">
|
62
|
<value>-//NCEAS//eml-dataset//EN</value>
|
63
|
<pathexpr>returndoc</pathexpr>
|
64
|
</queryterm>
|
65
|
</querygroup>
|
66
|
</pathquery>
|
67
|
</pre>
|
68
|
|
69
|
<p>The pathquery document was designed to be flexible enough to query specific
|
70
|
fields of any XML document. It also allows the client to specify which fields
|
71
|
from a returned document are returned in the initial resultset. Each
|
72
|
<returnfield> parameter specifies a field which the DB will return
|
73
|
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.
|
75
|
A <querygroup> creates an AND or an OR statement of the <queryterm>s
|
76
|
in the group. The operator can be UNION or INTERSECT. A <queryterm>
|
77
|
defines the actual field against which the query is being performed. The value
|
78
|
of the queryterm that we are quering for is encased in <value> tags.
|
79
|
The <pathexpr> tag specifies an exact path to which you want to restrict
|
80
|
the search. A <pathexpr> tag which contains the keyword returndoc is
|
81
|
a special case which is discussed in <a href="./packages.html">Packages and
|
82
|
Relations</a>.</p><br>
|
83
|
|
84
|
<b>The Resultset Document</b><br>
|
85
|
|
86
|
<p>When the pathquery document is submitted and processed, Metacat returns
|
87
|
another XML document called a resultset document.<p>
|
88
|
|
89
|
<pre>
|
90
|
<resultset>
|
91
|
<query>
|
92
|
<pathquery version="1.0">
|
93
|
<meta_file_id>unspecified</meta_file_id>
|
94
|
<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>
|
99
|
<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>
|
113
|
</query>
|
114
|
|
115
|
<document>
|
116
|
<docid>nceas.44.1</docid>
|
117
|
<docname>resource</docname>
|
118
|
<doctype>-//NCEAS//resource//EN</doctype>
|
119
|
<doctitle>Surgras1.txt</doctitle>
|
120
|
<createdate>2001-01-12 16:12:06.0</createdate>
|
121
|
<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>
|
152
|
|
153
|
<document>
|
154
|
<docid>nceas.42.1</docid>
|
155
|
<docname>resource</docname>
|
156
|
<doctype>-//NCEAS//resource//EN</doctype>
|
157
|
<doctitle>SLottia.txt</doctitle>
|
158
|
<createdate>2001-01-12 16:11:31.0</createdate>
|
159
|
<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>
|
188
|
</document>
|
189
|
.....
|
190
|
</resultset>
|
191
|
|
192
|
</pre>
|
193
|
<p>The first element in the resultset is <query>. Its content is just
|
194
|
the pathquery document. The resultset always returns
|
195
|
the pathquery document that created it in the <query> tag. The next
|
196
|
major tag is <document>. Each XML document returned by the query
|
197
|
is represented by a <document> tag. The default document information returned
|
198
|
is docid, docname, doctype, doctitle, createdate and
|
199
|
updatedate. The param tags are present if the document found contained
|
200
|
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>
|
204
|
|
205
|
<br>
|
206
|
<a href="./metacatload.html">Back</a> | <a href="./metacattour.html">Home</a> |
|
207
|
<a href="./metacatread.html">Next</a>
|
208
|
|
209
|
</BODY>
|
210
|
</HTML>
|
211
|
|