Difference between revisions of "Template:SMWDefaultMarkup"

From Wikispooks
Jump to navigation Jump to search
(Has bfmeetingCount)
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>[[category:Semantic Templates]]'''This template adds SMWData to the page, based on the existing data.''' It has no parameters. It is currently simple, and should probably remain that way, because it affects so many pages and has the potential to tie up the SMW jobs queue.
+
<noinclude>[[category:Semantic Templates]]'''This template adds SMWData to the page, based on the existing data.''' It has no parameters. It is currently fairly simple,  
 +
and should probably remain that way, because it affects so many pages and has the potential to tie up the SMW jobs queue. It is called at the top of [[Template:SMWDocs]], so applies to any page which contains <nowiki>{{SMWDocs}}</nowiki>.
 
<hr/>
 
<hr/>
 
The following properties are set:
 
The following properties are set:
Line 10: Line 11:
 
* [[Property:Has noRatings]]
 
* [[Property:Has noRatings]]
 
* [[Property:Is not stub]] (Iff [[Property:Is stub]] is not set)
 
* [[Property:Is not stub]] (Iff [[Property:Is stub]] is not set)
 +
* [[Property:Has nationality]] (Set to 'unknown' if [[Property:Has nationality]] is not set)
 
<!--
 
<!--
 
* [[Property:Has pageName]]  
 
* [[Property:Has pageName]]  
Line 15: Line 17:
 
-->
 
-->
 
* [[Property:Display docType]]
 
* [[Property:Display docType]]
 +
* [[Property:Display born on]]
 +
* [[Property:Display died on]]
 
* [[Property:Display date]]
 
* [[Property:Display date]]
 
* [[Property:Display image]]
 
* [[Property:Display image]]
Line 20: Line 24:
 
* [[Property:Display lifespan]]
 
* [[Property:Display lifespan]]
 
* [[Property:ON display date]]
 
* [[Property:ON display date]]
 +
* [[Property:Has bilderbergCount]]
 +
* [[Property:Has bfmeetingCount]]
 +
* [[Property:Has cercleCount]]
 +
* [[Property:Has mscmeetingCount]]
 +
* [[Property:Has wefmeetingCount]]
 
<hr/>
 
<hr/>
 
2016-04-18: Addition:
 
