Difference between revisions of "Template:SetTermInheritanceHierarchy"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 8: Line 8:
  
 
In addition, it creates the following multivalued properties (lists):
 
In addition, it creates the following multivalued properties (lists):
* <code><nowiki>Parent Topic</nowiki></code> - The list of immediate parent terms (no grandparents).
+
* <code><nowiki>Parent Class</nowiki></code> - The list of immediate parent terms (no grandparents).
* <code><nowiki>Child Topic</nowiki></code> - The list of immediate child terms (no grandchildren).
+
* <code><nowiki>Child Class</nowiki></code> - 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.
 
'''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.
Line 38: Line 38:
 
   -->}}<!-- arraydefine
 
   -->}}<!-- arraydefine
 
   -->{{#arrayunique:varParentsArray}}<!--
 
   -->{{#arrayunique:varParentsArray}}<!--
   -->{{#arrayprint:varParentsArray||@@@@|{{#set:Parent Topic=@@@@}}|}}<!--  
+
   -->{{#arrayprint:varParentsArray||@@@@|{{#set:Parent Class=@@@@}}|}}<!--  
 
   --><!--
 
   --><!--
 
   --><!-- set the children
 
   --><!-- set the children
Line 54: Line 54:
 
   -->}}<!-- arraydefine
 
   -->}}<!-- arraydefine
 
   -->{{#arrayunique:varChildrenArray}}<!--
 
   -->{{#arrayunique:varChildrenArray}}<!--
   -->{{#arrayprint:varChildrenArray||@@@@|{{#set:Child Topic=@@@@}}|}}<!--  
+
   -->{{#arrayprint:varChildrenArray||@@@@|{{#set:Child Class=@@@@}}|}}<!--  
 
   --><!--  
 
   --><!--  
 
   --><!-- set the inheritance hierarchy
 
   --><!-- set the inheritance hierarchy
 
   -->{{#set:Subsumes items={{{term|}}}}}<!--
 
   -->{{#set:Subsumes items={{{term|}}}}}<!--
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Subsumes items::<q>[[Parent Topic::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Subsumes items::<q>[[Parent Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#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 Topic::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Subsumes items::<q>[[Parent Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!--  
 
   --><!--  
 
   --><!--  
 
   --><!-- set the inheritance hierarchy
 
   --><!-- set the inheritance hierarchy
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Ancestor items::<q>[[Child Topic::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Ancestor items::<q>[[Child Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!--  
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set: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 Topic::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
+
   -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Ancestor items::<q>[[Child Class::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayunique:varSubsumeArray}}<!--
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!--  
 
   -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!--  

Revision as of 19:50, 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:

  • Subsumed 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.
  • Ancestor items - A list that includes the page's superclasses, the superclasses of superclasses etc., but not 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.