Difference between revisions of "Template:SMWData"

From Wikispooks
Jump to navigation Jump to search
(Clarify)
(key sort, key order)
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>[[category:Semantic Templates]]
 
<noinclude>[[category:Semantic Templates]]
'''This template is for adding Metadata where no template is in use. It should ''not'' be used when a template is already in use that adds metadata.<br/>
+
'''This template is for adding SMW data where no main template is in use. It should be used at the ''top'' of the page. It should ''not'' be used when a template is already in use that adds SMW data.<br/>
 
(So, not for {{temp|website}}s, {{temp|document}}s, {{temp|event}}s, files or {{temp|person}}s)'''<br/>
 
(So, not for {{temp|website}}s, {{temp|document}}s, {{temp|event}}s, files or {{temp|person}}s)'''<br/>
''It doesn't produce any visual output'' - it only adds semantic data to the document. As such, it can be placed anywhere in the document, however it is good practice to use it at the top.
+
{{Explain parameters}}
{{BLUE|The blue parameter not be marked up at all; they should be Wikispooks page names (whether or not the page yet exists).}}<br/>
 
 
'''Usage:'''
 
'''Usage:'''
 
<poem>
 
<poem>
 
{{{{t|SMWData}}
 
{{{{t|SMWData}}
 
''OPTIONAL DETAILS:''
 
''OPTIONAL DETAILS:''
|{{t|{{BLUE|Constitutes}}}}=a pagename which this subject consitutues (e.g. "censorship", "lone nut") ([[Property:Constitutes]])
+
|{{t|{{GREEN|constitutes}}}}=pagename(s) which this subject constitutes (e.g. "genocide, war crime") ([[Property:Constitutes]])
|{{t|{{BLUE|Constitutes2}}}}...=
+
|{{t|{{GREEN|perpetrators}}}}=pagename(s) of the peopel or groups responsible according to the official narrative ([[Property:ON_has_perpetrator]])
|{{t|Description}}=Document description
+
|{{t|{{GREEN|ON_constitutes}}}}=pagename(s) which this subject constitutes according to the official narrative ([[Property:ON_constitutes]])
|{{t|{{BLUE|Subject}}}}=The subject of the document
+
|{{t|{{GREEN|ON_perpetrators}}}}=pagename(s) of the peopel or groups responsible according to the official narrative ([[Property:ON_has_cause]])
|{{t|{{BLUE|Subject2}}}}, {{t|{{BLUE|Subject3}}}}... =Extra subjects<!-- UNUSED AS YET
+
|{{t|description}}=Document description
|{{t|SubjectDetail}}... = Explaining the relevant
+
|{{t|wikipedia}}=Wikipedia URL
|{{t|Subject2Detail}} |{{t|Subject3Detail}}... -->
+
|{{t|{{GREEN|subjects}}}}=The subject(s) of the document
 +
|{{t|{{VIOLET|key_properties}}}}= Slash separated list of important properties of this page ''([[Property:Has keyProperties]])''
 +
|{{t|{{VIOLET|key_property_headers}}}}= Slash separated list of property descriptions (same length as the above) ''([[Property:Has keyPropertyHeaders]])''
 +
|{{t|key_sort}}=Name of the key to sort on
 +
|{{t|key_order}}={ascending,descending}
 
}}
 
}}
 
</poem>
 
</poem>
</noinclude><includeonly>{{#if: {{{Description|}}} | [[Description::{{{Description}}}| ]]}}{{#if: {{{Constitutes|}}}    | [[Constitutes::{{{Constitutes}}}| ]]}}{{#if: {{{Constitutes2|}}}     | [[Constitutes::{{{Constitutes2}}}| ]]}}{{#if: {{{Constitutes3|}}}     | [[Constitutes::{{{Constitutes3}}}| ]]}}{{#if: {{{Constitutes4|}}}     | [[Constitutes::{{{Constitutes4}}}| ]]}}{{#if: {{{Constitutes5|}}}     | [[Constitutes::{{{Constitutes5}}}| ]]}}{{#if: {{{Subject|}}}     | [[Is about::{{{Subject}}}| ]]}}{{#if: {{{Subject2|}}}    | [[Is about::{{{Subject2}}}| ]]}}{{#if: {{{Subject3|}}}    | [[Is about::{{{Subject3}}}| ]]}}{{#if: {{{Subject4|}}}  | [[Is about::{{Subject4}}}| ]]}}{{#if: {{{Subject5|}}}    | [[Is about::{{{Subject5}}}| ]]}}{{#if: {{{Subject6|}}}     | [[Is about::{{{Subject6}}}| ]]}}{{#if: {{{Subject7|}}}     | [[Is about::{{{Subject7}}}| ]]}}{{#if: {{{Subject8|}}}     | [[Is about::{{{Subject8}}}| ]]}}{{#if: {{{Subject9|}}}     | [[Is about::{{{Subject9}}}| ]]}}{{#if: {{{Subject10|}}}    | [[Is about::{{{Subject10}}}| ]]}}</includeonly>
+
</noinclude><includeonly>{{Description|{{{Description|}}}}}{{#if: {{{key_properties|}}}|[[Has keyProperties::{{{key_properties}}}| ]]}}{{#if: {{{key_sort|}}}|[[Has keySort::{{{key_sort}}}| ]]}}{{#if: {{{key_order|}}}|[[Has keyOrder::{{{key_order}}}| ]]}}{{#if: {{{Wikipedia|}}}|[[Has wikipediaPage::{{{Wikipedia}}}| ]]}}{{#if: {{{key_property_headers|}}}|[[Has keyPropertyHeaders::{{{key_property_headers}}}| ]]}}{{ONPropertyPair|constitutes|{{{constitutes|}}}|{{{ON_constitutes|}}}}}{{ONPropertyPair|has perpetrator|{{{perpetrators|}}}|{{{ON_perpetrators|}}}}}{{ArrayMapProperty|{{{subjects|}}}|Is about}}
 +
{{SMWDefaultMarkup}}</includeonly>

Latest revision as of 14:47, 17 September 2014

This template is for adding SMW data where no main template is in use. It should be used at the top of the page. It should not be used when a template is already in use that adds SMW data.
(So, not for {{website}}s, {{document}}s, {{event}}s, files or {{person}}s)

Blue parameters are for a single Wikispooks page name (If no suitable page exists, then pick a title for a future page)
Brown parameters are for numbers
Green parameters are for comma-separated lists of page names (Or planned page names).
Navy parameters are for dates
Orange parameters are for booleans. (Usually, either "Yes" or just leave blank).
Purple parameters are URLs.
Violet parameters are slash-separated lists.
Pink parameters are for coordinates.
Crossed out parameters were formerly available, but have been upgraded. Some may still work, but do not use these.

Usage:

{{SMWData
OPTIONAL DETAILS:
|constitutes=pagename(s) which this subject constitutes (e.g. "genocide, war crime") (Property:Constitutes)
|perpetrators=pagename(s) of the peopel or groups responsible according to the official narrative (Property:ON_has_perpetrator)
|ON_constitutes=pagename(s) which this subject constitutes according to the official narrative (Property:ON_constitutes)
|ON_perpetrators=pagename(s) of the peopel or groups responsible according to the official narrative (Property:ON_has_cause)
|description=Document description
|wikipedia=Wikipedia URL
|subjects=The subject(s) of the document
|key_properties= Slash separated list of important properties of this page (Property:Has keyProperties)
|key_property_headers= Slash separated list of property descriptions (same length as the above) (Property:Has keyPropertyHeaders)
|key_sort=Name of the key to sort on
|key_order={ascending,descending}
}}