2008-07-24T09:00:00 astronomical-software Table-related metadata for the tables within this data center. A table mapping table names and schemas to the resource descriptors they come from and whether they are open to ADQL queries. This is used wherever DaCHS needs to go from a database name to the resource description, e.g., when generating tableinfo. The table is maintained through gavo imp; to force things out of here, there's gavo drop (for RDs; use -f if the RD is gone or moved away) or gavo purge (for single tables). tableName
Simple (one-column) statistics of orderable columns This is usually filled by dachs limits, which might use estimates rather than actual statistics for large tables. Also, values elements on the column definitions themselves override what may be given here. tableName, column_name
A stream to fill a make element to importers for statistics tables. These do all the necessary mangling and extraction in their embedded grammars, so it's fairly stereotypical. The main trick is a newSource script that purges previous annotations. for col in self.sourceToken: if col.type in base.NUMERIC_TYPES or col.type=="timestamp": if hasattr(col, "annotations"): row = col.annotations.copy() if not row: continue row["tableName"] = self.sourceToken.getQName() row["column_name"] = col.name yield row Discrete values found in string-valued columns. This is usually filled by dachs limits. Only columns with a statistics property of "enumerate" are considered here. Values found here are tableName, column_name
for col in self.sourceToken: if (hasattr(col, "annotations") and "discrete_values" in col.annotations): items = sorted(col.annotations["discrete_values"].items()) yield { "vals": [i[0] for i in items], "freqs": [i[1] for i in items], "tableName": self.sourceToken.getQName(), "column_name": col.name, } A table for storing all kinds of key-value pairs. Key starting with an underscore are for use by user RDs. Only one pair per key is supported, newer keys overwrite older ones. Currently, this is only used for schemaversion, the version of the DaCHS system tables as used by gavo upgrade to figure out what to change. gavo upgrade manages this. From your code, you can use base.getDBMeta(key) and base.setDBMeta(connection, key, value) to put persistent, string-valued metadata in here; if you use this, would you tell us your use case?
column = vars["column"] for key in ["description", "unit", "ucd", "tablehead", "utype", "verbLevel", "type"]: result[key] = getattr(column, key) result["displayHint"] = column.getDisplayHintAsString() result["fieldName"] = column.name result["sourceRD"] = column.parent.rd.sourceId Table infos This service formats metadata for tables within the \getConfig{web}{sitename} \getConfig{web}{sitename} Table Infos ADQL tables An overview over the tables available for ADQL querying within the \getConfig{web}{sitename} \getConfig{web}{sitename} Public Tables return T.a(href=base.makeSitePath("/__system__/dc_tables/" "show/tableinfo/"+urllib.parse.quote(data)))["Table Info"]