Project

General

Profile

« Previous | Next » 

Revision 3775

Added by Jing Tao over 16 years ago

Modified the query example which will give user more sense.

View differences:

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
  &lt;returnfield&gt; 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 &lt;querygroup&gt; creates an AND or an OR statement of the &lt;queryterm&gt;s
76 74
  in the group.  The operator can be UNION or INTERSECT.  A &lt;queryterm&gt;
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
        &lt;resultset&gt;
88
      &lt;resultset&gt;
91 89
        &lt;query&gt;
92 90
          &lt;pathquery version="1.0"&gt;
93 91
            &lt;meta_file_id&gt;unspecified&lt;/meta_file_id&gt;
94 92
            &lt;querytitle&gt;unspecified&lt;/querytitle&gt;
95
            &lt;returnfield&gt;resource/dataset/originator/individualName/surName&lt;/returnfield&gt;
96
            &lt;returnfield&gt;resource/dataset/originator/individualName/givenName&lt;/returnfield&gt;
97
            &lt;returnfield&gt;resource/dataset/keywordInfo/keyword&lt;/returnfield&gt;
98
            &lt;returndoctype&gt;&lt;/returndoctype&gt;
93
            &lt;returnfield&gt;dataset/title&lt;/returnfield&gt;
94
            &lt;returnfield&gt;keyword&lt;/returnfield&gt;
95
            &lt;returnfield&gt;originator/individualName/surName&lt;/returnfield&gt;
96
            &lt;returndoctype&gt;eml://ecoinformatics.org/eml-2.0.1&lt;/returndoctype&gt;
97
            &lt;returndoctype&gt;eml://ecoinformatics.org/eml-2.0.0&lt;/returndoctype&gt;
99 98
            &lt;querygroup operator="UNION"&gt;
100
              &lt;queryterm casesensitive="false" searchmode="contains"&gt;
101
                &lt;value&gt;%&lt;/value&gt;
102
              &lt;/queryterm&gt;
103
              &lt;queryterm casesensitive="false" searchmode="contains"&gt;
104
                &lt;value&gt;-//NCEAS//resource//EN&lt;/value&gt;
105
                &lt;pathexpr&gt;returndoc&lt;/pathexpr&gt;
106
              &lt;/queryterm&gt;
107
              &lt;queryterm casesensitive="false" searchmode="contains"&gt;
108
                &lt;value&gt;-//NCEAS//eml-dataset//EN&lt;/value&gt;
109
                &lt;pathexpr&gt;returndoc&lt;/pathexpr&gt;
110
              &lt;/queryterm&gt;
111
            &lt;/querygroup&gt;
112
          &lt;/pathquery&gt;
99
                  &lt;queryterm casesensitive="false" searchmode="contains"&gt;
100
                      &lt;value&gt;Datos&lt;/value&gt;
101
                      &lt;pathexpr&gt;dataset/title&lt;/pathexpr&gt;
102
                  &lt;/queryterm&gt;
103
                  &lt;queryterm casesensitive="false" searchmode="contains"&gt;
104
                     &lt;value&gt;plant&lt;/value&gt;
105
                     &lt;pathexpr&gt;keyword&lt;/pathexpr&gt;
106
                  &lt;/queryterm&gt;
107
           &lt;/querygroup&gt;
108
         &lt;/pathquery&gt;
113 109
        &lt;/query&gt;  
114 110
      
115 111
        &lt;document&gt;
116 112
          &lt;docid&gt;nceas.44.1&lt;/docid&gt;
117 113
          &lt;docname&gt;resource&lt;/docname&gt;
118
          &lt;doctype&gt;-//NCEAS//resource//EN&lt;/doctype&gt;
119
          &lt;doctitle&gt;Surgras1.txt&lt;/doctitle&gt;
114
          &lt;doctype&gt;eml://ecoinformatics.org/eml-2.0.1&lt;/doctype&gt;
120 115
          &lt;createdate&gt;2001-01-12 16:12:06.0&lt;/createdate&gt;
121 116
          &lt;updatedate&gt;2001-01-12 16:12:06.0&lt;/updatedate&gt;
122
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;surfgrass&lt;/param&gt;
123
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;intertidal&lt;/param&gt;
124
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;Ventura&lt;/param&gt;
125
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;Los Angeles&lt;/param&gt;
126
          &lt;triple&gt;
127
           &lt;subject&gt;nceas.46&lt;/subject&gt;
128
           &lt;relationship&gt;provides table-entity information for package&lt;/relationship&gt;
129
           &lt;object&gt;nceas.44&lt;/object&gt;
