Helper objects for the support of the VO's ad-hoc "parameter query language" as used in various DAL protocols. A parameter containing a cone search with a single position-like key (the first, expecting a coordinate pair fairly leniently) and a cone search (a float, in the second input key). The generated expression uses pgsphere. try: posKey = inputKeys[0].name sizeKey = inputKeys[1].name except IndexError: raise base.ValidationError("Operator error: the cone condition" " is lacking input keys.", "query") parsedPos = pql.PQLPositionPar.fromLiteral( inPars.get(posKey, None), posKey) size = inputKeys[1]._parse(inPars.get(sizeKey, None)) if parsedPos is not None and size is not None: yield parsedPos.getConeSQL(posCol, outPars, size) A parameter constraining an epoch or similar. "timestamp" inputKey = inputKeys[0] if consColKind=="timestamp": convertTo = None else: convertTo = consColKind key = inputKey.name parsed = pql.PQLDatePar.fromLiteral(inPars.get(key, None), key) if parsed is not None: yield parsed.getSQL(consCol, outPars, convertTo) key = inputKeys[0].name parsed = pql.PQLFloatPar.fromLiteral(inPars.get(key, None), key) if parsed is not None: yield parsed.getSQL(consCol, outPars) A parameter that constrains a string-valued column. Matches are literal and case-sensitive; the collation (for ranges) is that given by the database. Steps are not allowed. key = inputKeys[0].name parsed = pql.PQLStringPar.fromLiteral(inPars.get(key, None), key) if parsed is not None: yield parsed.getSQL(consCol, outPars) A parameter that constrains a string-valued column, where both the column values and the search value are interpreted as document vectors and compared according to the information retrieval functions of Postgres -- i.e., more or less like google matches queries. Since it is hard to figure out what they could mean, neither steps nor ranges are supported. key = inputKeys[0].name parsed = pql.PQLTextParIR.fromLiteral(inPars.get(key, None), key) if parsed is not None: yield parsed.getSQL(consCol, outPars) This stream includes the standard DALI service parameters (RESPONSEFORMAT, MAXREC, VERB). For services available through IVOA-standard protocols (renderers scs.xml, siap.xml, ssap.xml, and also api), this is included automatically, so you will not usually have to manually FEED this. form 1 return input and input.lower() from gavo import formats for key in formats.iterFormats(): yield {"item": formats.getMIMEFor(key).lower(), "title": formats.getLabelFor(key)} for alias in formats.getAliasesFor(key): yield {"item": alias.lower(), "title": "Alias for %s"%formats.getLabelFor(key)} form 1 form This stream includes a DALI UPLOAD parameter. This is purely declarative for now, as the interpretation is done anyway for VO renderers and not at all otherwise.