<commit_before>.. _ref_eql_sdl_links:

=====
Links
=====

This section describes the SDL declarations pertaining to
:ref:`links <ref_datamodel_links>`.


Examples
--------

Declare an *abstract* link "friends_base" with a helpful title:

.. code-block:: sdl

    abstract link friends_base {
        # declare a specific title for the link
        annotation title := 'Close contacts';
    }

Declare a *concrete* link "friends" within a "User" type:

.. code-block:: sdl

    type User {
        required property name -> str;
        property address -> str;
        # define a concrete link "friends"
        multi link friends extending friends_base-> User;

        index on (__subject__.name);
    }

Any time that the SDL declaration refers to an inherited link that is
being overloaded (by adding more constraints or changing the target
type, for example), the ``overloaded`` keyword must be used. This is<commit_msg>docs: Add a ref for the 'overloaded' SDL keyword<commit_after>.. _ref_eql_sdl_links:

=====
Links
=====

This section describes the SDL declarations pertaining to
:ref:`links <ref_datamodel_links>`.


Examples
--------

Declare an *abstract* link "friends_base" with a helpful title:

.. code-block:: sdl

    abstract link friends_base {
        # declare a specific title for the link
        annotation title := 'Close contacts';
    }

Declare a *concrete* link "friends" within a "User" type:

.. code-block:: sdl

    type User {
        required property name -> str;
        property address -> str;
        # define a concrete link "friends"
        multi link friends extending friends_base-> User;

        index on (__subject__.name);
    }

.. _ref_eql_sdl_links_overloading:

Overloading
~~~~~~~~~~~

Any time that the SDL declaration refers to an inherited link that is
being overloaded (by adding more constraints or changing the target
type, for example), the ``overloaded`` keyword must be used. This is
{'fraction_non_alphanumeric': 0.09917780061664953, 'fraction_numerical': 0.0, 'mean_word_length': 3.1513859275053306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4859979', 'n_tokens_mistral': 559, 'n_tokens_neox': 521, 'n_words': 223}