Package uk.ac.starlink.vo
Class RegTapRegistryQuery
- java.lang.Object
-
- uk.ac.starlink.vo.RegTapRegistryQuery
-
- All Implemented Interfaces:
RegistryQuery
public class RegTapRegistryQuery extends java.lang.Object implements RegistryQuery
Registry Query implementation that uses TAP to access a Relational Registry.- Since:
- 11 Apr 2014
- Author:
- Mark Taylor
- See Also:
- IVOA Registry Relational Schema
-
-
Field Summary
Fields Modifier and Type Field Description static uk.ac.starlink.table.ValueInfoADQL_INFODescription of metadata item describing query text.static java.lang.StringAIP_REGTAP base URL for GAVO registry hosted at AIP.static java.lang.StringARI_REGTAP base URL for GAVO registry hosted at ARI Heidelberg.static java.lang.StringEUROVO_REGTAP base URL for Euro-VO registry, currently hosted at ESAC.static java.lang.StringGAVO_REGTAP base URL for high-availablity GAVO registry (DNS pointer).static java.lang.StringINAF_REGTAP base URL for INAF registry (not sure if this is permanent).static java.lang.StringPARIS_REGTAP base URL for registry hosted at ObsPM, synced with GAVO.static java.lang.String[]REGISTRIESList of known registry TAP base URLs.static uk.ac.starlink.table.ValueInfoREGISTRY_INFODescription of metadata item describing registry location.static java.lang.StringSTSCI_REGTAP base URL for STScI/VAO registry.
-
Constructor Summary
Constructors Constructor Description RegTapRegistryQuery(TapService tapService, java.lang.String[] standardIds, java.lang.String adqlWhere)Constructs a query which will return RegResource lists for registry resource records with two optional restrictions: (a) restricted to a given service type, and (b) restricted by some free-form ADQL.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetAdqlCondition(ResourceField field, java.lang.String keyword)Returns text that can be used as part of a WHERE clause to supply to this class that tests for a keyword in a given RR field.uk.ac.starlink.table.DescribedValue[]getMetadata()Returns a set of DescribedValue objects which characterise this query.java.util.Iterator<RegResource>getQueryIterator()Executes the query described by this object and returns an Iterator overRegResourceobjects.RegResource[]getQueryResources()Executes the query described by this object and returns the result as an array ofRegResources.java.net.URLgetRegistry()Returns the registry URL.static java.lang.String[]getSearchableRegistries(TapService regtapService)Queries a given registry for searchable registries suitable for use with this class.java.lang.StringgetText()Returns the query text.
-
-
-
Field Detail
-
GAVO_REG
public static final java.lang.String GAVO_REG
TAP base URL for high-availablity GAVO registry (DNS pointer).- See Also:
- Constant Field Values
-
ARI_REG
public static final java.lang.String ARI_REG
TAP base URL for GAVO registry hosted at ARI Heidelberg.- See Also:
- Constant Field Values
-
AIP_REG
public static final java.lang.String AIP_REG
TAP base URL for GAVO registry hosted at AIP.- See Also:
- Constant Field Values
-
PARIS_REG
public static final java.lang.String PARIS_REG
TAP base URL for registry hosted at ObsPM, synced with GAVO.- See Also:
- Constant Field Values
-
EUROVO_REG
public static final java.lang.String EUROVO_REG
TAP base URL for Euro-VO registry, currently hosted at ESAC.- See Also:
- Constant Field Values
-
STSCI_REG
public static final java.lang.String STSCI_REG
TAP base URL for STScI/VAO registry.- See Also:
- Constant Field Values
-
INAF_REG
public static final java.lang.String INAF_REG
TAP base URL for INAF registry (not sure if this is permanent).- See Also:
- Constant Field Values
-
REGISTRIES
public static final java.lang.String[] REGISTRIES
List of known registry TAP base URLs.
-
REGISTRY_INFO
public static final uk.ac.starlink.table.ValueInfo REGISTRY_INFO
Description of metadata item describing registry location.
-
ADQL_INFO
public static final uk.ac.starlink.table.ValueInfo ADQL_INFO
Description of metadata item describing query text.
-
-
Constructor Detail
-
RegTapRegistryQuery
public RegTapRegistryQuery(TapService tapService, java.lang.String[] standardIds, java.lang.String adqlWhere)
Constructs a query which will return RegResource lists for registry resource records with two optional restrictions: (a) restricted to a given service type, and (b) restricted by some free-form ADQL. The suppliedadqlWheretext has to be written with some knowledge of the internals of this class, for instance what columns are available.- Parameters:
tapService- TAP service hosting relational registrystandardIds- possible case-insensitive values for RRstandard_idfield, or null if not restricted by serviceadqlWhere- text to be ANDed with existing ADQL WHERE clause, or null for no further restriction
-
-
Method Detail
-
getMetadata
public uk.ac.starlink.table.DescribedValue[] getMetadata()
Description copied from interface:RegistryQueryReturns a set of DescribedValue objects which characterise this query. These would be suitable for use in the parameter list of aStarTableresulting from the execution of this query.- Specified by:
getMetadatain interfaceRegistryQuery
-
getRegistry
public java.net.URL getRegistry()
Description copied from interface:RegistryQueryReturns the registry URL.- Specified by:
getRegistryin interfaceRegistryQuery- Returns:
- url
-
getText
public java.lang.String getText()
Description copied from interface:RegistryQueryReturns the query text.- Specified by:
getTextin interfaceRegistryQuery- Returns:
- query
-
getQueryResources
public RegResource[] getQueryResources() throws java.io.IOException
Description copied from interface:RegistryQueryExecutes the query described by this object and returns the result as an array ofRegResources.- Specified by:
getQueryResourcesin interfaceRegistryQuery- Returns:
- resource list
- Throws:
java.io.IOException
-
getQueryIterator
public java.util.Iterator<RegResource> getQueryIterator() throws java.io.IOException
Description copied from interface:RegistryQueryExecutes the query described by this object and returns an Iterator overRegResourceobjects. Note that the iterator'snextmethod may throw the unchecked exceptionRegistryQueryExceptionwith a cause indicating the underlying error in case of a registry access problem.- Specified by:
getQueryIteratorin interfaceRegistryQuery- Returns:
- iterator over
RegResources - Throws:
java.io.IOException
-
getAdqlCondition
public static java.lang.String getAdqlCondition(ResourceField field, java.lang.String keyword)
Returns text that can be used as part of a WHERE clause to supply to this class that tests for a keyword in a given RR field. The nature of the test (=, LIKE etc) depends on the field. If no suitable ADQL can be written, null is returnedNote that this code currently works by identifying known ResourceFields, so unknown ResourceFields will return null.
- Parameters:
field- field whose content is to be testedkeyword- value to test against- Returns:
- ADQL snippet that may be inserted into WHERE clause, or null if it can't be done
-
getSearchableRegistries
public static java.lang.String[] getSearchableRegistries(TapService regtapService) throws java.io.IOException
Queries a given registry for searchable registries suitable for use with this class.- Parameters:
regtapService- TAP service description of bootstrap relational registry- Returns:
- list of TAP base URLs for found relational registries
- Throws:
java.io.IOException
-
-