Help:Smwbp foundation templates

From Semantic Portal Wiki

Jump to: navigation, search

Overview

Help:Smwbp foundation templates is a package of wiki templates that wrap SMW syntax to support common practices in SWM annotation

  • it automatically hides rows with empty value in Infobox templates
  • it support multi-value statement, e.g. author=Li Ding, Jie Bao.

The help pages of this distribution are listed below:

Author Version Description
F.print.formfoot Li Ding 0.2 print foot note for a form
F.print.section Li Ding 0.2 Print the begin,end, row of a section in table format
F.print.vbar Li Ding 0.2 Print a vertical bar character. Typically used in the argument section of a template call.
F.show Li Ding 0.2 print a selected list of properties about a thing
F.smwbp Li Ding 0.2 Print navigation bar for wiki template pages
F.tag Li Ding 0.21 Add semantic tag (triple/triples) to a wiki page with display option
Smwbp foundation templates


Installation

prerequisite -- the following wiki extensions should be installed

install -- use either way

Tutorial

1. user can add SMW annotations as a bullet list using help:f.tag.

source code:

{{f.tag|test-property1|Test Page 1}}
{{f.tag|test-property2|Test Page 2}}

results: {{#vardefine:ns| }}{{#vardefine:p|test-property1 }}{{#vardefine:v|Test Page 1 }} {{#vardefine:ns| }}{{#vardefine:p|test-property2 }}{{#vardefine:v|Test Page 1 }}


2. user can smartly parse multi-value SMW annotations using help:f.tag. source code:

{{f.tag|test-property3|Test Person 1, Test Person 2}}
{{f.tag|test-property4|Test Person 1; Test Person 2}}
{{f.tag|test-property5|Test, Person 1; Test, Person 2}}

results: {{#vardefine:ns| }}{{#vardefine:p|test-property3 }}{{#vardefine:v|Test Person 1, Test Person 2 }} {{#vardefine:ns| }}{{#vardefine:p|test-property4 }}{{#vardefine:v|Test Person 1; Test Person 2 }} {{#vardefine:ns| }}{{#vardefine:p|test-property5 }}{{#vardefine:v|Test, Person 1; Test, Person 2 }}


3. user can quickly build an Infobox Template using help:f.tag, help:f.print.section

source code:

<!--
variable declaration: variables can be replaced by template parameters
-->{{#vardefine:value1|Test Page A}}<!--
-->{{#vardefine:value2|Test Person B,Test Person C}}<!--
-->{{#vardefine:value3|Test Image D}}<!--
-->{{#vardefine:value4|{{{1|}}}}}<!--

infobox -begin
-->{{f.print.section |mode=begin |width=20em |float=right}}<!--

infobox -section
-->{{f.print.section |text=Infobox - Software |background=#99F |format=tr}}<!--

infobox -section
-->{{f.print.section |text=Section 1 |format=tr}}<!--
-->{{f.tag|test title|{{PAGENAME}} |format=tr}}<!--

infobox -section
-->{{f.print.section |text=Section 2 |format=tr}}<!--
-->{{f.tag|test property6|{{#var:value1}}|format=tr}}<!--
-->{{f.tag|test property7|{{#var:value2}}|mode=list|format=tr}}<!--
-->{{f.tag|test property8|{{#var:value3}}|ns=Image|mode=list|format=tr}}<!--

 // this row does not show because {{{1|}}} is not assigned
-->{{f.tag|test property9|{{#var:value4}}|format=tr}}<!-- 

infobox -end
-->
{{f.print.section |mode=end }}<!--
-->

results: {{#vardefine:value1|Test Page A}}{{#vardefine:value2|Test Person B,Test Person C}}{{#vardefine:value3|Test Image D}}{{#vardefine:value4|}}

Infobox - Software
Section 1{{#vardefine:ns| }}{{#vardefine:p|test title }}{{#vardefine:v|Smwbp foundation templates }}
Section 2{{#vardefine:ns| }}{{#vardefine:p|test property6 }}{{#vardefine:v| }}{{#vardefine:ns| }}{{#vardefine:p|test property7 }}{{#vardefine:v| }}{{#vardefine:ns|Image: }}{{#vardefine:p|test property8 }}{{#vardefine:v| }}{{#vardefine:ns| }}{{#vardefine:p|test property9 }}{{#vardefine:v| }}

Personal tools
Semantic Web Community
Tetherless World constellation
maintenance