Class DataModelAdqlExample

java.lang.Object
uk.ac.starlink.vo.DataModelAdqlExample
All Implemented Interfaces:
AdqlExample

public abstract class DataModelAdqlExample extends 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 Details

    • DataModelAdqlExample

      protected DataModelAdqlExample(String name, String description, String infoUrl)
      Constructor.
      Parameters:
      name - example name
      description - example short description
      infoUrl - URL for explanation
  • Method Details

    • isDataModel

      public abstract boolean isDataModel(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 TAPRegExt dataModel attribute, available from TapCapability.getDataModels().
      Parameters:
      dm - data model identifier
    • getTextLines

      protected abstract 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 String getName()
      Description copied from interface: AdqlExample
      Returns this example's name.
      Specified by:
      getName in interface AdqlExample
      Returns:
      name
    • getDescription

      public String getDescription()
      Description copied from interface: AdqlExample
      Returns this example's description.
      Specified by:
      getDescription in interface AdqlExample
      Returns:
      short description
    • getInfoUrl

      public URL getInfoUrl()
      Description copied from interface: AdqlExample
      Returns a documentation URL associated with this example if available.
      Specified by:
      getInfoUrl in interface AdqlExample
      Returns:
      documentation URL (suitable for browser display), or null
    • getText

      public String getText(boolean lineBreaks, 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 interface AdqlExample
      Parameters:
      lineBreaks - whether output ADQL should include multiline formatting
      lang - ADQL language variant (e.g. "ADQL-2.0")
      tcap - TAP capability object
      tables - table metadata set
      table - currently selected table
      skypos - 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: