Package uk.ac.starlink.vo
Class DataModelAdqlExample
- java.lang.Object
-
- uk.ac.starlink.vo.DataModelAdqlExample
-
- All Implemented Interfaces:
AdqlExample
public abstract class DataModelAdqlExample extends java.lang.Object implements AdqlExample
AdqlExample implementation that provides fixed-text examples specific to a given standard declared data model. The getText method returns a non-null value only if the supplied TapCapability declares a data model that the example recognises.- Since:
- 3 Jun 2015
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DataModelAdqlExample(java.lang.String name, java.lang.String description, java.lang.String infoUrl)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DataModelAdqlExample[]
createObsTapExamples()
Returns a list of examples applicable for the ObsCore data model.static DataModelAdqlExample[]
createRegTapExamples()
Returns a list of examples applicable for the RegTAP data model.java.lang.String
getDescription()
Returns this example's description.java.net.URL
getInfoUrl()
Returns a documentation URL associated with this example if available.java.lang.String
getName()
Returns this example's name.java.lang.String
getText(boolean lineBreaks, java.lang.String lang, TapCapability tcap, TableMeta[] tables, TableMeta table, double[] skypos)
Produces ADQL text for a query of the type represented by this object, for a given set of service details.protected abstract java.lang.String[]
getTextLines(double[] skypos)
Returns the lines of ADQL text for this example.abstract boolean
isDataModel(java.lang.String dm)
Indicates whether a given data model string is the one to which this example corresponds.
-
-
-
Method Detail
-
isDataModel
public abstract boolean isDataModel(java.lang.String dm)
Indicates whether a given data model string is the one to which this example corresponds. The supplied string is the ivo-id attribute of the TAPRegExtdataModel
attribute, available fromTapCapability.getDataModels()
.- Parameters:
dm
- data model identifier
-
getTextLines
protected abstract java.lang.String[] getTextLines(double[] skypos)
Returns the lines of ADQL text for this example.- Parameters:
skypos
- 2-element array giving preferred (RA,Dec) sky position in degrees, or null if none preferred
-
getName
public java.lang.String getName()
Description copied from interface:AdqlExample
Returns this example's name.- Specified by:
getName
in interfaceAdqlExample
- Returns:
- name
-
getDescription
public java.lang.String getDescription()
Description copied from interface:AdqlExample
Returns this example's description.- Specified by:
getDescription
in interfaceAdqlExample
- Returns:
- short description
-
getInfoUrl
public java.net.URL getInfoUrl()
Description copied from interface:AdqlExample
Returns a documentation URL associated with this example if available.- Specified by:
getInfoUrl
in interfaceAdqlExample
- Returns:
- documentation URL (suitable for browser display), or null
-
getText
public java.lang.String getText(boolean lineBreaks, java.lang.String lang, TapCapability tcap, TableMeta[] tables, TableMeta table, double[] skypos)
Description copied from interface:AdqlExample
Produces ADQL text for a query of the type represented by this object, for a given set of service details.- Specified by:
getText
in interfaceAdqlExample
- Parameters:
lineBreaks
- whether output ADQL should include multiline formattinglang
- ADQL language variant (e.g. "ADQL-2.0")tcap
- TAP capability objecttables
- table metadata settable
- currently selected tableskypos
- 2-element array giving preferred (RA,Dec) sky position in degrees, or null if none preferred- Returns:
- example text, or null if no example can be constructed given the input values
-
createRegTapExamples
public static DataModelAdqlExample[] createRegTapExamples()
Returns a list of examples applicable for the RegTAP data model. This list is taken from section 10 of RegTAP 1.0.- Returns:
- example list
- See Also:
-
-
createObsTapExamples
public static DataModelAdqlExample[] createObsTapExamples()
Returns a list of examples applicable for the ObsCore data model. These examples are written with reference to Appendix A of ObsCore 1.0, with a few alterations and corrections.- Returns:
- example list
- See Also:
- ObsCore 1.0
-
-
-