Difference between revisions of "Template:SetTermInheritanceHierarchy"
Line 40: | Line 40: | ||
-->{{#arrayprint:varParentsArray||@@@@|{{#set:Parent Topic=@@@@}}|}}<!-- | -->{{#arrayprint:varParentsArray||@@@@|{{#set:Parent Topic=@@@@}}|}}<!-- | ||
--><!-- | --><!-- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
--><!-- set the children | --><!-- set the children | ||
-->{{#arraydefine:varChildrenArray<!-- | -->{{#arraydefine:varChildrenArray<!-- | ||
Line 66: | Line 55: | ||
-->{{#arrayunique:varChildrenArray}}<!-- | -->{{#arrayunique:varChildrenArray}}<!-- | ||
-->{{#arrayprint:varChildrenArray||@@@@|{{#set:Child Topic=@@@@}}|}}<!-- | -->{{#arrayprint:varChildrenArray||@@@@|{{#set:Child Topic=@@@@}}|}}<!-- | ||
+ | --><!-- | ||
+ | --><!-- set the inheritance hierarchy | ||
+ | -->{{#set:Subsumes items={{{term|}}}}}<!-- | ||
+ | -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Subsumes items::<q>[[Parent Topic::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!-- | ||
+ | -->{{#arrayunique:varSubsumeArray}}<!-- | ||
+ | -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!-- | ||
+ | --><!-- | ||
+ | --><!-- 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}}|,|}}<!-- | ||
+ | -->{{#arrayunique:varSubsumeArray}}<!-- | ||
+ | -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@|Descendant items=@@@@}}|}}<!-- | ||
--><!-- | --><!-- | ||
--><!-- set the inheritance hierarchy | --><!-- set the inheritance hierarchy | ||
Line 73: | Line 73: | ||
--><!-- | --><!-- | ||
--><!-- 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>[[ | + | -->{{#arraydefine:varSubsumeArray|{{#ask: [[-Ancestor items::<q>[[Child Topic::{{{term|}}}]]</q>]]|headers=hide|link=none}}|,|}}<!-- |
-->{{#arrayunique:varSubsumeArray}}<!-- | -->{{#arrayunique:varSubsumeArray}}<!-- | ||
-->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!-- | -->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Ancestor items=@@@@}}|}}<!-- |
Revision as of 18:58, 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 Topic
- The list of immediate parent terms (no grandparents).Child Topic
- 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={Supertypes, 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.