Two complementary web services provide information from the USGS
Thesaurus and related controlled vocabularies in
JSONP format. These services enable web pages to obtain detailed
information about thesaurus terms for use in dynamic web interfaces.
An example web page making use of these services is at
http://www.usgs.gov/science/tab-term.html
A term search service supports the
jQuery autocomplete function,
returning an array of objects describing thesaurus terms that begin with
the given text. The match is not case sensitive.
| Service URL |
http://www.usgs.gov/science/term-search.php |
| Parameters |
| thcode |
Thesaurus identifier; if not specified, the USGS Thesaurus will be used |
| term |
Fragment of text to match candidate terms |
| callback |
Name of a function in which to wrap the results, to support JSONP |
| u |
Set to zero to exclude non-preferred terms from the results |
|
| Output |
An array of objects, each containing the following members:
| code |
Unique identifier for a term within the thesaurus |
| label |
Text matching the input string, may be the non-preferred term |
| value |
Descriptor text of the matched thesaurus term |
|
Special cases
-
If no term is given, the service returns an empty array array:
http://www.usgs.gov/science/term-search.php
Example
(line breaks and extra spaces added here for clarity)
http://www.usgs.gov/science/term-search.php?term=con
[
{"code":"1754","label":"conference proceedings", "value":"conference proceedings"},
{"code": "237","label":"conflict resolution methods", "value":"decision support methods"},
{"code": "410","label":"coniferous forests ecosystems","value":"forest ecosystems"},
{"code": "192","label":"conodonts", "value":"conodonts"},
{"code": "776","label":"conservation", "value":"natural resource management"},
{"code": "194","label":"consumers (organisms)", "value":"consumers (organisms)"},
{"code":"1313","label":"consumptive use (water)", "value":"water use"},
{"code": "452","label":"contacts (geologic)", "value":"geologic contacts"},
{"code": "196","label":"contaminant transport", "value":"contaminant transport"},
{"code": "769","label":"contamination and pollution", "value":"contamination and pollution"},
{"code":"1145","label":"continental drift", "value":"tectonic processes"},
{"code": "199","label":"continental lithosphere", "value":"continental lithosphere"},
{"code":"1776","label":"contract research programs", "value":"external research support"},
{"code": "202","label":"controlled burns", "value":"controlled fires"},
{"code": "202","label":"controlled fires", "value":"controlled fires"},
{"code": "203","label":"controlled flooding", "value":"controlled flooding"},
{"code":"1744","label":"controlled vocabularies", "value":"terminologies and classifications"}
]