Skip to content

Commit 33aac2a

Browse files
committed
update docs to reflect LinkType removed on Links
1 parent 3ca97a7 commit 33aac2a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/concepts.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,17 @@ Relative vs Absolute Link HREFs
155155

156156
Absolute links point to their file locations in a fully described way. Relative links
157157
are relative to the linking object's file location. For example, if a catalog at
158-
``/some/location/catalog.json`` has a link to an item that has an HREF set to ``item-id/item-id.json``, then that link should resolve to the absolute path ``/some/location/item-id/item-id.json``.
158+
``/some/location/catalog.json`` has a link to an item that has an HREF set to ``item-id/item-id.json``,
159+
then that link should resolve to the absolute path ``/some/location/item-id/item-id.json``.
159160

160-
The implementation of :class:`~pystac.Link` in PySTAC allows for the link to be marked as
161-
``link_type=LinkType.ABSOLUTE`` or ``link_type=LinkType.RELATIVE``. This means that,
162-
even if the stored HREF of the link is absolute, if the link is marked as relative, serializing
163-
the link will produce a relative link, based on the self link of the parent object.
161+
Links are set as absolute or relative HREFs at save time, as determine by the root catalog's catalog_type
162+
:attribute:`~pystac.Catalog.catalog_type`. This means that, even if the stored HREF of the link is absolute,
163+
if the root ``catalog_type=CatalogType.RELATIVE_PUBLISHED`` or ``catalog_type=CatalogType.SELF_CONTAINED``
164+
and subsequent serializing of the any links in the catalog will produce a relative link,
165+
based on the self link of the parent object.
164166

165-
You can make all the links of a catalog relative or absolute using the :func:`Catalog.make_all_links_relative <pystac.Catalog.make_all_links_relative>` and :func:`Catalog.make_all_links_absolute <pystac.Catalog.make_all_links_absolute>` methods.
167+
You can make all the links of a catalog relative or absolute by setting the :func:`Catalog.catalog_type` field
168+
then resaving the entire catalog.
166169

167170
.. _rel vs abs asset:
168171

0 commit comments

Comments
 (0)