Difference between revisions of "Template:SetTermOntologySubtypes"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
(Created blank page)
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<noinclude>
 +
This template is used to save the currently accepted subtypes claims of the given class.
  
 +
For each community where the term is currently accepted, the template searches for subtype claims, groups these claims by their Disjoint Group, and then for each group as well as each ungrouped claim creates a subobject with the following properties:
 +
* <code><nowiki>SubObjectCategory</nowiki></code> = "Topic Current Ontology".
 +
* <code><nowiki>Community</nowiki></code> - the community that accepts the theory.
 +
* <code><nowiki>Term</nowiki></code> - the term page. Note that this should be the definitional topic page, not the page for the respective ontological question.
 +
* <code><nowiki>Topic</nowiki></code> - the page for the respective ontological question for ease of access.
 +
* <code><nowiki>Ontological Question Type</nowiki></code> - Subtypes
 +
* <code><nowiki>Disjoint Group</nowiki></code> - the name of disjoint group.
 +
* <code><nowiki>Theory</nowiki></code> - the pages for the respective theories for ease of access (uses <code><nowiki>|+sep=,</nowiki></code>).
 +
* <code><nowiki>Subtypes</nowiki></code> - a comma separated list of children classes (uses <code><nowiki>|+sep=,</nowiki></code>).
 +
 +
