Difference between revisions of "Template:SetTermInheritanceHierarchy"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
  
 
The template creates a hierarchy of classes for the given term by adding the following lists for ease of access:  
 
The template creates a hierarchy of classes for the given term by adding the following lists for ease of access:  
* <code><nowiki>Subsumed items</nowiki></code> - A list that includes the page itself as well as all of its subclasses, the subclasses of subclasses etc. This is similar to MediWiki's notion of Category where a category includes all of its subcategories as well as itself.
+
* <code><nowiki>Subsumes items</nowiki></code> - A list that includes the page itself as well as all of its subclasses, the subclasses of subclasses etc. This is similar to MediWiki's notion of Category where a category includes all of its subcategories as well as itself.
* <code><nowiki>Descendant items</nowiki></code> - A list that includes the page's subclasses, the subclasses of subclasses etc., but not itself. This data can be used to check if a given class is a subtype (sub, subtype, etc.) of another class but not itself.
+
* <code><nowiki>Descendant items</nowiki></code> - A list that includes the page's subclasses, the subclasses of subclasses etc., but not itself. This data can be used to check if a given class is a subtype (sub, subtype, etc.) of another class but not itself. I.e. the same as <code><nowiki>Subsumes items</nowiki></code> minus the term itself.
* <code><nowiki>Ancestor items</nowiki></code> - A list that includes the page's superclasses, the superclasses of superclasses etc., but not itself.  
+
* <code><nowiki>Subsumed items</nowiki></code> - A list that includes the page itself as well as all of its superclasses, the superclasses of superclasses etc. This list is useful when checking what heritable questions should be available for a given term.  
 +
* <code><nowiki>Ancestor items</nowiki></code> - A list that includes the page's superclasses, the superclasses of superclasses etc., but not itself. I.e. the same as <code><nowiki>Subsumed items</nowiki></code> minus the term itself.
  
 
In addition, it creates the following multivalued properties (lists):
 
In addition, it creates the following multivalued properties (lists):
Line 56: Line 57:
 
   -->{{#arrayprint:varChildrenArray||@@@@|{{#set:Child Class=@@@@}}|}}<!--  
 
   -->{{#arrayprint:varChildrenArray||@@@@|{{#set:Child Class=@@@@}}|}}<!--  
 
   --><!--  
 
   --><!--  
   --><!-- set the inheritance hierarchy
+
   --><!-- set the subsumes and descendants hierarchies
 
   -->{{#set:Subsumes items={{{term|}}}}}<!--
 
   -->{{#set:Subsumes items={{{term|}}}}}<!--
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Subsumes items::<q>[[Parent Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumesArray|{{#ask: [[-Subsumes items::<q>[[Parent Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
   -->{{#arrayunique:varSubsumeArray}}<!--
+
   -->{{#arrayunique:varSubsumesArray}}<!--
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
+
   -->{{#arrayprint:varSubsumesArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
 
   --><!--
 
   --><!--
 
   --><!-- have to do it again to include the subsumed elements of the subsumed elements
 
   --><!-- have to do it again to include the subsumed elements of the subsumed elements
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Subsumes items::<q>[[Parent Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumesArray|{{#ask: [[-Subsumes items::<q>[[Parent Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
   -->{{#arrayunique:varSubsumeArray}}<!--
+
   -->{{#arrayunique:varSubsumesArray}}<!--
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
+
   -->{{#arrayprint:varSubsumesArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
 
   --><!--  
 
   --><!--  
   --><!-- set the inheritance hierarchy
+
   --><!-- set the subsumed and ancestor hierarchies
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Ancestor items::<q>[[Child Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
  -->{{#set:Subsumed items={{{term|}}}}}<!--
   -->{{#arrayunique:varSubsumeArray}}<!--
+
   -->{{#arraydefine:varSubsumedArray|{{#ask: [[-Subsumed items::<q>[[Child Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!--  
+
   -->{{#arrayunique:varSubsumedArray}}<!--
 +
   -->{{#arrayprint:varSubsumedArray||@@@@|{{#set:Subsumed items=@@@@|Ancestor items=@@@@}}|}}<!--  
 
   --><!--
 
   --><!--
 
   --><!-- have to do it again to include the subsumed elements of the subsumed elements
 
   --><!-- have to do it again to include the subsumed elements of the subsumed elements
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Ancestor items::<q>[[Child Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumedArray|{{#ask: [[-Subsumed items::<q>[[Child Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
   -->{{#arrayunique:varSubsumeArray}}<!--
+
   -->{{#arrayunique:varSubsumedArray}}<!--
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!--  
+
   -->{{#arrayprint:varSubsumedArray||@@@@|{{#set:Subsumed items=@@@@|Ancestor items=@@@@}}|}}<!--  
 
   --><!--  
 
   --><!--  
 
   --><!--  
 
   --><!--  
 
-->}}<!-- if term
 
-->}}<!-- if term
 
--></includeonly>
 
--></includeonly>

Latest revision as of 20:51, 12 January 2023

This template is used to save the currently accepted associations claims (aggregation, composition, etc.) of the given class.

The template creates a hierarchy of classes for the given term by adding the following lists for ease of access:

  • Subsumes items - A list that includes the page itself as well as all of its subclasses, the subclasses of subclasses etc. This is similar to MediWiki's notion of Category where a category includes all of its subcategories as well as itself.
  • Descendant items - A list that includes the page's subclasses, the subclasses of subclasses etc., but not itself. This data can be used to check if a given class is a subtype (sub, subtype, etc.) of another class but not itself. I.e. the same as Subsumes items minus the term itself.
  • Subsumed items - A list that includes the page itself as well as all of its superclasses, the superclasses of superclasses etc. This list is useful when checking what heritable questions should be available for a given term.
  • Ancestor items - A list that includes the page's superclasses, the superclasses of superclasses etc., but not itself. I.e. the same as Subsumed items minus the term itself.

In addition, it creates the following multivalued properties (lists):

  • Parent Class - The list of immediate parent terms (no grandparents).
  • Child Class - The list of immediate child terms (no grandchildren).

NOTE: this inheritance hierarchy is created irrespective of the agent who accepts the class as a subtype/supertype of another class. Such an agent-agnostic hierarchy is required when adding new theories that select their answer from a list of subtypes, or adding inherited questions.

IMPORTANT: It is not to be conflated with the actual agent-relative ontology of the term, stored in subobjects of SubObjectCategory=Topic Current Ontology with Ontological Question Type={Subtypes, Supertypes}.


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

Parameters:

  • |term= - the term page.