It is very useful to break up large catalogs into pieces and separately maintain each piece. One way to do this is to build each piece as a separate and logically-complete catalog, then create a master catalog using catalog references:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"
name="Top Catalog" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- 1 -->
<dataset name="Realtime data from IDD" ID="IDD"> <!-- 2 -->
<catalogRef xlink:href="idd/forecastModels.xml"
xlink:title="Forecast Model Data" name=""/> <!-- 3 -->
<catalogRef xlink:href="idd/forecastProdsAndAna.xml"
xlink:title="Forecast Products and Analyses" name=""/> <!-- 3 -->
<catalogRef xlink:href="idd/obsData.xml"
xlink:title="Observation Data" name=""/> <!-- 3 -->
<catalogRef xlink:href="idd/radars.xml"
xlink:title="Radar Data" name=""/> <!-- 3 -->
<catalogRef xlink:href="idd/satellite.xml"
xlink:title="Satellite Data" name=""/> <!-- 3 -->
</dataset>
<catalogRef xlink:title="Far Away University catalog"
xlink:href="http://www.farAway.edu/thredds/catalog.xml" /> <!-- 4 -->
</catalog>
- We declare the
xlink
namespace
in thecatalog
element. - The collection (or container) dataset logically contains the
catalogRefs
, which are thought of as nested datasets whose contents are the contents of the external catalog. -
Here are several
catalogRef
elements, each with a link to an external catalog, using thexlink:href
attribute. Thexlink:title
is used as the name of the dataset. We need aname
attribute (in order to validate, for obscure reasons), but it is ignored. Thexlink:href
attributes are relative URLs and are resolved against the catalog URL. For example, if the URL of the client catalog, as shown above, is:https://thredds.ucar.edu/thredds/catalog.xml
then the resolved URL of the first
catalogRef
will be: catalogRefs
needn’t point to local catalogs only; this one points to a remote one at Far Away University.- The
metadata
elements withinherited="true"
are NOT copied acrosscatalogRefs
. The catalog that acatalogRef
refers to is stand-alone in that sense.
- The