{# NOTICE #} {# This software was produced for the U.S. Government under contract FA8702-22-C-0001, #} {# and is subject to the Rights in Data-General Clause 52.227-14, Alt. IV (DEC 2007) #} {# ©2021 The MITRE Corporation. All Rights Reserved. #} {% extends "base.html" %} {% block navbar %} {% include "navbar.html" %} {% endblock navbar %} {% block sidebar %} {% with thispage=main_entity.qname %} {% include "sidebar.html" %} {% endwith %} {% endblock sidebar %} {% block bodycontent %} {% ifequal main_entity_type "shape" %} {% with main_entity as each %} {# each is a OntoShape object #} {# path to this shape #} {% with thispage="shapeinfo" %} {% include "breadcrumbs.html" %} {% endwith %} {# name of this shape, with "leaf node" if it has no children #}

{{each.title}} {% if not each.children %} leaf node {% endif %}


{# horizontal rule #} {# Tree diagram #}
{# URI panel #}

URI

{{each.uri}}
{# Label panel #} {% if each.bestLabel %}

Label

{{each.bestLabel}}
{% endif %} {# Description panel #} {% if each.bestDescription %}

Description

{{each.bestDescription|linebreaks|default:"--"}}
{% endif %} {# Superclasses panel #} {% if each.ancestors %}

Superclasses ({{each.ancestors|length}})

{% if each.ancestors %} {% for s in each.ancestors %}
  • {{s.title}}
  • {% endfor %} {% else %}
  • owl:Thing
  • {% endif %}
    {% endif %} {# Target classes panel #} {% if each.targetClasses %}

    Target Classes ({{each.targetClasses|length}})

    {% for s in each.targetClasses %}
  • {{s.title}}
  • {% endfor %}
    {% endif %} {# Usage panel - the main panel #} {% comment %} The OntoShape object may have zero, one or more target classes, which are OntoClass objects. In practice, all our OntoShapes have exactly one target class, and we use this class's shacl properties to populate this panel If the OntoShape has no target classes, we skip this panel. If the OntoShape has multiple target classes, we use the first one and ignore the rest. {% endcomment %} {% if each.targetClasses %} {# each is an OntoShape which may have target classes #} {% with each.targetClasses.0 as targetClass %} {# targetClass is an OntoClass object for the first target class #}

    Shape Properties

    Instances of {{targetClass.qname}} can have the following properties:

    {# Table header row #} {% for constraint in targetClass.shacl_constraints %} {# constraint is a Constraint object #} {% if constraint.header %} {# THIS ROW CONTAINS ONLY THE HEADER #} {% else %} {# THIS ROW CONTAINS ALL THE COLUMNS #} {% endif %} {% endfor %}

    PROPERTY

    MIN COUNT

    MAX COUNT

    TYPE

    {{constraint.header}} {# PROPERTY #} {% with constraint.property_obj.onto_property as prop %} {{prop.qname}} {% endwith %} {# MIN COUNT #} {{constraint.sh_minCount|join:", "|default:"0"}} {# MAX COUNT #} {{constraint.sh_maxCount|join:", "|default:"*"}} {# LOCAL TYPE #} {% for value in constraint.sh_datatype %} {% if value.onto_class %} {{value.onto_class.qname}} {% else %} {{value.qname}} {% endif %}
    {% endfor %} {% for value in constraint.sh_class %} {% if value.onto_class %} {{value.onto_class.qname}} {% else %} {{value.qname}} {% endif %}
    {% endfor %}
    {% endwith %} {% endif %} {# Implementation panel #}

    Implementation

    {% if pygments_code %} {{pygments_code|safe}} {% else %}
    {{each.rdf_source|linebreaks}}
    {% endif %}
    {% endwith %} {% endifequal %} {% endblock bodycontent %}