Debian Codegraph @

tests/test_data/test.rd

raw
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!-- A resource descriptor for various unit tests -->
4
5 <resource resdir="" schema="test" readProfiles="trustedquery,untrustedquery">
6 <meta name="test.inRd">from Rd</meta>
7 <meta name="rights">Everything in here is pure fantasy
8 (distributed under the GNU GPL)</meta>
9 <meta name="rights.rightsURI">http://too-lazy-to/loop/up/spdx</meta>
10 <meta name="creator.name">John C. Testwriter</meta>
11 <meta name="description">Sundry test tables and other fancy stuff</meta>
12 <meta name="utype">http://www.g-vo.org/DaCHS</meta>
13 <meta name="creationDate">2007-10-18T13:00:00</meta>
14 <meta name="title">Sundry test stuff</meta>
15 <meta name="subject">Testing: senseless</meta>
16 <meta name="facility">Markus' Proving Grounds</meta>
17
18 <meta name="schema-rank">100</meta>
19
20 <table id="pgs_siaptable" mixin="//siap#pgs" onDisk="True">
21 <mixin
22 sResolution="0.5"
23 polStates="'/RR/XY/'"
24 calibLevel="2"
25 >//obscore#publishSIAP</mixin>
26 <publish sets="local"/>
27 <meta name="_associatedDatalinkService.serviceId">data/cores#dl</meta>
28 <meta name="_associatedDatalinkService.idColumn">accref</meta>
29 </table>
30
31 <service id="pgsiapsvc" allowed="form,siap.xml">
32 <publish render="siap.xml" sets="testing"/>
33
34 <meta name="title">siap test</meta>
35 <meta name="creationDate">2005-01-01T12:00:00</meta>
36 <meta name="subject">virtual-observatories</meta>
37 <meta name="shortName">oh bother</meta>
38 <meta name="description">If you are seeing this service, a unit test
39 forgot to clean up.</meta>
40
41 <meta name="sia">
42 <meta name="type">pointed</meta>
43 <meta name="maxImageSize">3000</meta>
44 <meta name="maxImageExtent.long">10</meta>
45 </meta>
46 <meta>
47 testQuery.pos.ra: 10
48 testQuery.pos.dec: -10
49 testQuery.size.ra: 0.4
50 testQuery.size.dec: 0.3
51 </meta>
52 <dbCore queriedTable="pgs_siaptable">
53 <condDesc original="//siap#protoInput"/>
54 <condDesc original="//siap#humanInput"/>
55 </dbCore>
56
57 <!-- overwrite a default DALI parameter -->
58 <inputKey name="MAXREC" type="integer">21231</inputKey>
59 </service>
60
61 <service id="siapcutout" allowed="siap.xml">
62 <siapCutoutCore queriedTable="pgs_siaptable">
63 <condDesc original="//siap#protoInput"/>
64 </siapCutoutCore>
65 </service>
66
67 <data id="siap_base" auto="False">
68 <dictlistGrammar>
69 <rowfilter procDef="//products#define">
70 <bind key="accref">row["accref"]</bind>
71 <bind key="fsize">row["accsize"]</bind>
72 <bind key="table">parent.parent.getProperty("destTable")</bind>
73 <bind key="path">row["accref"]</bind>
74 </rowfilter>
75 </dictlistGrammar>
76 <rowmaker id="st_siaptable">
77 <apply procDef="//siap#setMeta">
78 <bind key="title">@imageTitle</bind>
79 <bind key="instrument">@instId</bind>
80 <bind key="dateObs">@dateObs</bind>
81 <bind key="bandpassId">@bandpassId</bind>
82 <bind key="bandpassLo">@bandpassLo</bind>
83 <bind key="bandpassHi">@bandpassHi</bind>
84 </apply>
85 </rowmaker>
86 </data>
87
88 <data id="pgs_siaptest" original="siap_base">
89 <!-- for pgsphere-based searching -->
90 <property name="destTable">test.pgs_siaptable</property>
91 <rowmaker id="make_pgssiaptable" original="st_siaptable">
92 <apply procDef="//siap#computePGS"/>
93 </rowmaker>
94 <make table="pgs_siaptable" rowmaker="make_pgssiaptable"
95 role="primary"/>
96 </data>
97
98 <data id="pgs_siapnulltest" original="siap_base">
99 <!-- for pgsphere import with null data -->
100 <property name="destTable">test.pgs_siaptable</property>
101 <make table="pgs_siaptable" role="primary">
102 <rowmaker original="st_siaptable">
103 <apply procDef="//siap#computePGS">
104 <bind name="missingIsError">False</bind>
105 </apply>
106 </rowmaker>
107 </make>
108 </data>
109
110 <!-- we've traditionally used this for types roundtrip experiments. Let's
111 not do this any more because it breaks lots of tests in formatstests (or make
112 these tests more resilient). -->
113 <table id="typesTable" onDisk="True" adql="True">
114 <column name="anint" tablehead="An Integer" type="integer">
115 <values nullLiteral="-8888"/></column>
116 <column name="afloat" tablehead="Some Real">
117 <values min="-1000.0" max="2002.0"/>
118 </column>
119 <column name="adouble" tablehead="And a Double"
120 description="This is a complex
121 beast so it needs a description that requires continuation cards in
122 FITS binary tables."
123 type="double precision"/>
124 <column name="atext" type="unicode" description="Just by a ยต."
125 tablehead="A string must be in here as well">
126 <values nullLiteral=""/>
127 </column>
128 <column name="adate" tablehead="When" type="date" unit="d"/>
129 <column name="somejson" tablehead="anything" type="json"/>
130 </table>
131
132 <data id="import_for_roundtrip">
133 <sources item="1"/>
134 <embeddedGrammar><iterator><code>
135 yield {"anint": None, "afloat": None, "adouble": None, "atext": None,
136 "adate": None, "somejson": None}
137 yield {"anint": 121, "afloat": 121.121, "adouble": 121.121,
138 "atext": "hundertEinundzwanzig",
139 "adate": datetime.datetime(1969, 12, 24, 16, 00),
140 "somejson": '{"testing": true}'}
141 </code></iterator></embeddedGrammar>
142 <make table="typesTable"/>
143 </data>
144
145 <data id="tableMaker">
146 <table original="typesTable" id="m_typestable" onDisk="False">
147 <meta name="description">Some test data with a reason</meta>
148 <param name="intPar" type="integer"
149 description="test integer parameter">42</param>
150 <param name="stringPar" type="text" description="empty by default"
151 >__NULL__</param>
152 <param name="roughFloatPar">0.3</param>
153 <param name="exactFloatPar" unit="m" ucd="phys.width"
154 description="This can be exactly
155 represented in two's complement. Also, it is a fairly long
156 description, and it's going to be interesting to see how the various
157 formats cope">0.25</param>
158 <column name="apos" type="spoint"/>
159 <column name="amoc" type="smoc"/>
160 </table>
161 <rowsetGrammar enc="iso8859-1" fieldsFrom="m_typestable"/>
162 <make table="m_typestable"/>
163 </data>
164
165
166 <table id="adql" adql="True" onDisk="True">
167 <meta name="source">1635QB41.G135......</meta>
168 <meta name="info" infoName="ORIGIN" infoValue="test.rd"
169 >This stuff originating in data/test#adql</meta>
170 <param name="fib" type="integer[]" utype="math:series.fibonacci"
171 >1 1 2</param>
172
173 <stc>
174 Position ICRS GEOCENTER Epoch J2015.0
175 "alpha" "delta" Redshift VELOCITY "rV"
176 </stc>
177 <dm>
178 (geojson:FeatureCollection) {
179 feature: {
180 geometry: {
181 type: sepcoo
182 longitude: @alpha
183 latitude: @delta
184 }
185 }
186 }
187 </dm>
188 <group name="weird_columns" utype="col:weird.name">
189 <columnRef dest="alpha" utype="col:weird.reason"/>
190 <columnRef dest="mag"/>
191 </group>
192 <group name="nice_columns" utype="col:nice.name">
193 <columnRef dest="alpha"/>
194 <columnRef dest="rV"/>
195 </group>
196 <column name="alpha" unit="deg" ucd="pos.eq.ra;meta.main"
197 description="A sample RA" tablehead="Raw RA" verbLevel="1"/>
198 <column name="delta" unit="deg" ucd="pos.eq.dec;meta.main"
199 description="A sample Dec" verbLevel="1"/>
200 <column name="mag" unit="mag" ucd="phot.mag"
201 description="A sample magnitude" verbLevel="15"/>
202 <column name="rV" unit="km/s" ucd="phys.veloc;pos.heliocentric"
203 description="A sample radial velocity"
204 type="double precision" verbLevel="25" displayHint="displayUnit=Mm/s">
205 <values min="-20000" max="200000"/>
206 </column>
207 <column name="tinyflag" type="bytea" verbLevel="30">
208 <values nullLiteral="0"/>
209 </column>
210 </table>
211
212 <table id="adqltable" onDisk="True" adql="True">
213 <meta name="description">A meaningless table</meta>
214 <property name="supportsModel">Fantasy-1.0, Fantasy-1.1</property>
215 <property name="supportsModelURI">http://example.com/url1
216 http://example.com/anotheruri</property>
217 <column name="foo"
218 type="double precision" required="True"/>
219 <foreignKey inTable="adql" source="foo" dest="rV"
220 metaOnly="True"/>
221 </table>
222
223 <table original="adql" id="csdata" onDisk="True" adql="True"
224 nrows="10">
225 <column name="internal" hidden="True"
226 description="This column should not be publicly visible"/>
227 </table>
228
229 <table onDisk="True" id="ADQLgeo" adql="True">
230 <column name="row_id" type="text"/>
231 <column name="a_moc" type="smoc"/>
232 <column name="a_point" type="spoint"/>
233 </table>
234
235 <data id="ADQLTest">
236 <sources pattern="data/adqlin.txt"/>
237 <rowmaker id="AT_adql" idmaps="alpha,delta,mag,rV">
238 <map key="tinyflag">chr(int(@tinyflag))</map>
239 </rowmaker>
240 <reGrammar names="alpha, delta, mag, rV, tinyflag"/>
241 <make table="adql" rowmaker="AT_adql"/>
242 </data>
243
244 <data id="import_adqlgeo">
245 <dictlistGrammar/>
246 <make table="ADQLgeo"/>
247 </data>
248
249 <data id="import_adqltable">
250 <dictlistGrammar/>
251 <make table="adqltable"/>
252 </data>
253
254 <data id="csTestTable">
255 <sources pattern="data/cstestin.txt"/>
256 <reGrammar names="alpha,delta,mag,rv"/>
257 <make table="csdata"/>
258 </data>
259
260 <table id="weirdtypes" onDisk="True" adql="True">
261 <column name="tg" type="text"/>
262 <column name="textarr" type="char(10)[]"/>
263 </table>
264
265 <data id="import_weirdtypes">
266 <sources item="1"/>
267 <embeddedGrammar><iterator>
268 <code>
269 yield {"tg": "textarr", "textarr": ["ein", "walde", "viel zu lang..."]}
270 </code>
271 </iterator></embeddedGrammar>
272 <make table="weirdtypes"/>
273 </data>
274
275 <table id="valSpec" onDisk="True">
276 <column name="a_num" required="True">
277 <values min="10" max="15"/>
278 </column>
279 <column name="enum" type="text">
280 <values>
281 <option>abysimal</option>
282 <option>horrific</option>
283 <option>gruesome</option>
284 <option>bad</option>
285 <option>acceptable</option>
286 </values>
287 </column>
288 </table>
289
290
291 <data id="valuestest">
292 <table id="valuesdoc">
293 <column name="docLowBound">
294 <values min="-10"/>
295 </column>
296 <column name="docHiBound">
297 <values max="-10"/>
298 </column>
299 <column name="docReq" required="True" type="text"/>
300 </table>
301 <make table="valSpec"/>
302 <make table="valuesdoc" role="docrec"/>
303 </data>
304
305 <data id="viziertest">
306 <sources><item>$a$A$aaab$baaab$BAaab$B*$X33+4$a,b$a|b$\it</item></sources>
307 <embeddedGrammar>
308 <iterator>
309 <code>
310 for s in self.sourceToken.split("$"):
311 yield {"s": s}
312 </code>
313 </iterator>
314 </embeddedGrammar>
315 <table id="vizierstrings" onDisk="true">
316 <column name="s" type="text"/>
317 </table>
318 <make table="vizierstrings"/>
319 </data>
320
321
322 <table id="abcd">
323 <column name="a" type="text" verbLevel="1" description="Some weirdness"/>
324 <column name="b" type="integer" verbLevel="5">
325 <values nullLiteral="-8888"/>
326 </column>
327 <column name="c" type="integer" verbLevel="15">
328 <values nullLiteral="-8888"/>
329 </column>
330 <column name="d" type="integer" verbLevel="20" unit="km">
331 <values nullLiteral="-8888"/>
332 </column>
333 <column name="e" type="timestamp" verbLevel="25"
334 utype="junk.junk.junk"/>
335 </table>
336
337 <data id="expandOnIndex">
338 <dictlistGrammar>
339 <rowfilter procDef="//procs#expandIntegers">
340 <bind key="startName">"b"</bind>
341 <bind key="endName">"c"</bind>
342 <bind key="indName">"d"</bind>
343 </rowfilter>
344 </dictlistGrammar>
345 <rowmaker id="eoi_abcd">
346 <map dest="a"/>
347 <map dest="b"/>
348 <map dest="c"/>
349 <map dest="d"/>
350 </rowmaker>
351 <make table="abcd" rowmaker="eoi_abcd"/>
352 </data>
353
354 <data id="expandComma">
355 <dictlistGrammar>
356 <rowfilter procDef="__system__/procs#expandComma">
357 <bind key="srcField">"stuff"</bind>
358 <bind key="destField">"a"</bind>
359 </rowfilter>
360 </dictlistGrammar>
361 <rowmaker id="ec_abcd">
362 <map dest="a"/>
363 <map dest="b"/>
364 </rowmaker>
365 <make table="abcd" rowmaker="ec_abcd"/>
366 </data>
367
368 <table id="prodtest" mixin="//products#table" onDisk="True">
369 <column name="object" type="text" verbLevel="1"/>
370 <column name="alpha" type="real" ucd="pos.eq.ra" verbLevel="15"/>
371 <column name="delta" type="real" ucd="pos.eq.dec" verbLevel="15"/>
372 </table>
373
374 <table id="cprodtest" mixin="//products#table" onDisk="True">
375 <column name="object" type="text" verbLevel="1"/>
376 <column name="alpha" type="real" ucd="pos.eq.ra" verbLevel="15"/>
377 <column name="delta" type="real" ucd="pos.eq.dec" verbLevel="15"/>
378 </table>
379
380 <table id="stcfancy">
381 <stc>Position ICRS BARYCENTER "ra" "dec" Error "e_pos" "e_pos"</stc>
382 <stc>Time TT TOPOCENTER "obsDate" Error "e_date"
383 Position FK5 B1975 TOPOCENTER "o_ra" "o_dec" VelocityInterval
384 Velocity "pma" "pmd" Error "e_pma" "e_pmd"</stc>
385 <LOOP listItems="ra dec e_pos obsDate e_date o_ra o_dec
386 pma pmd e_pma e_pmd">
387 <events>
388 <column name="\item"/>
389 </events>
390 </LOOP>
391 </table>
392
393 <rowmaker id="prodrowbase">
394 <map dest="object"/>
395 <map dest="alpha">hmsToDeg(@alpha, ' ')</map>
396 <map dest="delta">dmsToDeg(@delta, ' ')</map>
397 </rowmaker>
398
399 <data id="productimport">
400 <sources><pattern>data/*.imp</pattern>
401 <ignoreSources fromdb="select accref from test.prodtest"/></sources>
402 <keyValueGrammar id="pi-gram">
403 <rowfilter name="make_preview_paths">
404 <code>
405 if row["object"]=='gabriel':
406 row["preview"] = 'data/broken.imp'
407 row["preview_mime"] = 'text/plain'
408 elif row["object"]=='michael':
409 row["preview"] = 'http://example.com/borken.jpg'
410 row["preview_mime"] = 'image/jpeg'
411 yield row
412 </code>
413 </rowfilter>
414 <rowfilter procDef="//products#define">
415 <bind key="owner">"X_test"</bind>
416 <bind key="embargo">row["embargo"]</bind>
417 <bind key="table">"test.prodtest"</bind>
418 <bind key="mime">"text/plain"</bind>
419 <bind key="preview">@preview</bind>
420 <bind key="preview_mime">@preview_mime</bind>
421 </rowfilter>
422 </keyValueGrammar>
423 <rowmaker id="pi_rmk" original="prodrowbase">
424 </rowmaker>
425 <make table="prodtest" rowmaker="pi_rmk"/>
426 </data>
427
428 <data id="productimport-skip">
429 <property key="previewDir">prefoo</property>
430 <sources><pattern>data/[ab].imp</pattern></sources>
431 <keyValueGrammar>
432 <rowfilter procDef="//products#define">
433 <bind key="table">"test.prodskip"</bind>
434 <bind key="preview">\standardPreviewPath</bind>
435 <bind key="preview_mime">"image/png"</bind>
436 </rowfilter>
437 </keyValueGrammar>
438 <make role="primary">
439 <table id="prodskip" onDisk="True" mixin="//products#table">
440 <column name="object" type="text"/>
441 </table>
442 <rowmaker idmaps="*">
443 <ignoreOn><keyIs key="object" value="michael"/></ignoreOn>
444 </rowmaker>
445 </make>
446 </data>
447
448 <data id="productimportdefaults">
449 <table original="prodtest" onDisk="True" id="proddefaults"/>
450 <sources><pattern>data/*.imp</pattern></sources>
451 <keyValueGrammar>
452 <rowfilter procDef="//products#define">
453 <bind key="table">"test.prodtest"</bind>
454 </rowfilter>
455 </keyValueGrammar>
456 <make table="prodtest">
457 <rowmaker original="prodrowbase"/>
458 </make>
459 </data>
460
461 <data id="import_fitsprod">
462 <sources pattern="data/*.fits"/>
463 <fitsProdGrammar>
464 <rowfilter procDef="//products#define">
465 <bind key="table">"test.prodtest"</bind>
466 </rowfilter>
467 </fitsProdGrammar>
468 <make table="prodtest" role="primary">
469 <rowmaker simplemaps="alpha:CRVAL1, delta:CRVAL2, object:OBJECT"
470 idmaps="*"/>
471 </make>
472 </data>
473
474 <data id="import_compressed_fits">
475 <sources pattern="data/*.fits.fz"/>
476 <fitsProdGrammar qnd="False">
477 <rowfilter procDef="//products#define">
478 <bind key="table">"test.cprodtest"</bind>
479 </rowfilter>
480 </fitsProdGrammar>
481 <make table="cprodtest" role="primary">
482 <rowmaker simplemaps="alpha:CRVAL1, delta:CRVAL2, object:OBJECT"
483 idmaps="*"/>
484 </make>
485 </data>
486
487 <table id="sqlscript" onDisk="True">
488 <column name="counter" type="integer" required="True"/>
489 </table>
490
491 <data id="import_sqlscript">
492 <make table="sqlscript">
493 <script type="preIndex" lang="SQL">
494 INSERT INTO \curtable VALUES (1);
495 INSERT INTO \curtable VALUES (2);
496 INSERT INTO \curtable VALUES (3)
497 </script>
498 </make>
499 </data>
500
501 <table id="pythonscript" onDisk="True">
502 <column name="counter" type="integer" required="True"/>
503 </table>
504
505 <data id="import_pythonscript">
506 <meta name="onData">present</meta>
507 <make table="pythonscript">
508 <script type="preIndex" lang="python">
509 table.connection.execute("INSERT INTO \curtable VALUES (123)")
510 </script>
511 </make>
512 </data>
513
514 <data id="recaftertest" recreateAfter="import_pythonscript"/>
515
516 <dbCore id="prodscore" queriedTable="prodtest"/>
517
518 <service id="basicprod" core="prodscore" allowed="static,form"
519 defaultRenderer="form">
520 <meta name="title">Somebody else's problem</meta>
521 <meta name="creationDate">1975-01-01T12:00:00</meta>
522 <meta name="subject">n-body-problem</meta>
523 <meta name="shortName">no looks</meta>
524 <meta name="description">If you are seeing this service, a unit test
525 forgot to clean up.</meta>
526 <property name="indexFile">data/a.imp</property>
527 <publish render="form" sets="local"/>
528 </service>
529
530 </resource>