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 3780 2008-04-02 23:28:31Z daigle $'
|
11
|
*
|
12
|
* October Meeting SDSC, 2000
|
13
|
-->
|
14
|
<HTML>
|
15
|
<HEAD>
|
16
|
<TITLE>Metacat</TITLE>
|
17
|
<link rel="stylesheet" type="text/css" href="./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>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>
|
54
|
<querygroup operator="UNION">
|
55
|
<queryterm casesensitive="false" searchmode="contains">
|
56
|
<value>Datos</value>
|
57
|
<pathexpr>dataset/title</pathexpr>
|
58
|
</queryterm>
|
59
|
<queryterm casesensitive="false" searchmode="contains">
|
60
|
<value>plant</value>
|
61
|
<pathexpr>keyword</pathexpr>
|
62
|
</queryterm>
|
63
|
</querygroup>
|
64
|
</pathquery>
|
65
|
</pre>
|
66
|
|
67
|
<p>The pathquery document was designed to be flexible enough to query specific
|
68
|
fields of any XML document. It also allows the client to specify which fields
|
69
|
from a returned document are returned in the initial resultset. Each
|
70
|
<returnfield> parameter specifies a field which the DB will return
|
71
|
for any query hit. The returndoctype fields allows the client to limit the
|
72
|
type of documents to be returned. If no returndoctype element , all document types are returned.
|
73
|
A <querygroup> creates an AND or an OR statement of the <queryterm>s
|
74
|
in the group. The operator can be UNION or INTERSECT. A <queryterm>
|
75
|
defines the actual field against which the query is being performed. The value
|
76
|
of the queryterm that we are quering for is encased in <value> tags.
|
77
|
The <pathexpr> tag specifies an exact path to which you want to restrict
|
78
|
the search. A <pathexpr> tag which contains the keyword returndoc is
|
79
|
a special case which is discussed in <a href="./packages.html">Packages and
|
80
|
Relations</a>.</p><br>
|
81
|
|
82
|
<b>The Resultset Document</b><br>
|
83
|
|
84
|
<p>When the pathquery document is submitted and processed, Metacat returns
|
85
|
another XML document called a resultset document.<p>
|
86
|
|
87
|
<pre>
|
88
|
<resultset>
|
89
|
<query>
|
90
|
<pathquery version="1.0">
|
91
|
<meta_file_id>unspecified</meta_file_id>
|
92
|
<querytitle>unspecified</querytitle>
|
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>
|
98
|
<querygroup operator="UNION">
|
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>
|
109
|
</query>
|
110
|
|
111
|
<document>
|
112
|
<docid>nceas.44.1</docid>
|
113
|
<docname>resource</docname>
|
114
|
<doctype>eml://ecoinformatics.org/eml-2.0.1</doctype>
|
115
|
<createdate>2001-01-12 16:12:06.0</createdate>
|
116
|
<updatedate>2001-01-12 16:12:06.0</updatedate>
|
117
|
<param name="dataset/title">Datos Meteorologicos</param>
|
118
|
<param name="keyword">intertidal</param>
|
119
|
<param name="originator/individualName/surName">Smith</param>
|
120
|
</document>
|
121
|
|
122
|
<document>
|
123
|
<docid>nceas.42.1</docid>
|
124
|
<docname>resource</docname>
|
125
|
<doctype>eml://ecoinformatics.org/eml-2.0.1</doctype>
|
126
|
<createdate>2001-01-12 16:11:31.0</createdate>
|
127
|
<updatedate>2001-01-12 16:11:31.0</updatedate>
|
128
|
<param name="dataset/title">Ocean Surface Temperature</param>
|
129
|
<param name="keyword">Plant</param>
|
130
|
<param name="originator/individualName/surName">Henry</param>
|
131
|
</document>
|
132
|
.....
|
133
|
</resultset>
|
134
|
|
135
|
</pre>
|
136
|
<p>The first element in the resultset is <query>. Its content is just
|
137
|
the pathquery document. The resultset always returns
|
138
|
the pathquery document that created it in the <query> tag. The next
|
139
|
major tag is <document>. Each XML document returned by the query
|
140
|
is represented by a <document> tag. The default document information returned
|
141
|
is docid, docname, doctype, doctitle, createdate and
|
142
|
updatedate. The param tags are present if the document found contained
|
143
|
the returnfield chosen in the pathquery document. The name attribute of the
|
144
|
param tag is the full path to the node specified by the returnfield. <p>
|
145
|
|
146
|
<br>
|
147
|
<a href="./metacatload.html">Back</a> | <a href="./metacattour.html">Home</a> |
|
148
|
<a href="./metacatread.html">Next</a>
|
149
|
|
150
|
</BODY>
|
151
|
</HTML>
|
152
|
|