USGS - science for a changing world

Science Topics

Thesaurus term web services

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

Search

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

  1. 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"}
]

Term details

Provides detailed information about a given thesaurus term, which may be specified by its unique identifier or by the text of its descriptor.
Service URL http://www.usgs.gov/science/term.php
Parameters
thcode Thesaurus identifier; if not specified, the USGS Thesaurus will be used
code Unique identifier of the descriptor
text Text of the descriptor, if descriptors are distinct in the specified thesaurus
callback Name of a function in which to wrap the results, to support JSONP
Output A single object containing the following members:
term Single term object specifying the term, as follows:
code Unique identifier for this term
name Descriptor text for this term
parent Unique identifier of the parent of this term
scope Scope note for the term
uf Array of objects specifying USE-FOR and USE-WITH relationships:
name Text of the non-preferred term
usewith false for a simple non-preferred term, or a term object if the text is to be used for both the given descriptor and another descriptor together
bt Array of term objects specifying the broader terms, each the parent of the previous entry
nt Array of term objects specifying the narrower terms
rt Array of term objects specifying the related terms

Special cases

  1. If no parameters are given, the service returns an array of objects describing the thesauri that are available in the current database instance: http://www.usgs.gov/science/term.php
  2. If a valid thesaurus code is given but neither a term code nor a descriptor is given, the root node of the thesaurus will be returned: http://www.usgs.gov/science/term.php?thcode=2

Example

http://www.usgs.gov/science/term.php?code=769

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://www.usgs.gov/science/tab-term.html
Page Contact Information: Ask USGS
Page Last Modified: Thursday, 14-Feb-2013 09:31:03 EST