Package uk.ac.starlink.ttools.votlint
Class VocabChecker
java.lang.Object
uk.ac.starlink.ttools.votlint.VocabChecker
Checks values that are defined by the content of an IVOA Vocabulary.
- Since:
- 25 Apr 2019
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Callback interface for reporting vocabulary interrogation results. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VocabChecker
Instance for vocabulary at http://www.ivoa.net/rdf/datalink/core.static final VocabChecker
Instance for vocabulary at http://www.ivoa.net/examples.static final VocabChecker
Instance for vocabulary at http://www.ivoa.net/rdf/messenger.static final VocabChecker
Instance for vocabulary at http://www.ivoa.net/rdf/product-type.static final VocabChecker
Instance for vocabulary at http://www.ivoa.net/rdf/refframe.static final VocabChecker
Instance for vocabulary at http://www.ivoa.net/rdf/refposition.static final VocabChecker
Instance for vocabulary at http://www.ivoa.net/rdf/timescale. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkTerm
(String value, VocabChecker.TermReporter termReporter) Checks whether a term is present in this vocabulary, and reports to a callback interface.Returns the hard-coded list of terms known by this checker.Lazily acquires vocabulary values by reading the resource at the vocabulary URI.Returns the URI of this object's vocabulary in string form.Returns the URI/URL of this object's vocabulary.static void
Run to check hard-coded term lists against online versions.toString()
-
Field Details
-
TIMESCALE
Instance for vocabulary at http://www.ivoa.net/rdf/timescale. -
REFPOSITION
Instance for vocabulary at http://www.ivoa.net/rdf/refposition. -
REFFRAME
Instance for vocabulary at http://www.ivoa.net/rdf/refframe. -
DATALINK_CORE
Instance for vocabulary at http://www.ivoa.net/rdf/datalink/core. -
PRODUCT_TYPE
Instance for vocabulary at http://www.ivoa.net/rdf/product-type. -
EXAMPLES
Instance for vocabulary at http://www.ivoa.net/examples. -
MESSENGER
Instance for vocabulary at http://www.ivoa.net/rdf/messenger.
-
-
Constructor Details
-
VocabChecker
Constructor.- Parameters:
vocabUrl
- URI/URL for vocabulary documentfixedTerms
- hard-coded non-preliminary, non-deprecated terms known in the vocabulary; other terms may be available by resolving the vocabulary URL
-
-
Method Details
-
checkTerm
Checks whether a term is present in this vocabulary, and reports to a callback interface.- Parameters:
value
- vocabulary name item to testtermReporter
- destination for reports; exactly one of its methods will be invoked
-
getVocabularyUrl
Returns the URI/URL of this object's vocabulary.- Returns:
- vocabulary URL
-
getVocabularyUri
Returns the URI of this object's vocabulary in string form.- Returns:
- vocabulary URL
-
getFixedTerms
Returns the hard-coded list of terms known by this checker. It may not be complete if this class is out of date with respect to the vocabulary itself.- Returns:
- unmodifiable list of known terms
-
getRetrievedTerms
Lazily acquires vocabulary values by reading the resource at the vocabulary URI.- Returns:
- term map retrieved from online vocabulary; in case of a read error this may be empty, but not null
-
toString
-
main
Run to check hard-coded term lists against online versions. This can be done periodically, and the hard-coded lists updated accordingly.- Throws:
IOException
-