Difference between revisions of "Template:Property setting"

From TDWG Terms Wiki
Jump to: navigation, search
m (+Has improper value for)
m (+hints on has type: Text)
 
(15 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
set som variables
 
set som variables
 
   get label(s)
 
   get label(s)
-->{{#vardefine: label|{{Trim|{{#ask: [[{{PAGENAME}}]]|?terms-internal:enLabel=|mainlabel=-|format=list}} }} }}<!--  
+
-->{{#vardefine: label|{{#if: trim-space-by-if|{{#ask: [[{{PAGENAME}}]]|?terms-internal:enLabel=|mainlabel=-|format=list}} }} }}<!--  
 
   get scheme(s)
 
   get scheme(s)
-->{{#vardefine: schemes|{{Trim|{{#ask: [[{{PAGENAME}}]]|?skos:inScheme=|mainlabel=-|link=none|format=list}} }} }}<!--  
+
-->{{#vardefine: schemes|{{#if: trim-space-by-if|{{#ask: [[{{PAGENAME}}]]|?skos:inScheme=|mainlabel=-|link=none|format=list}} }} }}<!--  
 
   get subpropertie(s)
 
   get subpropertie(s)
-->{{#vardefine: subproperties |{{Trim|{{#ask: [[{{PAGENAME}}]] [[rdfs:subPropertyOf::+]]|?rdfs:subPropertyOf#=|mainlabel=-|format=list}} }} }}<!--  
+
-->{{#vardefine: subproperties |{{#if: trim-space-by-if|{{#ask: [[{{PAGENAME}}]] [[rdfs:subPropertyOf::+]]|?rdfs:subPropertyOf#=|mainlabel=-|format=list}} }} }}<!--  
 
   get imported namespace, e.g. "dc" om property page dc:creator
 
   get imported namespace, e.g. "dc" om property page dc:creator
-->{{#vardefine: importNameSpace|{{#if: {{#pos: {{{imported from|{{PAGENAME}}}}}|:}} | {{#explode: {{{imported from|{{PAGENAME}}}}}|:|0}} |<!-- else: save nothing-->}}}}<!--  
+
-->{{#vardefine: importNameSpace|{{#if: {{#pos: {{{imported from|{{PAGENAME}}}}}|:}} | {{#explode: {{{imported from|{{PAGENAME}}}}}|:|0}} |<!-- else: set nothing-->}}}}<!--  
-->{{#vardefine: hasSmwImportPage|{{#ifexist: MediaWiki:Smw import {{#var: importNameSpace}} | 1 |<!-- else: save nothing-->}}}}<!--  
+
-->{{#vardefine: hasSmwImportPage|{{#ifexist: MediaWiki:Smw import {{#var: importNameSpace}} | 1 |<!-- else: set nothing-->}}}}<!--  
  
 
   set some properties
 
   set some properties
Line 19: Line 19:
 
     Then the statement [[my-property::dc:creator]] can be something like [[my-property::{{Concept to imported URI|dc:creator}}]]. {{Concept to imported URI}} does #ask for the property page’s Equivalent URI then.
 
     Then the statement [[my-property::dc:creator]] can be something like [[my-property::{{Concept to imported URI|dc:creator}}]]. {{Concept to imported URI}} does #ask for the property page’s Equivalent URI then.
 
-->{{#if: {{#var: hasSmwImportPage}}<!--
 
-->{{#if: {{#var: hasSmwImportPage}}<!--
-->|{{#set: Imported from={{PAGENAMEE}}}}<!--
+
-->|{{#set: Imported from={{{imported from|{{PAGENAMEE}}}}}}}<!--
   -->{{#vardefine: importURI|{{Concept to imported URI|{{PAGENAMEE}} }} }}<!--
+
    overrides #var: importNameSpace
   -->{{#vardefine: importDocURI|{{Concept to imported docURI|{{PAGENAMEE}} }} }}<!--
+
   -->{{#vardefine: importURI|{{Concept to imported URI|{{{imported from|{{PAGENAMEE}}}}} }} }}<!--
 +
   -->{{#vardefine: importDocURI|{{Concept to imported docURI|{{{imported from|{{PAGENAMEE}}}}} }} }}<!--
 
   -->{{#set: Equivalent URI={{#var: importURI}} }}<!--
 
   -->{{#set: Equivalent URI={{#var: importURI}} }}<!--
 
-->}}<!--
 
-->}}<!--
 +
 +
  -->{{#set: Page has default form=Property setting}}<!-- override category/class defined forms
  
 
  Info table right
 
  Info table right
Line 66: Line 69:
 
* sortable and can be searched
 
* sortable and can be searched
 
* is always linked
 
* is always linked
 +
* is limited to 255 characters
 
See also [[Special:Types|types defined by Semantic MediaWiki]] and [[Special:Properties]] for all properties.<!--  -->}}
 
See also [[Special:Types|types defined by Semantic MediaWiki]] and [[Special:Properties]] for all properties.<!--  -->}}
  
Line 96: Line 100:
  
 
   | String = {{Hidden  
 
   | String = {{Hidden  
     | header = [[Has type::{{{has type|}}}]]  
+
     | header = [[Has type::{{{has type|}}}]] {{#info: message=Warning: type string is deprecated since SemanticMediaWiki 1.8+, change it to “text”.|warning}}[[Category:Internal - Check improper SMW values]]
 
     | toggle text = More… / Hide  
 
     | toggle text = More… / Hide  
 
     | content = Type “String”
 
     | content = Type “String”
 +
* IS DEPRECATED since SMW +1.8, type “text” will be used
 
* is sortable and can be searched
 
* is sortable and can be searched
 
* is limited to 255 characters
 
* is limited to 255 characters
Line 104: Line 109:
  
 
   | Text = {{Hidden | header = [[Has type::{{{has type|}}}]] | toggle text = More… / Hide | content = Type “Text”
 
   | Text = {{Hidden | header = [[Has type::{{{has type|}}}]] | toggle text = More… / Hide | content = Type “Text”
* is not sortable and can't be searched
+
* holds text of arbitrary length
* has unlimited text length
+
* can be Wiki code (except &lt;nowiki&gt; content)
 +
* can be searched partially: if text is &le;&nbsp;72 characters it's all searchable, if text is &gt;&nbsp;72 characters then only the first 40&nbsp;characters can be searched
 
* is better set with parser function #set than with {{#tag: nowiki |[[{{PAGENAME}}::long text possibly having […] text ]]}}
 
* is better set with parser function #set than with {{#tag: nowiki |[[{{PAGENAME}}::long text possibly having […] text ]]}}
 
See also [[Special:Types|types defined by Semantic MediaWiki]] and [[Special:Properties]] for all properties.<!--  -->}}
 
See also [[Special:Types|types defined by Semantic MediaWiki]] and [[Special:Properties]] for all properties.<!--  -->}}
Line 123: Line 129:
  
 
   | #default = {{Hidden | header = <!--
 
   | #default = {{Hidden | header = <!--
   -->{{#if: {{{has type|}}} | [[Has type::{{{has type|}}}]] | [[Has type::String]] (is assumed, as no “has type“ is set)}}<!-- end if
+
   -->{{#if: {{{has type|}}} | [[Has type::{{{has type|}}}]] | [[Has type::Text]] (is assumed, as no “has type“ is set)}}<!-- end if
 
-->| toggle text = More… / Hide | content = See also [[Special:Types|types defined by Semantic MediaWiki]] and [[Special:Properties]] for all properties.}}<!--
 
-->| toggle text = More… / Hide | content = See also [[Special:Types|types defined by Semantic MediaWiki]] and [[Special:Properties]] for all properties.}}<!--
 
-->}}<!-- switch end
 
-->}}<!-- switch end
Line 129: Line 135:
 
--></tr><!--  
 
--></tr><!--  
  
   subproperty of (do not delet it, because property setting may need it although it is set automatically from #ask)
+
   subproperty of (do not delete it, because property setting may need it although it is set automatically from #ask)
 
-->{{#if: {{{subproperty of|{{#var: subproperties}}}}}<!--
 
-->{{#if: {{{subproperty of|{{#var: subproperties}}}}}<!--
 
then-->|<tr><!--
 
then-->|<tr><!--
Line 147: Line 153:
 
     -->}}<!--
 
     -->}}<!--
 
     -->{{#if: {{#pos: {{#var: wikiPage}}|http}}<!--
 
     -->{{#if: {{#pos: {{#var: wikiPage}}|http}}<!--
     then-->|[[Subproperty of::§]]<!--
+
     then-->|[[rdfs:subPropertyOf::§]]<!--
 
     else-->|[[Subproperty of::Property:{{#var: wikiPage}}|{{#var: wikiPage}}]]<!--
 
     else-->|[[Subproperty of::Property:{{#var: wikiPage}}|{{#var: wikiPage}}]]<!--
 
     -->}}<!-- end if
 
     -->}}<!-- end if
Line 163: Line 169:
 
else-->|<!--
 
else-->|<!--
 
-->}}<!--
 
-->}}<!--
 
+
-->{{#ask: [[Covers property::{{PAGENAME}}]]|intro=<tr><th>[[File:Filter.svg|x14px|link=]]&nbsp;Filter&nbsp;for</th><td> |outro=<nowiki></nowiki> used on [[Special:BrowseData|Browse Data]]</td></tr>|default=}}<!--
 
--><tr><!--
 
--><tr><!--
 
   --><td colspan="2" style="border:0px none;background-color:white;"><div><span class="rdflink" style="float:right;">[[Special:ExportRDF/{{FULLPAGENAME}} |RDF feed]]</span></div></td><!--
 
   --><td colspan="2" style="border:0px none;background-color:white;"><div><span class="rdflink" style="float:right;">[[Special:ExportRDF/{{FULLPAGENAME}} |RDF feed]]</span></div></td><!--
Line 174: Line 180:
 
|#default= This page lists all occurrences of {{#if: {{#var: label}}|'''{{#var: label}}''' (= {{FULLPAGENAME}})|{{FULLPAGENAME}} }} in {{SITENAME}}.<!--
 
|#default= This page lists all occurrences of {{#if: {{#var: label}}|'''{{#var: label}}''' (= {{FULLPAGENAME}})|{{FULLPAGENAME}} }} in {{SITENAME}}.<!--
 
-->{{#ifexist: {{PAGENAME}}<!--
 
-->{{#ifexist: {{PAGENAME}}<!--
then-->|&#32;See also the concept page of [[{{PAGENAME}}]].<!--
+
then-->|&#32;See also the concept page of [[{{PAGENAME}}]] (possibly with detailed information).<!--
 
-->}}
 
-->}}
 
}}<!--
 
}}<!--
Line 196: Line 202:
 
-->}}  {{#info: A concept page is supposed to be in the article name space holding more detailed definitions, notes, relations etc. than the basic settings here on the property page.}}<!--  
 
-->}}  {{#info: A concept page is supposed to be in the article name space holding more detailed definitions, notes, relations etc. than the basic settings here on the property page.}}<!--  
 
  --></div><!--
 
  --></div><!--
-->{{#if: {{{imported from|}}}<!--
+
-->{{#if: {{#var: hasSmwImportPage}}<!--
 
then-->|<br/><br/><!--  
 
then-->|<br/><br/><!--  
   -->{{Generate concept formlinks from SMW import page | ns prefix={{#explode: {{{imported from|}}}|:|0}} }}<!--
+
   -->{{Generate concept formlinks from SMW import page | ns prefix={{#var: importNameSpace}} }}<!--
 
-->}}<!--  
 
-->}}<!--  
 
--><br/><br/><!--
 
--><br/><br/><!--
--><div class="display-inline">{{#forminput: form=Property setting|query string=namespace=Property|button text=Create or edit any property|size=30|autocomplete on namespace=Property|remote autocompletion}}</div><br/><!--
+
--><div class="display-inline">{{#forminput: form=Property setting|query string=namespace=Property|button text=Create or edit any property|size=30|autocomplete on namespace=Property|remote autocompletion|no autofocus}}</div><br/><!--
 
-->}}</div><!--  
 
-->}}</div><!--  
 
   let followed text not to be left-floated
 
   let followed text not to be left-floated
Line 207: Line 213:
 
}}
 
}}
  
{{#ask: [[Has improper value for::{{PAGENAME}}]]|format=ol|intro={{#info: message=Warning: improper values detected. See also [[property: Has improper value for]].|warning}} Improper values detected, please do check:|default=}}
+
{{#ask: [[Has improper value for::{{PAGENAME}}]]|format=ol|intro=<hr>{{#info: message=Warning: improper values detected. See also [[property: Has improper value for]].|warning}}[[Category:Internal - Check improper SMW values]] Improper values detected, please do check:|default=}}
 
{{DEFAULTSORT:{{PAGENAME}}}}
 
{{DEFAULTSORT:{{PAGENAME}}}}
 
{{#switch: {{{has type|}}}<!-- set default categories -->
 
{{#switch: {{{has type|}}}<!-- set default categories -->
Line 213: Line 219:
 
|#default=
 
|#default=
 
}}
 
}}
 +
{{#switch: {{LC:{{{show value ranks|}}}}}<!--
 +
-->|1|y|yes|true={{#ask: [[{{PAGENAME}}::+]]
 +
|?{{PAGENAME}}
 +
|format=valuerank
 +
|default=No values yet defined.
 +
|intro=<nowiki></nowiki>
 +
 +
The following values are defined:
 +
}}<!--
 +
-->}}<!-- end switch -->
 
</includeonly><noinclude>{{Documentation}}</noinclude>
 
</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 14:31, 3 February 2020

[edit] [purge] Template-info.svg Template documentation

Template “Property setting” is used to set just basic property settings (hopefully sometime automatically by SMW-#autoedit).

Usage

Parameter in bold are mandatory, all other are optional:

{{Property setting
|has type=         → mandatory (one of SMW Special:Types, "String" is assumend when no value is given)
|has fields=       → used when “has type” is “Record”   (; separated, e.g.: "property1; property2")
|display units=    → used when “has type” is “Quantities” (, separated, e.g.: "W, kW")
|corresponds to=   → used when “has type” is “Quantities” (; separated, e.g.: "1 W, Watt, Watts; 0.001 kW")
|imported from=    → optional, (uses imported page by MediaWiki:Smw_import_local-ns-prefix, details see Help SMW import vocabulary)
|annotations=      → optional free text
|show value ranks= → "yes" or "no"
}}

Uses:

Sets:

 


TODO

See talk page.

  • add parameter (to have multiple settings possible)?

Technical documentation

Shall the parameter be removed?
|imported from → it is set  automatically when a page "MediaWiki:Smw_import…" exists
Removed parameter in favour of #ask query
|heading=        → use automatically #ask with skos:inScheme
|label=          → use automatically #ask with skos:prefLabel
|categories=     → can be set manually if needed or TODO set them from #ask 
|subproperty of= → set automatically rdfs:subPropertyOf #asked from corresponding Concept page 

Dependencies: