Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hub/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

.. _changelog_2025-12-22:

2025-12-22
----------
* Deprecated the :ref:`ni-collapse <ni_collapse_dtl_function>` and :ref:`ni-expand <ni_expand_dtl_function>` DTL functions.

.. _changelog_2025-12-18:

2025-12-18
Expand Down
123 changes: 123 additions & 0 deletions hub/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,129 @@ DTL Functions
|


.. _ni_collapse_dtl_function:

``ni-collapse``
---------------

.. list-table::
:header-rows: 1
:widths: 40, 60

* - Description
- Examples

* - | *Arguments:*
| VALUES(value-expression{1})
|
- | Uses the ``namespaces.default`` service metadata contents to produce a namespaced identifier from URLs.
VALUES that are not URLs are ignored (i.e. it accepts strings and URI parameters). If there is no longest
matching prefix in the ``namespaces.default`` settings, the functions will return a NI that contains the
original input (i.e. the The ``http`` and ``https`` prefixes are implicitly defined). Non-http URIs are not
supported.
NOTE: this function is experimental and is meant to work with the ``global_defaults.symmetric_namespace_collapse``
service metadata option set to ``true``.

|
| Given this ``namespaces.default`` mapping in the service metadata:
|
| ``{``
``"foo": "http://psi.test.no/",``
``"sesam_male": "http://sesam.io/people/male/",``
``"sesam_female": "http://sesam.io/people/female/",``
``"sesam": "http://sesam.io/people/"``
``}``
|
| The following examples will produce this output:
|
| ``["ni-collapse", "http://psi.test.no/bar"]``
|
| Returns ``"~:foo:bar"``.
|
| ``["ni-collapse", ["list", "http://psi.test.no/bar", "http://psi.test.no/baz"]]``
|
| Returns ``["~:foo:bar", "~:foo:baz"]``.
|
| ``["ni-collapse", "http://sesam.io/people/employees"]``
|
| Returns ``"~:sesam:employees"``.
|
| ``["ni-collapse", "http://sesam.io/people/male/john"]``
|
| Returns ``"~:sesam_male:john"``.
|
| ``["ni-collapse", "http://sesam.io/people/female/jane"]``
|
| Returns ``"~:sesam_female:jane"``.
|
| The ``http`` and ``https`` namespaces are implicitly defined, so a URI that doesn't match any prefix will work:
|
| ``["ni-collapse", "http://example.com/path"]``
|
| Returns ``"~:http://example.com/path"``.

.. _ni_expand_dtl_function:

``ni-expand``
-------------

.. list-table::
:header-rows: 1
:widths: 40, 60

* - Description
- Examples

* - | *Arguments:*
| VALUES(value-expression{1})
|
- | Uses the ``namespaces.default`` service metadata contents to produce a URL string from a namespaced identifier.
VALUES that are not NIs are ignored. If there is no longest matching prefix in the ``namespaces.default``
settings, the functions will return a string cast of the NI.
NOTE: this function is experimental and is meant to work with the ``global_defaults.symmetric_namespace_collapse``
service metadata option set to ``true``.

|
| Given this ``namespaces.default`` mapping in the service metadata:
|
| ``{``
``"foo": "http://psi.test.no/",``
``"sesam_male": "http://sesam.io/people/male/",``
``"sesam_female": "http://sesam.io/people/female/",``
``"sesam": "http://sesam.io/people/"``
``}``
|
| The following examples will produce this output:
|
| ``["ni-expand", "~:foo:bar"]``
|
| Returns ``http://psi.test.no/bar``.
|
| ``["ni-expand", ["list", "~:foo:bar", "~:foo:baz"]]``
|
| Returns ``["http://psi.test.no/bar", "http://psi.test.no/baz"]``.
|
| ``["ni-expand", "~:sesam:employees"]``
|
| Returns ``"http://sesam.io/people/employees"``.
|
| ``["ni-expand", "~:sesam_male:john"]``
|
| Returns ``"http://sesam.io/people/male/john"``.
|
| ``["ni-expand", "~:sesam_female:jane"]``
|
| Returns ``"http://sesam.io/people/female/jane"``.
|
| ``["ni-expand", "~:http://example.com/path"]``
|
| Returns ``"http://example.com/path"``.
|
| ``["ni-expand", "~:unknown:path"]``
|
| Returns ``"unknown:path"``.


Sources
=======

Expand Down
122 changes: 0 additions & 122 deletions hub/dtl/dtl-functions-namespaced-identifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,128 +94,6 @@ Namespaced identifiers
had already been mapped to the ``unknown`` namespace then the expression would have
returned ``"~:unknown:baz"``.

.. _ni_collapse_dtl_function:

``ni-collapse``
---------------

.. list-table::
:header-rows: 1
:widths: 40, 60

* - Description
- Examples

* - | *Arguments:*
| VALUES(value-expression{1})
|
- | Uses the ``namespaces.default`` service metadata contents to produce a namespaced identifier from URLs.
VALUES that are not URLs are ignored (i.e. it accepts strings and URI parameters). If there is no longest
matching prefix in the ``namespaces.default`` settings, the functions will return a NI that contains the
original input (i.e. the The ``http`` and ``https`` prefixes are implicitly defined). Non-http URIs are not
supported.
NOTE: this function is experimental and is meant to work with the ``global_defaults.symmetric_namespace_collapse``
service metadata option set to ``true``.

|
| Given this ``namespaces.default`` mapping in the service metadata:
|
| ``{``
``"foo": "http://psi.test.no/",``
``"sesam_male": "http://sesam.io/people/male/",``
``"sesam_female": "http://sesam.io/people/female/",``
``"sesam": "http://sesam.io/people/"``
``}``
|
| The following examples will produce this output:
|
| ``["ni-collapse", "http://psi.test.no/bar"]``
|
| Returns ``"~:foo:bar"``.
|
| ``["ni-collapse", ["list", "http://psi.test.no/bar", "http://psi.test.no/baz"]]``
|
| Returns ``["~:foo:bar", "~:foo:baz"]``.
|
| ``["ni-collapse", "http://sesam.io/people/employees"]``
|
| Returns ``"~:sesam:employees"``.
|
| ``["ni-collapse", "http://sesam.io/people/male/john"]``
|
| Returns ``"~:sesam_male:john"``.
|
| ``["ni-collapse", "http://sesam.io/people/female/jane"]``
|
| Returns ``"~:sesam_female:jane"``.
|
| The ``http`` and ``https`` namespaces are implicitly defined, so a URI that doesn't match any prefix will work:
|
| ``["ni-collapse", "http://example.com/path"]``
|
| Returns ``"~:http://example.com/path"``.

.. _ni_expand_dtl_function:

``ni-expand``
-------------

.. list-table::
:header-rows: 1
:widths: 40, 60

* - Description
- Examples

* - | *Arguments:*
| VALUES(value-expression{1})
|
- | Uses the ``namespaces.default`` service metadata contents to produce a URL string from a namespaced identifier.
VALUES that are not NIs are ignored. If there is no longest matching prefix in the ``namespaces.default``
settings, the functions will return a string cast of the NI.
NOTE: this function is experimental and is meant to work with the ``global_defaults.symmetric_namespace_collapse``
service metadata option set to ``true``.

|
| Given this ``namespaces.default`` mapping in the service metadata:
|
| ``{``
``"foo": "http://psi.test.no/",``
``"sesam_male": "http://sesam.io/people/male/",``
``"sesam_female": "http://sesam.io/people/female/",``
``"sesam": "http://sesam.io/people/"``
``}``
|
| The following examples will produce this output:
|
| ``["ni-expand", "~:foo:bar"]``
|
| Returns ``http://psi.test.no/bar``.
|
| ``["ni-expand", ["list", "~:foo:bar", "~:foo:baz"]]``
|
| Returns ``["http://psi.test.no/bar", "http://psi.test.no/baz"]``.
|
| ``["ni-expand", "~:sesam:employees"]``
|
| Returns ``"http://sesam.io/people/employees"``.
|
| ``["ni-expand", "~:sesam_male:john"]``
|
| Returns ``"http://sesam.io/people/male/john"``.
|
| ``["ni-expand", "~:sesam_female:jane"]``
|
| Returns ``"http://sesam.io/people/female/jane"``.
|
| ``["ni-expand", "~:http://example.com/path"]``
|
| Returns ``"http://example.com/path"``.
|
| ``["ni-expand", "~:unknown:path"]``
|
| Returns ``"unknown:path"``.

.. _ni_id_dtl_function:

``ni-id``
Expand Down
11 changes: 5 additions & 6 deletions hub/quick-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,18 @@ DTL Expression Functions
:ref:`now <now_dtl_function>`

* - Dictionaries
- :ref:`dict <dict_dtl_function>` ·
- :ref:`apply <apply_dtl_function>` ·
:ref:`apply-hops <apply_hops_dtl_function>` ·
:ref:`apply-ns <apply_ns_dtl_function>`
:ref:`dict <dict_dtl_function>` ·
:ref:`has-key <has_key_dtl_function>` ·
:ref:`is-dict <is_dict_dtl_function>` ·
:ref:`items <items_dtl_function>` ·
:ref:`key-values <key_values_dtl_function>` ·
:ref:`keys <keys_dtl_function>` ·
:ref:`values <values_dtl_function>` ·
:ref:`path <path_dtl_function>` ·
:ref:`apply <apply_dtl_function>` ·
:ref:`apply-hops <apply_hops_dtl_function>` ·
:ref:`apply-ns <apply_ns_dtl_function>`
:ref:`strip-ns <strip_ns_dtl_function>`

* - Encryption
- :ref:`decrypt <decrypt_dtl_function>` ·
Expand Down Expand Up @@ -259,8 +260,6 @@ DTL Expression Functions
* - Namespaced identifiers
- :ref:`is-ni <is_ni_dtl_function>` ·
:ref:`ni <ni_dtl_function>` ·
:ref:`ni-collapse <ni_collapse_dtl_function>` ·
:ref:`ni-expand <ni_expand_dtl_function>` ·
:ref:`ni-id <ni_id_dtl_function>` ·
:ref:`ni-ns <ni_ns_dtl_function>`

Expand Down