Difference between revisions of "Template:Topic"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
 
(48 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
|Topic Type= {Descriptive, Normative}
 
|Topic Type= {Descriptive, Normative}
 
|Subfield= {Ontology, Dynamics, etc.}
 
|Subfield= {Ontology, Dynamics, etc.}
|Question Text Formula=
+
|Heritable= {Yes, No}
|Question Title Formula=
+
|Inherited From= //the question that this question is inherited from
|Question= //This will be deprecated. For now, if a formula is given, this one is ignored and constructed automatically from the formula.
+
|Question Text Formula= //For heritable questions only.
|Predicate Type= {Text, Term}
+
|Question Title Formula= //For heritable questions only.
|Predicate=
+
|Question Title= //Ignored for heritable questions.
 +
|Question= //For non heritable questions only. For heritable questions, this is available to the editors only to use in cases when the text produced by the formula should be overridden.  
 +
|Predicate= //Some text or a term registered in the encyclopedia
 
|Object Type= {Boolean, Class, Enumeration, Regular Expression, Text}
 
|Object Type= {Boolean, Class, Enumeration, Regular Expression, Text}
 
|Object Value True= //optional. Used only if Object Type=Boolean
 
|Object Value True= //optional. Used only if Object Type=Boolean
Line 22: Line 24:
 
|Multiple Answers Text Formula=
 
|Multiple Answers Text Formula=
 
|Answer Title Formula=
 
|Answer Title Formula=
|Order= //This will be deprecated. The question's order will be calculated from the Subject. If the subject is a term registered in the encyclopedia, then the question is first order. Otherwise, the question's order will be equal to subject's order + 1. 
 
|Lower Order Elements= //This will be deprecated. It will be calculated automatically from the subject, object, and predicate.
 
|Parent Topic= //This will be deprecated. It will be calculated automatically in an agent-relative way following the current inheritance hierarchy of that agent.
 
 
|Description=
 
|Description=
 
|Authors List=
 
|Authors List=
 
|Formulated Year=
 
|Formulated Year=
 
|Academic Events=
 
|Academic Events=
|Prehistory=
+
|Prehistory=  
 
|History=
 
|History=
 
|Current View=
 
|Current View=
|Related Topics=
+
|Parent Topic= //This will be deprecated. It will be calculated automatically in an agent-relative way following the current inheritance hierarchy of that agent. For now it is allowed as a backdoor so that it can be assigned manually.
 +
|Related Topics= //This will be deprecated. It will be calculated automatically in an agent-relative way following the current inheritance hierarchy of that agent.
 
|Page Status=
 
|Page Status=
 
|Editor Notes=
 
|Editor Notes=
 +
|Sorting Order=
 
}}
 
}}
 
</pre>
 
</pre>
Line 48: Line 49:
 
  -->Question Text Formula={{{Question Text Formula|}}}|<!--
 
  -->Question Text Formula={{{Question Text Formula|}}}|<!--
 
  -->Question Title Formula={{{Question Title Formula|}}}|<!--
 
  -->Question Title Formula={{{Question Title Formula|}}}|<!--
  -->Question={{{Question|}}}|<!-- //TODO: calculate this automatically
+
  -->Question Title={{PAGENAME}}|<!--
-->Predicate Type={{{Predicate Type|}}}|<!--
 
 
  -->Predicate={{{Predicate|}}}|<!--
 
  -->Predicate={{{Predicate|}}}|<!--
 
  -->Object Type={{{Object Type|Text}}}|<!--
 
  -->Object Type={{{Object Type|Text}}}|<!--
Line 60: Line 60:
 
  -->Multiple Answers Text Formula={{{Multiple Answers Text Formula|}}}|<!--
 
  -->Multiple Answers Text Formula={{{Multiple Answers Text Formula|}}}|<!--
 
  -->Answer Title Formula={{{Answer Title Formula|}}}|<!--
 
  -->Answer Title Formula={{{Answer Title Formula|}}}|<!--
