| 1 |
<resource schema="__test"> |
| 2 |
<meta name="title">GAVO Test Data</meta> |
| 3 |
<meta name="creationDate">2008-10-15T15:01:03</meta> |
| 4 |
<meta name="subject">Testing</meta> |
| 5 |
<meta name="creator">\metaString{publisher}</meta> |
| 6 |
<macDef name="testmacro">expanded!</macDef> |
| 7 |
<meta name="description">It's \testmacro</meta> |
| 8 |
<meta name="dataSource">theory</meta> |
| 9 |
<meta name="dataSource">observation</meta> |
| 10 |
|
| 11 |
<meta> |
| 12 |
instrument: Instrument without identity |
| 13 |
instrument: Instrument with ivoid |
| 14 |
instrument.ivoId: ivo://x-example/inst1 |
| 15 |
instrument: Instrument with ivoid and doi |
| 16 |
instrument.ivoId: ivo://x-example/inst2 |
| 17 |
instrument.altIdentifier: doi:107331/fakefake |
| 18 |
</meta> |
| 19 |
|
| 20 |
<table id="data"> |
| 21 |
<column name="anint" tablehead="An Integer" type="integer"> |
| 22 |
<values nullLiteral="-2147483648"/> |
| 23 |
</column> |
| 24 |
<column name="afloat" tablehead="Some Real"/> |
| 25 |
<column name="atext" type="text" |
| 26 |
tablehead="A string must be in here as well"> |
| 27 |
<values><option>bla</option><option>blubb</option></values> |
| 28 |
</column> |
| 29 |
<column name="adate" tablehead="When" type="date" unit="d"/> |
| 30 |
</table> |
| 31 |
|
| 32 |
<table id="barsobal"> |
| 33 |
<register services="//services#overview" sets="ignore"/> |
| 34 |
<column name="anint" type="integer"> |
| 35 |
<values nullLiteral="-2147483648"/> |
| 36 |
</column> |
| 37 |
<column name="adouble" tablehead="And a Double" |
| 38 |
type="double precision"/> |
| 39 |
</table> |
| 40 |
|
| 41 |
<data id="twotables"> |
| 42 |
<dictlistGrammar/> |
| 43 |
<make table="data" role="primary"/> |
| 44 |
<make table="barsobal"/> |
| 45 |
</data> |
| 46 |
|
| 47 |
<table id="nork"> |
| 48 |
<column name="cho" type="text"> |
| 49 |
<values><option>a</option><option>b</option></values> |
| 50 |
</column> |
| 51 |
</table> |
| 52 |
|
| 53 |
<data id="ronk"> |
| 54 |
<make table="barsobal"/> |
| 55 |
</data> |
| 56 |
|
| 57 |
<table id="haslinks" onDisk="True"> |
| 58 |
<column name="prod_id" type="text"/> |
| 59 |
</table> |
| 60 |
|
| 61 |
<data id="import-biblinks"> |
| 62 |
<sources item="2"/> |
| 63 |
<embeddedGrammar><iterator><code> |
| 64 |
for rowid in range(int(self.sourceToken)): |
| 65 |
yield {"prod_id": "prod{}.bin".format(rowid)} |
| 66 |
</code></iterator></embeddedGrammar> |
| 67 |
<make table="haslinks"> |
| 68 |
<script type="postCreation" lang="python" name="add biblinks"> |
| 69 |
from gavo.protocols import biblinks |
| 70 |
|
| 71 |
biblinks.clearLinks(table.connection, table.tableDef.rd) |
| 72 |
src_id = base.getMetaText( |
| 73 |
table.tableDef.rd.getById("haslinks"), "identifier") |
| 74 |
biblinks.defineLinks(table.connection, |
| 75 |
table.tableDef.rd, |
| 76 |
[(pub, "IsSupplementedBy", src_id) |
| 77 |
for pub in ["2015A&C....10...88D", "2005ASPC..347...29T"]]) |
| 78 |
|
| 79 |
biblinks.defineLinks(table.connection, |
| 80 |
table.tableDef.rd, |
| 81 |
[("10.1051/0004-6361:20010923", "Cites", makeProductLink( |
| 82 |
rec["prod_id"]), 5) |
| 83 |
for rec in table], |
| 84 |
bibFormat="doi") |
| 85 |
</script> |
| 86 |
</make> |
| 87 |
</data> |
| 88 |
</resource> |