130
          &lt;/triple&gt;
131
          &lt;triple&gt;
132
            &lt;subject&gt;nceas.45&lt;/subject&gt;
133
            &lt;relationship&gt;provides eml-physical information for Table&lt;/relationship&gt;
134
            &lt;object&gt;nceas.46&lt;/object&gt;
135
          &lt;/triple&gt;
136
          &lt;triple&gt;
137
            &lt;subject&gt;nceas.47&lt;/subject&gt;
138
            &lt;relationship&gt;provides access control rules for&lt;/relationship&gt;
139
            &lt;object&gt;nceas.44&lt;/object&gt;
140
          &lt;/triple&gt;
141
          &lt;triple&gt;
142
            &lt;subject&gt;nceas.47&lt;/subject&gt;
143
            &lt;relationship&gt;provides access control rules for&lt;/relationship&gt;
144
            &lt;object&gt;nceas.45&lt;/object&gt;
145
          &lt;/triple&gt;
146
          &lt;triple&gt;
147
            &lt;subject&gt;nceas.47&lt;/subject&gt;
148
            &lt;relationship&gt;provides access control rules for&lt;/relationship&gt;
149
            &lt;object&gt;nceas.46&lt;/object&gt;
150
          &lt;/triple&gt;
151
         &lt;/document&gt;  
117
          &lt;param name="dataset/title"&gt;Datos Meteorologicos&lt;/param&gt;
118
          &lt;param name="keyword"&gt;intertidal&lt;/param&gt;
119
          &lt;param name="originator/individualName/surName"&gt;Smith&lt;/param&gt;
120
        &lt;/document&gt;  
152 121
        
153 122
        &lt;document&gt;
154 123
          &lt;docid&gt;nceas.42.1&lt;/docid&gt;
155 124
          &lt;docname&gt;resource&lt;/docname&gt;
156
          &lt;doctype&gt;-//NCEAS//resource//EN&lt;/doctype&gt;
157
          &lt;doctitle&gt;SLottia.txt&lt;/doctitle&gt;
125
          &lt;doctype&gt;eml://ecoinformatics.org/eml-2.0.1&lt;/doctype&gt;
158 126
          &lt;createdate&gt;2001-01-12 16:11:31.0&lt;/createdate&gt;
159 127
          &lt;updatedate&gt;2001-01-12 16:11:31.0&lt;/updatedate&gt;
160
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;lottia&lt;/param&gt;
161
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;intertidal&lt;/param&gt;
162
          &lt;param name="resource/dataset/keywordInfo/keyword"&gt;Orange&lt;/param&gt;
163
          &lt;triple&gt;
164
            &lt;subject&gt;nceas.41&lt;/subject&gt;
165
            &lt;relationship&gt;provides table-entity information for package&lt;/relationship&gt;
166
            &lt;object&gt;nceas.42&lt;/object&gt;
167
          &lt;/triple&gt;
168
          &lt;triple&gt;
169
            &lt;subject&gt;nceas.40&lt;/subject&gt;
170
            &lt;relationship&gt;provides eml-physical information for Table&lt;/relationship&gt;
171
            &lt;object&gt;nceas.41&lt;/object&gt;
172
          &lt;/triple&gt;
173
          &lt;triple&gt;
174
            &lt;subject&gt;nceas.39&lt;/subject&gt;
175
            &lt;relationship&gt;provides access control rules for&lt;/relationship&gt;
176
            &lt;object&gt;nceas.40&lt;/object&gt;
177
          &lt;/triple&gt;
178
          &lt;triple&gt;
179
            &lt;subject&gt;nceas.39&lt;/subject&gt;
180
            &lt;relationship&gt;provides access control rules for&lt;/relationship&gt;
181
            &lt;object&gt;nceas.41&lt;/object&gt;
182
          &lt;/triple&gt;
183
          &lt;triple&gt;
184
            &lt;subject&gt;nceas.39&lt;/subject&gt;
185
            &lt;relationship&gt;provides access control rules for&lt;/relationship&gt;
186
            &lt;object&gt;nceas.42&lt;/object&gt;
187
          &lt;/triple&gt;
128
          &lt;param name="dataset/title"&gt;Ocean Surface Temperature&lt;/param&gt;
129
          &lt;param name="keyword"&gt;Plant&lt;/param&gt;
130
          &lt;param name="originator/individualName/surName"&gt;Henry&lt;/param&gt;   
188 131
       &lt;/document&gt;
189 132
      .....  
190 133
      &lt;/resultset&gt;
......
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.  &lt;relation&gt;
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