-->Order={{{Order|1}}}|<!--
 
 
  -->Formulated Year={{{Formulated Year|}}}|<!--
 
  -->Formulated Year={{{Formulated Year|}}}|<!--
 
  -->Page Status={{{Page Status|Stub}}}|<!--
 
  -->Page Status={{{Page Status|Stub}}}|<!--
 
  -->Editor Notes={{{Editor Notes|}}}|<!--
 
  -->Editor Notes={{{Editor Notes|}}}|<!--
  -->Parent Topic={{{Parent Topic|}}}|<!--
+
-->Sorting Order={{{Sorting Order|10000}}}|<!-- default is 10000
 +
  -->Parent Topic={{{Parent Topic|}}}|<!-- this allows for a backdoor to assign parent topics manually
 
  -->Authors List={{{Authors List|}}}|<!--
 
  -->Authors List={{{Authors List|}}}|<!--
 
-->}}<!-- set
 
-->}}<!-- set
 +
--><!--
 +
--><!-- set the order
 +
-->{{#vardefine: varSubjectOrder|{{#show: {{{Subject|}}}|?Order|link=none}}|}}<!--
 +
-->{{#if: {{#var: varSubjectOrder}}<!--
 +
-->|{{#vardefine: varOrder| {{#expr: {{#var: varSubjectOrder}} + 1}} }}<!--
 +
-->|{{#vardefine: varOrder| 1 }}<!-- no subject. Set 1 by default
 +
-->}}<!-- if subject order is given
 +
-->{{#set:Order={{#var: varOrder}}|}}<!--
 +
--><!-- 
 +
--><!-- set the inherited from and heritable
 +
-->{{#if: {{{Inherited From|}}}<!--
 +
-->|<!-- an inherited question is not itself heritable
 +
  -->{{#set:Heritable=No|Inherited From={{{Inherited From|}}}|Inherited=Yes}}<!--
 +
-->|<!-- a non-inherited question can be heritable
 +
  -->{{#set:Heritable={{{Heritable|No}}}|Inherited=No}}<!--
 +
-->}}<!-- if
 +
--><!--
 +
--><!-- set the question text
 +
-->{{#if: {{{Question|}}}<!--
 +
-->|<!--
 +
  --><!-- the question is given
 +
  -->{{#vardefine: varQuestion|{{{Question|}}}}}<!--
 +
-->|<!--
 +
  --><!-- the question is not given: calculate it from the formula
 +
  -->{{#vardefine: varQuestion|{{DecodeTextFormula|formula={{{Question Text Formula|}}}|subject={{{Subject|}}}|predicate={{{Predicate|}}}|object={{{Object Class}}}|link=yes}}}}<!--
 +
-->}}<!-- if
 +
--><!--
 +
-->{{#set: Question={{#var: varQuestion}}}}<!--
 
--><!--
 
--><!--
 
--><!-- set the inheritance hierarchy
 
--><!-- set the inheritance hierarchy
Line 79: Line 107:
 
-->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@}}|}}<!--  
 
-->{{#arrayprint:varSubsumeArray||@@@@|{{#set:Subsumes items=@@@@}}|}}<!--  
 
--><!--
 
--><!--
--><!-- set the lower order elements (theories or questions) only if the order is greater than 1
+
--><!--
-->{{#ifeq: {{{Order|1}}} | 1 <!--
+
--><!-- set parent topic. Currently the parent topic and the ensuing hierarchy of Subsumed/Subsumes etc. is community agnostic.
-->|<!-- nothing to do if this is a first-order theory
+
--><!-- TODO: moving forward we need to come up with a more intricate way of storing this such that each community can have its own hierarchy.
-->|<!--
+
--><!--
-->{{#arraydefine:foelementsArray|{{{Lower Order Elements|}}}|,|}}<!--
+
-->{{#if: {{{Inherited From|}}}<!--
-->{{#arrayunique:foelementsArray}}<!--
+
-->|<!--
-->{{#arrayprint:foelementsArray||@@@@|{{#set:Has Lower Order Element=@@@@}}|}}<!--  
+
  --><!-- Get the properties required to format the title from Inherited From
--><!--  
+
  -->{{#vardefine: varTitleFormula| {{#show: {{{Inherited From|}}}|?Question Title Formula|link=none}} }}<!--
-->}}<!-- ifeq
+
  -->{{#vardefine: varPredicate| {{#show: {{{Inherited From|}}}|?Predicate|link=none}} }}<!--
 +
  -->{{#vardefine: varObject| {{#show: {{{Inherited From|}}}|?Object Class|link=none}} }}<!--
 +
  --><!--
 +
  --><!-- get the inherited topic's subject
 +
  -->{{#vardefine: varInheritedSubject| {{#show: {{{Inherited From|}}}|?Subject|link=none}} }}<!--
 +
  --><!--
 +
  --><!-- Get the list of all the classes that the Subject of the Inherited From subsumes
 +
  -->{{#arraydefine: arraySubsumesTerms|{{#ask: [[-Subsumes items::{{#var: varInheritedSubject}}]]|link=none}} | , |unique}}<!--
 +
  --><!--
 +
  --><!-- Get the list of all the parent classes of the Subject of the question
 +
  -->{{#arraydefine: arrayParentTerms|{{GetPropertyValues|object={{{Subject|}}}|property=Parent Class|link=none}} | , |unique}}<!--
 +
  --><!--
 +
  --><!-- Get the intersection of the two arrays
 +
  -->{{#arrayintersect: arrayIntersectTerms|arraySubsumesTerms|arrayParentTerms|}}<!--
 +
  --><!--
 +
  --><!-- For each item in the intersection array, format the question page title according to the formula taken from Inherited From
 +
  -->{{#arrayprint: arrayIntersectTerms||varTerm<!--
 +
  -->|<!--
 +
    -->{{#vardefine: varTitle| {{DecodeTitleFormula|formula={{#var: varTitleFormula}}|subject=varTerm|predicate={{#var: varPredicate}}|object={{#var: varObject}}|}} }}<!--
 +
    --><!--
 +
    -->{{#set: Parent Topic={{#var: varTitle}}|}}<!--
 +
    --><!--
 +
  -->}}<!-- arrayprint
 +
  --><!--
 +
  --><!-- also construct an array with links or red links to be displayed at the bottom
 +
  -->{{#arraydefine: arrayParentPageLinks<!--
 +
  -->|{{#arrayprint: arrayIntersectTerms||varTerm<!--
 +
    -->|<!--
 +
      -->{{#vardefine: varTitle| {{DecodeTitleFormula|formula={{#var: varTitleFormula}}|subject=varTerm|predicate={{#var: varPredicate}}|object={{#var: varObject}}|}} }}<!--
 +
      --><!--
 +
      --><!-- check if the page exists
 +
      -->{{#ifexist:{{#var: varTitle}}<!--
 +
      -->|<!-- exist: add the link to the page
 +
        -->[[{{#var: varTitle}}]]<!--
 +
      -->|<!-- doesn't exist: add the formlink
 +
        -->{{#formlink:form=Topic|link text={{#var: varTitle}}|target={{#var: varTitle}}|query string=Topic[Subject]=varTerm&Topic[Inherited From]={{{Inherited From|}}}|}}<!--
 +
      -->}}<!-- if exists
 +
      --><!--
 +
    -->}}<!-- arrayprint
 +
  -->| , |unique<!--
 +
  -->}}<!-- arraydefine
 +
  --><!--
 +
-->|<!-- not inherited: still construct an empty array for the use below
 +
  -->{{#arraydefine: arrayParentPageLinks}}<!--
 +
  --><!--
 +
-->}}<!-- if inherited from
 +
--><!--
 +
 
 
--><!--
 
--><!--
 
--><!-- set the authors
 
--><!-- set the authors
Line 98: Line 173:
 
-->{{#arrayunique:topicsArray}}<!--
 
-->{{#arrayunique:topicsArray}}<!--
 
-->{{#arrayprint:topicsArray||@@@@|{{#set:Has Related Topic=@@@@}}|}}<!--  
 
-->{{#arrayprint:topicsArray||@@@@|{{#set:Has Related Topic=@@@@}}|}}<!--  
--><!--
 
--><!-- set the related theories
 
-->{{#arraydefine:theoriesArray|{{{Related Theories|}}}|,|}}<!--
 
-->{{#arrayunique:theoriesArray}}<!--
 
-->{{#arrayprint:theoriesArray||@@@@|{{#set:Has Related Theory=@@@@}}|}}<!--
 
 
--><!--  
 
--><!--  
 
--><!-- set the academic events  
 
--><!-- set the academic events  
Line 115: Line 185:
 
--><!--  
 
--><!--  
 
--><!-- set Has Accepted Answer and Has No Accepted Answer  
 
--><!-- set Has Accepted Answer and Has No Accepted Answer  
-->{{SetTopicHasAcceptedAnswer|topic={{FULLPAGENAME}}|subfield=Dynamics}}<!--  
+
-->{{SetTopicCurrentAnswer|topic={{FULLPAGENAME}}|subfield={{{Subfield|Dynamics}}}|}}<!--  
 
--><!--  
 
--><!--  
 
--><!-- Calculate completion rates for each major property
 
--><!-- Calculate completion rates for each major property
Line 137: Line 207:
 
-->{{#set: CR_Total={{#var:varCRtotal}} }}<!--  
 
-->{{#set: CR_Total={{#var:varCRtotal}} }}<!--  
 
--><!--
 
--><!--
-->  
+
--><p>{{#var: varQuestion}}</p><!--  
{{{Question|}}}<!--  
+
 
 
-->{{PrintSectionVideos|page={{FULLPAGENAME}}|section=Description}}<!--
 
-->{{PrintSectionVideos|page={{FULLPAGENAME}}|section=Description}}<!--
-->{{#if: {{{Description|}}}|<nowiki/>
 
  
{{{Description|}}}  
+
-->{{#if: {{{Description|}}}|<p>{{{Description|}}}</p>}}<!--
}}
 
  
{{PrintTopicSubtitle|topic={{FULLPAGENAME}}|}}
+
--><p>{{PrintTopicSubtitle|topic={{FULLPAGENAME}}|}}&#32;<!--
{{PrintTopicCurrentlyAcceptedInCommunities|topic={{FULLPAGENAME}}|link=all|pretty=yes}}<!--
+
-->{{PrintTopicCurrentlyAcceptedInCommunities|topic={{FULLPAGENAME}}|link=all|pretty=yes}}<!--
-->{{PrintTopicAcceptedTheoriesList
+
-->{{PrintTopicAcceptedTheoriesFormulations<!--
  |topic={{FULLPAGENAME}}
+
  -->|topic={{FULLPAGENAME}}<!--
  |formulationtext=yes
+
  -->|link=yes<!--  
|formulationfile=no
+
-->}}</p><!--  
|bullets=no
+
|linebreak=no
 
|communitiesfirst=no
 
|groupbycommunity=yes
 
}}<!--  
 
-->{{PrintTopicHasNoAcceptedAnswer|topic={{FULLPAGENAME}}|intro=&#32;At the moment, the question has no accepted answer in&#32;|outro=<nowiki>.</nowiki>|link=all|pretty=yes}}<!--
 
 
-->{{#if:{{{Prehistory|}}}|<nowiki/>
 
-->{{#if:{{{Prehistory|}}}|<nowiki/>
 
==Broader History==
 
==Broader History==
Line 183: Line 246:
 
-->}}<!--
 
-->}}<!--
 
-->
 
-->
{{#switch: {{{Topic Type|}}}
+
If an answer to this question is missing, please {{#formlink:form=Theory|link text=click here to add it|query string=Theory[Topic]={{FULLPAGENAME}}|}}.
|Normative=If a theory on this normative question is missing, please {{#formlink:form=Normative Theory|link text=click here to add it|query string=Theory Type=Normative&Topic={{FULLPAGENAME}}|}}.
+
</div><!--
|Descriptive=If a theory on this descriptive question is missing, please {{#formlink:form=Descriptive Theory|link text=click here to add it|query string=Theory Type=Descriptive&Topic={{FULLPAGENAME}}|}}.  
+
--><!--
|Definitional=If a definition of this term is missing, please {{#formlink:form=Definition|link text=click here to add it|query string=Theory Type=Definition&Topic={{FULLPAGENAME}}|}}.
 
}}<!--
 
--></div><!--
 
 
-->
 
-->
 
===Accepted Theories===
 
===Accepted Theories===
Line 210: Line 270:
 
-->
 
-->
 
==Current View==
 
==Current View==
+
<!--
{{PrintTopicAcceptedTheoriesList
+
-->{{#if: {{{Current View|}}}|<p>{{{Current View|}}}<p>|}}<!--
  |topic={{FULLPAGENAME}}
+
--><!--
  |default=There is currently no accepted answer to this question.
+
--><!-- print the answers
  |formulationtext=yes
+
--><!--
|formulationfile=yes
+
--><p>{{PrintTopicAcceptedTheoriesList<!--
|description=yes
+
  -->|topic={{FULLPAGENAME}}<!--
|bullets=no
+
  -->|default=There is currently no accepted answer to this question.<!--
|linebreak=yes
+
  -->|communitiesfirst=yes<!--
  |communitiesfirst=yes
+
  -->|groupbycommunity=yes<!--
}}<!--  
+
-->}}</p>
-->{{#if: {{{Current View|}}}|<nowiki/><br/>
+
<!--
<nowiki/>
+
--><!--
{{{Current View|}}}|}}
+
--><!-- print the answer details: description etc.
 +
--><!--
 +
-->{{PrintTopicAcceptedTheoriesDetails|topic={{FULLPAGENAME}}|}}<!--
 +
-->
 
{{PrintTopicOpenQuestionsList
 
{{PrintTopicOpenQuestionsList
 
  |topic={{FULLPAGENAME}}
 
  |topic={{FULLPAGENAME}}
Line 232: Line 295:
 
}}
 
}}
 
==Related Topics==
 
==Related Topics==
{{#if:{{{Parent Topic|}}}|This topic is a sub-topic of [[{{{Parent Topic|}}}]].|}}
+
<!-- construct the manual array
 +
-->{{#if: {{{Parent Topic|}}}<!--
 +
-->|<!-- add to the array
 +
  -->{{#arraydefine: arrayManual|[[{{{Parent Topic|}}}]]|}}<!--
 +
-->|<!-- define an empty array
 +
  -->{{#arraydefine: arrayManual}}<!--
 +
-->}}<!--
 +
--><!--
 +
--><!-- create the union of the manual and calculated arrays of parent topics
 +
-->{{#arrayunion: arrayMerged|arrayManual|arrayParentPageLinks}}<!--
 +
--><!--
 +
-->{{#switch: {{#arraysize: arrayMerged}}<!-- 
 +
-->|0=<!-- nothing to do
 +
-->|<!-- print
 +
  -->This question is a subquestion of&#32;<!--
 +
  -->{{#arrayprint: arrayMerged||@@@@|@@@@|print=pretty}}<!--
 +
  -->.<!--
 +
-->}}<!--
 +
-->
 
{{PrintTopicSubtopics
 
{{PrintTopicSubtopics
 
  |topic={{FULLPAGENAME}}  
 
  |topic={{FULLPAGENAME}}  
Line 248: Line 329:
 
--><!--
 
--><!--
 
--><!--add categories  
 
--><!--add categories  
--><!--
 
-->{{#switch: {{{Order|1}}}<!--
 
--> |2=[[Category:Second Order Element]][[Category:Second Order Topic]]<!--
 
--> |#default=[[Category:First Order Element]][[Category:First Order Topic]]<!-- 
 
-->}}<!--
 
 
--><!--
 
--><!--
 
-->{{#switch: {{{Topic Type|}}}<!--
 
-->{{#switch: {{{Topic Type|}}}<!--
--> |Normative=[[Category:Normative Topic]]<!--
+
-->|Normative=[[Category:Normative Topic]]<!--
--> |Descriptive=[[Category:Descriptive Topic]]<!--
+
-->|Descriptive=[[Category:Descriptive Topic]]<!--
--> |Definitional=[[Category:Definitional Topic]]<!--
+
-->|Definitional=[[Category:Definitional Topic]]<!--
--> |{{Note}} Something went wrong and the topic type is undefined. If you see this message, please contact the editors with the details.<!--   
+
-->|{{Note}} Something went wrong and the topic type is undefined. If you see this message, please contact the editors with the details.<!--   
 
-->}}<!--
 
-->}}<!--
 
--><!--
 
--><!--
 
-->{{#switch: {{{Page Status|Stub}}}<!--
 
-->{{#switch: {{{Page Status|Stub}}}<!--
--> |Editor Approved=[[Category:Editor Approved Topic Pages]]<!--
+
-->|Editor Approved=[[Category:Editor Approved Topic Pages]]<!--
--> |Needs Editing=[[Category:Need Editing Topic Pages]]<!--
+
-->|Needs Editing=[[Category:Need Editing Topic Pages]]<!--
--> |Stub=[[Category:Stub Topic Pages]]<!--
+
-->|Stub=[[Category:Stub Topic Pages]]<!--
 
-->}}<!--
 
-->}}<!--
 
--><!--
 
--><!--

Latest revision as of 00:36, 28 February 2023

This is the template for all types of Non-Definitional Topics (Descriptive, Normative). This template is to be used for all topics/questions the answers to which are descriptions or prescriptions (it is used by Form:Topic).

It should be called in the following format:

{{Topic
|Subject= //For first order questions, the subject must be a term registered in the encyclopedia. For higher order questions, the subject can be any lower level non-definitional theory question or theory.
|Topic Type= {Descriptive, Normative}
|Subfield= {Ontology, Dynamics, etc.}
|Heritable= {Yes, No}
|Inherited From= //the question that this question is inherited from
|Question Text Formula= //For heritable questions only.
|Question Title Formula= //For heritable questions only.
|Question Title= //Ignored for heritable questions.
|Question= //For non heritable questions only. For heritable questions, this is available to the editors only to use in cases when the text produced by the formula should be overridden. 
|Predicate= //Some text or a term registered in the encyclopedia
|Object Type= {Boolean, Class, Enumeration, Regular Expression, Text}
|Object Value True= //optional. Used only if Object Type=Boolean
|Object Value False= //optional. Used only if Object Type=Boolean
|Object Class= //optional. Used only if Object Type=Class
|Object Enum Values= //optional. Used only if Object Type=Enumeration
|Object Regexp= //optional. Used only if Object Type=Regexp
|Single Answer Text Formula=
|Multiple Answers Text Formula=
|Answer Title Formula=
|Description=
|Authors List=
|Formulated Year=
|Academic Events=
|Prehistory= 
|History=
|Current View=
|Parent Topic= //This will be deprecated. It will be calculated automatically in an agent-relative way following the current inheritance hierarchy of that agent. For now it is allowed as a backdoor so that it can be assigned manually.
|Related Topics= //This will be deprecated. It will be calculated automatically in an agent-relative way following the current inheritance hierarchy of that agent.
|Page Status=
|Editor Notes=
|Sorting Order=
}}

Edit the page to see the template text.