Package uk.ac.starlink.vo
Class DataModelAdqlExample
java.lang.Object
uk.ac.starlink.vo.DataModelAdqlExample
- All Implemented Interfaces:
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
ConstructorsModifierConstructorDescriptionprotected
DataModelAdqlExample
(String name, String description, String infoUrl) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataModelAdqlExample[]
Returns a list of examples applicable for the ObsCore data model.static DataModelAdqlExample[]
Returns a list of examples applicable for the RegTAP data model.getAdqlText
(boolean lineBreaks, VersionedLanguage 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.Returns this example's description.Returns a documentation URL associated with this example if available.getName()
Returns this example's name.protected abstract String[]
getTextLines
(double[] skypos) Returns the lines of ADQL text for this example.abstract boolean
isDataModel
(Ivoid dm) Indicates whether a given data model string is the one to which this example corresponds.
-
Constructor Details
-
DataModelAdqlExample
Constructor.- Parameters:
name
- example namedescription
- example short descriptioninfoUrl
- URL for explanation
-
-
Method Details
-
isDataModel
Indicates whether a given data model string is the one to which this example corresponds. The supplied value is the ivo-id attribute of the TAPRegExtdataModel
attribute, available fromTapCapability.getDataModels()
.- Parameters:
dm
- data model identifier
-
getTextLines
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
Description copied from interface:AdqlExample
Returns this example's name.- Specified by:
getName
in interfaceAdqlExample
- Returns:
- name
-
getDescription
Description copied from interface:AdqlExample
Returns this example's description.- Specified by:
getDescription
in interfaceAdqlExample
- Returns:
- short description
-
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
-
getAdqlText
public String getAdqlText(boolean lineBreaks, VersionedLanguage 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:
getAdqlText
in interfaceAdqlExample
- Parameters:
lineBreaks
- whether output ADQL should include multiline formattinglang
- ADQL language varianttcap
- 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
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
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:
-