{%- if element.title %}
    {%- set title = element.title ~ ' (' ~ element.name ~ ')' -%}
{%- else %}
    {%- if gen.use_slot_uris -%}
        {%- set title = element.name -%}
    {%- else -%}
        {%- set title = gen.name(element) -%}
    {%- endif -%}
{%- endif -%}

{% macro compute_range(slot) -%}
    {%- if slot.any_of or slot.exactly_one_of -%}
        {%- for subslot_range in schemaview.slot_range_as_union(slot) -%}
            {{ gen.link(subslot_range) }}
            {%- if not loop.last -%}
                &nbsp;or&nbsp;<br />
            {%- endif -%}
        {%- endfor -%}
    {%- else -%}
        {{ gen.link(slot.range) }}
    {%- endif -%}
{% endmacro %}

# Slot: {{ title }} {% if element.deprecated %} <span style="color: red;"><strong> (DEPRECATED) </strong></span> {% endif %}

{%- if header -%}
{{ header }}
{%- endif -%}

{% if element.description %}
{% set element_description_lines = element.description.split('\n') %}
{% for element_description_line in element_description_lines %}
_{{ element_description_line }}_
{% endfor %}
{% endif %}

{% if element.abstract %}
* __NOTE__: this is an abstract slot and should not be populated directly
{% endif %}

URI: {{ gen.uri_link(element) }}

{%- if element.alias %}
Alias: {{ element.alias }}
{% endif -%}

{% if schemaview.slot_parents(element.name) or schemaview.slot_children(element.name, mixins=False) %}

## Inheritance

{{ gen.inheritance_tree(element, mixins=True) }}
{% else %}
<!-- no inheritance hierarchy -->
{% endif %}

{% set classes_by_slot = schemaview.get_classes_by_slot(element, include_induced=True) %}
{% if classes_by_slot %}

## Applicable Classes

| Name | Description | Modifies Slot |
| --- | --- | --- |
{% for c in classes_by_slot -%}
| {{ gen.link(c) }} | {{ schemaview.get_class(c).description|enshorten }} | {% if c in schemaview.get_classes_modifying_slot(element) %} yes {% else %} no {% endif %} |
{% endfor %}

{% endif %}

{% if schemaview.is_mixin(element.name) %}
## Mixin Usage

| mixed into | description | range | domain |
| --- | --- | --- | --- |
{% for s in schemaview.slot_children(element.name, is_a=False) -%}
| {{ gen.link(s) }} | {{ schemaview.get_slot(s).description|enshorten }} | {{ schemaview.get_slot(s).range }} | {{ schemaview.get_classes_by_slot(schemaview.get_slot(s))|join(', ') }} |
{% endfor %}
{% endif %}

## Properties

* Range: {{ compute_range(element) }}
{% if element.multivalued %}
* Multivalued: {{ element.multivalued }}
{% endif -%}
{% if element.required %}
* Required: {{ element.required }}
{% elif element.recommended %}
* Recommended: {{ element.recommended }}
{% endif -%}
{% if element.minimum_value is not none %}
* Minimum Value: {{ element.minimum_value|int }}
{% endif -%}
{% if element.maximum_value is not none %}
* Maximum Value: {{ element.maximum_value|int }}
{% endif -%}
{% if element.pattern %}
* Regex pattern: {{ '`' }}{{ element.pattern }}{{ '`' }}
{% endif -%}
{% if schemaview.is_mixin(element.name) %}
* Mixin: {{ element.mixin }}
{% endif -%}

{% if schemaview.usage_index().get(element.name) %}
## Usages

| used by | used in | type | used |
| ---  | --- | --- | --- |
{% for usage in schemaview.usage_index().get(element.name) -%}
| {{ gen.link(usage.used_by) }} | {{ gen.link(usage.slot) }} | {{ usage.metaslot }} | {{ gen.link(usage.used) }} |
{% endfor %}
{% endif %}

{% include "common_metadata.md.jinja2" %}

## LinkML Source

<details>
```yaml
{{ gen.yaml(element) }}
```
</details>

{%- if footer -%}
{{ footer }}
{%- endif -%}
