Package uk.ac.starlink.vo

## Class Vocabulary

- java.lang.Object
- - uk.ac.starlink.vo.Vocabulary

-     public class Vocabulary
      extends java.lang.Object

  Represents information from an IVOA Vocabulary. Functionality right now is very limited; it just returns the names of the terms defined. The vocabulary parsing implementation is also extremely sloppy, it ignores the RDF document structure altogether and just looks for some likely looking attribute names. But it's probably good enough for current purposes.

  If more is required in the future, the API and implementation may change significantly.

  In principle, this follows the prescription of the IVOA Vocabularies standard. However, at time of writing, the most recent version of that document, v1.19, is out of date and in practice not followed by actual vocabularies in the VO; in particular none of the SKOS machinery is used any more. The current implementation of this class is very minimally dependent on the details of vocabulary implementation, so it doesn't matter much for now.

  See Also:
    IVOA Vocabularies Recommendation

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Vocabulary​(java.lang.String[] termNames)` | Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String[]` | `getTermNames()` | Returns the list of names referenced in this vocabulary.
    `static void` | `main​(java.lang.String[] args)` | Test.
    `static Vocabulary` | `readVocabulary​(java.net.URL vocabUrl)` | Returns a vocabulary read from a given URL.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Vocabulary

          public Vocabulary​(java.lang.String[] termNames)

      Constructor.
      Parameters:
        `termNames` - list of unqualified names; these are fragment identifiers only (no # character) within the namespace of the vocabulary in question

  - ### Method Detail

    - #### getTermNames

          public java.lang.String[] getTermNames()

      Returns the list of names referenced in this vocabulary.
      Returns:
        list of unqualified names; these are fragment identifiers only (no # character) within the namespace of the vocabulary in question

    - #### readVocabulary

          public static Vocabulary readVocabulary​(java.net.URL vocabUrl)
                                           throws java.io.IOException,
                                                  org.xml.sax.SAXException

      Returns a vocabulary read from a given URL. The URL is both the namespace in which terms are required, and the location of the vocabulary document. In accordance with the IVOA Vocabularies standard, the vocabulary must be available from the URL in question in `application/rdf+xml` format.
      Parameters:
        `vocabUrl` - vocabularly namespace and resource URL
      Throws:
        `java.io.IOException`
        `org.xml.sax.SAXException`

    - #### main

          public static void main​(java.lang.String[] args)
                           throws java.io.IOException,
                                  org.xml.sax.SAXException

      Test.
      Throws:
        `java.io.IOException`
        `org.xml.sax.SAXException`