-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslot.md.jinja2
93 lines (73 loc) · 3.13 KB
/
slot.md.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!-- Jinja2 template based on https://github.com/linkml/linkml/blob/main/linkml/generators/docgen/slot.md.jinja2 -->
<!-- This file should be periodically checked against the original source -->
<!-- Last check 25 August 2023 -->
# Property: {{ gen.name(element) }}
{%- 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 %}
URI: {{ gen.uri_link(element) }}
## Obligation and Cardinality
The table below details the classes which use this property and the conditions of its use.
| Class | Range | Obligation | Cardinality |
|-----------------------------|-----------------------------|-------------|-------------|
{% for c in schemaview.get_classes_by_slot(element, include_induced=True) -%}
{%- for slot in schemaview.class_induced_slots(c) -%}
{%- if gen.name(slot) == gen.name(element) -%}
| {{ gen.link(c) }} | {{ gen.link(slot.range) }}{% if slot.minimum_value is not none %}<br/>Minimum Value: {{ slot.minimum_value|int }}{% endif %}{% if slot.maximum_value is not none %}<br/>Maximum Value: {{ slot.maximum_value|int }}{% endif %}{% if slot.pattern %}<br/>Regex pattern: {{ '`' }}{{ slot.pattern }}{{ '`' }}{% endif %} | {% if slot.required %}Mandatory{% elif slot.recommended %}Recommended{% else %}Optional{% endif %} | {% if slot.multivalued %}Many{% else %}One{% endif %} |
{%- endif -%}
{% endfor %}
{% endfor %}
{% if schemaview.is_mixin(element.name) %}
Mixin: {{ element.mixin }}
{% endif -%}
## Usage Notes
{% if element.comments %}
{% set comments = element.comments | join('') %}
{% set comments_lines = comments.split('\n') %}
{% for line in comments_lines %}
{% if line.startswith('purpose:') %}
### Purpose
{% elif line.startswith('distinctFrom:') %}
### Do not confuse with
{% elif line.startswith('guidance:') %}
### Guidelines
{% else %}
{{ line }}
{% endif %}
{% endfor %}
{% else %}
_Usage notes still to be provided._
{% 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 %}
{% 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 %}
{% 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" %}
{% include "feedback_footer.md.jinja2" %}
{%- if footer -%}
{{footer}}
{%- endif -%}