2016-04-18: Addition:
It also adds "<nowiki>__NOCACHE__</nowiki>" if the page was modified within the last 36 hours.</noinclude><includeonly>[[Has fullPageName::{{FULLPAGENAME}}| ]][[Has fullPageNamee::{{FULLPAGENAMEE}}| ]]{{#ifeq: {{ns:}}||[[Has parentFullPageName::{{#titleparts: {{FULLPAGENAME}} | -1 }}| ]]}}[[Has revisionSize::{{REVISIONSIZE}}| ]][[Has revisionUser::{{REVISIONUSER}}| ]]<!--
+
It also adds "<nowiki></nowiki>" if the page was modified within the last 36 hours.</noinclude><includeonly>[[Has fullPageName::{{FULLPAGENAME}}| ]][[Has fullPageNamee::{{FULLPAGENAMEE}}| ]]{{#ifeq: {{ns:}}||[[Has parentFullPageName::{{#titleparts: {{FULLPAGENAME}} | -1 }}| ]]}}[[Has revisionSize::{{REVISIONSIZE}}| ]][[Has revisionUser::{{REVISIONUSER}}| ]]<!--
  
 
Below two maybe handy, but currently unused:
 
Below two maybe handy, but currently unused:
 
[[Has pageName::{{PAGENAME}}| ]] [[Has rootFullPageName::{{#titleparts: {{FULLPAGENAME}} | 1 }}| ]]  
 
[[Has pageName::{{PAGENAME}}| ]] [[Has rootFullPageName::{{#titleparts: {{FULLPAGENAME}} | 1 }}| ]]  
  
SET DISPLAY PROPERTIES -->[[Display image::{{Display image|{{FULLPAGENAME}}}}| ]][[Display image2::{{Display image|{{FULLPAGENAME}}}}| ]]{{Display docType}}{{Display date}}{{ON display date}}{{Display lifespan}}<!--
+
SET useful SMW PROPERTIES -->
 +
{{#ifeq: {{#show: {{PAGENAME}} |?Has objectClass2}}|Person|[[Has bilderbergCount::{{#ask: [[Has fullPageName::~Bilderberg/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~Bilderberg/*]][[Has participant::{{PAGENAME}}]]|format=count}}| ]][[Has bfmeetingCount::{{#ask: [[Has fullPageName::~Brussels Forum/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~Brussels Forum/*]][[Has participant::{{PAGENAME}}]]|format=count}}| ]][[Has cercleCount:: {{#ifeq: {{#ask: [[Has fullPageName::~Le Cercle/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~Le Cercle/*]][[Has participant::{{PAGENAME}}]]|format=count}}|0|{{#ask: [[{{PAGENAME}}]][[-Has member::Le Cercle]]|format=count}}|{{#ask: [[Has fullPageName::~Le Cercle/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~Le Cercle/*]][[Has participant::{{PAGENAME}}]]|format=count}}}}| ]][[Has mscmeetingCount:: {{#ifeq: {{#ask: [[Has fullPageName::~Munich Security Conference/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~Munich Security Conference/*]][[Has participant::{{PAGENAME}}]]|format=count}}|0|{{#ask: [[{{PAGENAME}}]][[-Has member::Munich Security Conference]]|format=count}}|{{#ask: [[Has fullPageName::~Munich Security Conference/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~Munich Security Conference/*]][[Has participant::{{PAGENAME}}]]|format=count}}}}| ]][[Has wefmeetingCount:: {{#ifeq: {{#ask: [[Has fullPageName::~WEF/Annual Meeting/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~WEF/Annual Meeting/*]][[Has participant::{{PAGENAME}}]]|format=count}}|0|{{#ask: [[{{PAGENAME}}]][[-Has member::WEF/Annual Meeting]]|format=count}}|{{#ask: [[Has fullPageName::~WEF/Annual Meeting/*]][[Has witness::{{PAGENAME}}]] OR [[Has fullPageName::~WEF/Annual Meeting/*]][[Has participant::{{PAGENAME}}]]|format=count}}}}| ]]}}<!--
 +
 
 +
SET DISPLAY PROPERTIES --><!--
 +
 
 +
* 2019-06-19 Below suspended after an upgrade caused the below to manifest text.
 +
* 2019-06-29 Reinserted inside an invisible <span>
 +
--><span style="visibility:hidden">{{Display docType}}[[Display born on::{{LinkYear|{{#show: {{FULLPAGENAME}} | ?Born on}}}}| ]][[Display died on::{{LinkYear|{{#show: {{FULLPAGENAME}} | ?Died on}}}}| ]][[Display image::{{Display image|{{FULLPAGENAME}}}}| ]][[Display image2::{{Display image|{{FULLPAGENAME}}}}| ]]<!--{{Display date}}{{ON display date}}-->{{Display lifespan}}<!--
  
 
SET RATING PROPERTIES -->{{#ifeq: {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}|0||[[Has averageRating::{{#expr: {{#ask:[[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]| ?Has value| format=average}} round 1}}| ]]}}[[Has noRatings::{{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}| ]]<!--
 
SET RATING PROPERTIES -->{{#ifeq: {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}|0||[[Has averageRating::{{#expr: {{#ask:[[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]| ?Has value| format=average}} round 1}}| ]]}}[[Has noRatings::{{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}| ]]<!--
  
Set __NOCACHE__ if the page was modified within the last 36 hours (129600 seconds)
+
Set if the page was modified within the last 36 hours (129600 seconds)
-->{{#ifexpr: {{#expr: {{#time: U | now }} - {{#time: U | {{#show: {{FULLPAGENAME}} | ?Modification date}} }} }} < 129600 |__NOCACHE__}}<!--
+
-->{{#ifexpr: {{#expr: {{#time: U | now }} - {{#time: U | {{#show: {{FULLPAGENAME}} | ?Modification date}} }} }} < 129600 |}}<!--
 +
 
 +
SET PROPERTIES IF NEEDED.
 +
 
 +
Set Property:Is_not_stub unless Property:stub is set :
 +
-->{{#ifeq: {{#show: {{FULLPAGENAME}} | ?Is stub }} |true||[[Is not stub::true| ]]}}<!--
  
SET IS NOT STUB PROPERTY IF NEEDED.
+
-->{{#ifeq: {{#show: {{FULLPAGENAME}} | ?Has objectClass }}|Person|{{#ifeq: {{#show: {{FULLPAGENAME}} | ?Has nationality }} ||[[Has nationality::Unknown| ]]}}}}</span></includeonly>
Set Property:Is_not_stub unless Property:stub is set.
 
-->{{#ifeq: {{#show: {{FULLPAGENAME}} | ?Is stub }} |true|is stub|not stub[[Is not stub::true| ]]}}</includeonly>
 

Latest revision as of 16:23, 22 April 2024

This template adds SMWData to the page, based on the existing data. It has no parameters. It is currently fairly simple, and should probably remain that way, because it affects so many pages and has the potential to tie up the SMW jobs queue. It is called at the top of Template:SMWDocs, so applies to any page which contains {{SMWDocs}}.


The following properties are set:


2016-04-18: Addition: It also adds "" if the page was modified within the last 36 hours.