You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts.rst
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -155,14 +155,17 @@ Relative vs Absolute Link HREFs
155
155
156
156
Absolute links point to their file locations in a fully described way. Relative links
157
157
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``.
159
160
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.
164
166
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
0 commit comments