Difference between revisions of "Semantic MediaWiki/markup"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
** In this form, the space between the "|" and "]]" is required)
 
** In this form, the space between the "|" and "]]" is required)
 
* <code><nowiki>{{#set:property name=property value}}</nowiki></code>
 
* <code><nowiki>{{#set:property name=property value}}</nowiki></code>
** This form allows brackets ("[" and "]") to be used in the property value; the other form does not.
+
** This form allows brackets ("[" and "]") to be used in the property value by default; the other form can only allow it in Text data if <code>[[smw:Help:$smwgParserFeatures|$smwgParserFeatures]]</code> has the <code>SMW_PARSER_LINV</code> attribute set.
 +
** This form may not work within parser tag extensions (e.g. [[W3TPL]]'s {{xmltag|hide}} tag).
  
 
==parser functions==
 
==parser functions==
SMW also uses a few standard-form parser functions:
+
SMW also uses a few standard-form [[smw:Help:Parser_functions|parser functions]]:
 
* #{{l/sub|ask}}  
 
* #{{l/sub|ask}}  
 
* #declare
 
* #declare
Line 16: Line 17:
 
* #{{l/sub|set_recurring_event}}
 
* #{{l/sub|set_recurring_event}}
 
* #{{l/sub|show}}
 
* #{{l/sub|show}}
 +
 +
See [[smw:Help:Displaying_information#Display_format|Displaying_information#Display_format]] for at least some information about formatting values.
 +
 +
==formats==
 +
* [[smw:Help:Result_formats|result formats]]: output of an #ask or #show
 +
* [[smw:Displaying_information|field formats]]: formatting an individual field in a result
 +
* [[smw:Help:List_of_datatypes|property types]]: list of native property types
 +
 
==notes==
 
==notes==
 
===case-sensitivity===
 
===case-sensitivity===
 
* For MediaWiki deployments where initial characters in article titles are ''not'' automatically capitalized (the default is to capitalize them):
 
* For MediaWiki deployments where initial characters in article titles are ''not'' automatically capitalized (the default is to capitalize them):
 
** In #ask queries, the word "Category" is case-sensitive; <code><nowiki>[[category:...]]</nowiki></code> will not work.
 
** In #ask queries, the word "Category" is case-sensitive; <code><nowiki>[[category:...]]</nowiki></code> will not work.
 +
* Where initial characters ''are'' automatically capitalized, all property-names will be capitalized, even if they are specified as lower-case.
 +
** Example: If a page contains <code><nowiki>[[test thing::sample value]]</nowiki></code>, any queries which make use of "test thing" must refer to it as "Test thing" or the value will not be found.
 
* Special properties are also case-sensitive: e.g. <code><nowiki>[[Has type:string]]</nowiki></code> correctly references the special "Has type" property, but <code><nowiki>[[has type::string]]</nowiki></code> refers only to a non-special "has type" property.
 
* Special properties are also case-sensitive: e.g. <code><nowiki>[[Has type:string]]</nowiki></code> correctly references the special "Has type" property, but <code><nowiki>[[has type::string]]</nowiki></code> refers only to a non-special "has type" property.

Latest revision as of 17:58, 5 November 2020

property embedding

SMW introduces a new syntactical structure of the form [[property name::property value]], which may optionally be written with a display parameter: [[property name::property value|display text]]. Both of these formats cause the current page to be assigned the value <property name> with the value <property value>. The same value can be assigned to several properties with this syntax: [[property1 name::property2 name::value for both]].

To set a property without displaying anything, there are two alternative forms:

  • [[property name::property value| ]]
    • In this form, the space between the "|" and "]]" is required)
  • {{#set:property name=property value}}
    • This form allows brackets ("[" and "]") to be used in the property value by default; the other form can only allow it in Text data if $smwgParserFeatures has the SMW_PARSER_LINV attribute set.
    • This form may not work within parser tag extensions (e.g. W3TPL's <hide> tag).

parser functions

SMW also uses a few standard-form parser functions:

See Displaying_information#Display_format for at least some information about formatting values.

formats

notes

case-sensitivity

  • For MediaWiki deployments where initial characters in article titles are not automatically capitalized (the default is to capitalize them):
    • In #ask queries, the word "Category" is case-sensitive; [[category:...]] will not work.
  • Where initial characters are automatically capitalized, all property-names will be capitalized, even if they are specified as lower-case.
    • Example: If a page contains [[test thing::sample value]], any queries which make use of "test thing" must refer to it as "Test thing" or the value will not be found.
  • Special properties are also case-sensitive: e.g. [[Has type:string]] correctly references the special "Has type" property, but [[has type::string]] refers only to a non-special "has type" property.