'''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.
 +
 +
'''Parameters:'''
 +
* <code><nowiki>|term=</nowiki></code> - the term page.
 +
 +
</noinclude><includeonly><!--
 +
-->{{#if: {{{term|}}}<!--
 +
-->|<!--
 +
  -->{{#vardefine: varTerm|{{{term|}}}}}<!--
 +
  --><!-- get the topic page
 +
  -->{{#vardefine: varTopic|{{FormatSubtypesTopicTitle|term={{#var: varTerm}}|}}|}}<!--
 +
  --><!--
 +
  --><!-- get the list of the communities where the topic is accepted
 +
  -->{{#arraydefine: varCommunities|{{PrintTopicCurrentlyAcceptedInCommunitiesList|topic={{#var: varTopic}}|link=none}}|,|unique}}<!--
 +
  -->{{#arrayunique: varCommunities}}<!-- remove duplicates and empty values
 +
  -->{{#arrayprint: varCommunities||varCommunity<!--
 +
  -->|<!--
 +
    -->{{#arraydefine: varTheories|{{PrintTopicAnswerAcceptedInCommunity|topic={{#var: varTopic}}|community=varCommunity|link=none}}|,|}}<!--
 +
    -->{{#arrayunique: varTheories}}<!-- remove duplicates and empty values
 +
    -->{{#ifexpr: {{#arraysize:varTheories}} = 0 <!-- check if the array exists
 +
    -->|<!--
 +
      --><!-- no claims found: store a subobject leaving Disjoint Group, Disjoints, and theory empty
 +
      -->{{#subobject:<!--
 +
      -->|SubObjectCategory=Topic Current Ontology<!--
 +
      -->|Term={{#var: varTerm}}<!--
 +
      -->|Topic={{#var: varTopic}}<!--
 +
      -->|Ontological Question Type=Subtypes<!--
 +
      -->|Community=varCommunity<!--
 +
      -->|Disjoint Group=<!--
 +
      -->|Disjoint Group Order=<!--
 +
      -->|Theory=<!--
 +
      -->|Subtypes=<!--
 +
      -->}}<!-- subobject
 +
      --><!--
 +
    -->|<!--
 +
      --><!-- some claims are found: get the names of disjoint groups in the correct order
 +
      -->{{#arraydefine: varGroups|{{PrintAcceptedDisjointGroupsList|term={{#var: varTerm}}|community=varCommunity}}|,|}}<!--
 +
      --><!--
 +
      --><!-- for each group, get the accepted theories
 +
      -->{{#arrayprint: varGroups||varGroup<!--
 +
      -->|<!--
 +
        --><!--
 +
        --><!-- get the children
 +
        -->{{#arraydefine: arraySubtypes<!--
 +
          -->|<!--
 +
          -->{{#ask:<!--
 +
            -->[[SubObjectCategory::Acceptance Record]]<!-- 
 +
            -->[[Community::varCommunity]]<!--
 +
            -->[[Still Accepted::true]]<!--
 +
            -->[[Topic::{{#var:varTopic}}]]<!--
 +
            -->[[Element.Disjoint Group::varGroup]]<!--
 +
            -->|?Element.Child<!--
 +
            -->|mainlabel=-<!--
 +
            -->|headers=hide<!--
 +
            -->|sort=Element.Child<!--
 +
            -->|order=asc<!--
 +
            -->|link=none<!--
 +
            -->|limit=10000<!--
 +
          -->}}<!--
 +
          -->| , |unique<!--
 +
        -->}}<!-- arraydefine subtypes
 +
        --><!--
 +
        --><!-- get the theories
 +
        -->{{#arraydefine: arraySubtypeTheories<!--
 +
          -->|<!--
 +
          -->{{#ask:<!--
 +
            -->[[SubObjectCategory::Acceptance Record]]<!-- 
 +
            -->[[Community::varCommunity]]<!--
 +
            -->[[Still Accepted::true]]<!--
 +
            -->[[Topic::{{#var:varTopic}}]]<!--
 +
            -->[[Element.Disjoint Group::varGroup]]<!--
 +
            -->|?Element<!--
 +
            -->|mainlabel=-<!--
 +
            -->|headers=hide<!--
 +
            -->|sort=Element.Child<!--
 +
            -->|order=asc<!--
 +
            -->|link=none<!--
 +
            -->|limit=10000<!--
 +
          -->}}<!--
 +
          -->| , |unique<!--
 +
        -->}}<!-- arraydefine theories
 +
        --><!--
 +
        --><!--
 +
        --><!-- store the subobject
 +
        --><!-- store the subobject
 +
        -->{{#subobject:<!--
 +
          -->|SubObjectCategory=Topic Current Ontology<!--
 +
          -->|Term={{#var: varTerm}}<!--
 +
          -->|Topic={{#var: varTopic}}<!--
 +
          -->|Ontological Question Type=Subtypes<!--
 +
          -->|Community=varCommunity<!--
 +
          -->|Disjoint Group=varGroup<!--
 +
          -->|Disjoint Group Order={{PrintDisjointGroupOrder|disjointgroup=varGroup}}<!--
 +
          -->|Theory={{#arrayprint: arraySubtypeTheories|,|@@@@|@@@@}}|+sep=,<!--
 +
          -->|Subtypes={{#arrayprint: arraySubtypes|,|@@@@|@@@@}}|+sep=,<!--
 +
        -->}}<!-- subobject
 +
        --><!--
 +
        --><!--
 +
        --><!--
 +
      -->}}<!-- arrayprint group
 +
      --><!--
 +
    -->}}<!-- ifexp
 +
    --><!--
 +
  -->}}<!-- arrayprint community
 +
  --><!--
 +
-->}}<!-- if term
 +
--></includeonly>

Latest revision as of 16:19, 31 December 2022

This template is used to save the currently accepted subtypes claims of the given class.

For each community where the term is currently accepted, the template searches for subtype claims, groups these claims by their Disjoint Group, and then for each group as well as each ungrouped claim creates a subobject with the following properties:

  • SubObjectCategory = "Topic Current Ontology".
  • Community - the community that accepts the theory.
  • Term - the term page. Note that this should be the definitional topic page, not the page for the respective ontological question.
  • Topic - the page for the respective ontological question for ease of access.
  • Ontological Question Type - Subtypes
  • Disjoint Group - the name of disjoint group.
  • Theory - the pages for the respective theories for ease of access (uses |+sep=,).
  • Subtypes - a comma separated list of children classes (uses |+sep=,).

NOTE: As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.

Parameters:

  • |term= - the term page.