Class IvoaSchemaResolver

java.lang.Object
uk.ac.starlink.ttools.taplint.IvoaSchemaResolver
All Implemented Interfaces:
LSResourceResolver

public class IvoaSchemaResolver extends Object implements LSResourceResolver
ResourceResolver implementation used for validating documents against XSD schemas relating to known IVOA standards. Schemas for a number of IVOA-related namespaces are kept locally. This means both that validation can be performed without having to retrieve documents from the remote IVOA web site, and also that documents are not able to subsitute their own hacked versions of the schema for a given namespace, they have to use the official one.
Since:
28 Apr 2014
Author:
Mark Taylor
  • Field Details

    • VODATASERVICE_URI

      public static final String VODATASERVICE_URI
      Namespace URI for VODataService schema.
      See Also:
    • CAPABILITIES_URI

      public static final String CAPABILITIES_URI
      Namespace URI for VOSI capabilities schema.
      See Also:
    • AVAILABILITY_URI

      public static final String AVAILABILITY_URI
      Namespace URI for VOSI availability schema.
      See Also:
    • UWS_URI

      public static final String UWS_URI
      Namespace URI for UWS schema.
      See Also:
    • IVOA_SCHEMA_MAP

      public static final Map<String,URL> IVOA_SCHEMA_MAP
      Unmodifiable map of namespace URIs to local schema URLs for a selection of schemas from http://www.ivoa.net. Note that the namespace (map key) does not necessarily match the URL (map value) in point of minor version number; the minor version number in the URL may be later than the one in the namespace. This is deliberate, and is codified and explained in the XML Versioning document (at time of writing, PEN-XMLVers-1.0-20160906, sec 2.2.3).
    • W3C_SCHEMA_MAP

      public static final Map<String,URL> W3C_SCHEMA_MAP
      Unmodifiable map of namespace URIs to local schema URLs for a selection of schemas from http://www.w3.org.
  • Constructor Details

    • IvoaSchemaResolver

      public IvoaSchemaResolver(Map<String,URL> schemaMap)
      Constructs a resolver with a supplied schema map.
      Parameters:
      schemaMap - of known namespace to schema URLs
    • IvoaSchemaResolver

      public IvoaSchemaResolver()
      Constructs a resolver with a default schema map.
  • Method Details

    • getSchemaMap

      public Map<String,URL> getSchemaMap()
      Returns the namespace->URL map of schemas known by this resolver. This may be modified to change the resolution behaviour.
      Returns:
      modifiable namespace->URL map for known schemas
    • resolveResource

      public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI)
      Specified by:
      resolveResource in interface LSResourceResolver
    • getResolvedNamespaces

      public Set<String> getResolvedNamespaces()
      Returns the the schema namespaces which this resolver has so far been asked to resolve, and has successfully resolved to known URLs.
      Returns:
      successful schema namespace resolutions to date
    • getUnresolvedNamespaces

      public Set<String> getUnresolvedNamespaces()
      Returns the schema namespaces which this resolver has so far been asked to resolve, and has failed because they are unknown.
      Returns:
      unsuccessful schema namespace resolutions to date