Package uk.ac.starlink.ttools.taplint
Class CompareMetadataStage
java.lang.Object
uk.ac.starlink.ttools.taplint.CompareMetadataStage
- All Implemented Interfaces:
Stage
Validation stage for checking that two sets of table metadata
(presumably obtained via different routes) are equivalent to each other.
- Since:
- 7 Jun 2011
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionCompareMetadataStage
(String srcDesc1, String srcDesc2, MetadataHolder metaHolder1, MetadataHolder metaHolder2) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
compatibleDataTypes
(String dt1, String dt2) Indicates whether two datatypes are compatible with each other.static CompareMetadataStage
createStage
(TableMetadataStage stage1, TableMetadataStage stage2) Utility method to construct a CompareMetadataStage instance given two TableMetadataStage objects.Returns a short one-line description of this stage.void
Performs the validation checks for this stage.static String
stripAdqlType
(String dtype) Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.
-
Constructor Details
-
CompareMetadataStage
public CompareMetadataStage(String srcDesc1, String srcDesc2, MetadataHolder metaHolder1, MetadataHolder metaHolder2) Constructor.- Parameters:
srcDesc1
- short description of source of first metadata setsrcDesc2
- short description of source of second metadata setmetaHolder1
- supplies first metadata set at comparison timemetaHolder2
- supplies second metadata set at comparison time
-
-
Method Details
-
getDescription
Description copied from interface:Stage
Returns a short one-line description of this stage.- Specified by:
getDescription
in interfaceStage
- Returns:
- description in imperative mood
-
run
Description copied from interface:Stage
Performs the validation checks for this stage. -
compatibleDataTypes
Indicates whether two datatypes are compatible with each other. Datatypes may be either VOTable or TAP/adql type. See VODataService v1.1 section 3.5.3 and TAP v1.0 section 2.5. The logic is somewhat sloppy.Note however that, as clarified by TAP 1.0 Erratum #3, TAP/ADQL has no type system, so any comparison involving the types listed in TAP v1.0 section 2.5 cannot be normative. So any report issued on failure of this test should only be a Warning and not an Error.
- Parameters:
dt1
- first data typedt2
- second data type- Returns:
- true iff it looks like the submitted types are compatible
-
stripAdqlType
Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.- Parameters:
dtype
- string which may be an ADQL datatype- Returns:
- base ADQL data type if appropriate, else input string
-
createStage
public static CompareMetadataStage createStage(TableMetadataStage stage1, TableMetadataStage stage2) Utility method to construct a CompareMetadataStage instance given two TableMetadataStage objects.- Parameters:
stage1
- first metadata producing stagestage2
- second metadata producing stage- Returns:
- comparison stage
-