Difference between revisions of "Semantic MediaWiki"
(→parser functions: #show) |
(/data, some updates) |
||
Line 4: | Line 4: | ||
[[Semantic MediaWiki]] (SMW) is an extension for [[platform::MediaWiki]] that provides [[purpose::semantic markup]] capability. | [[Semantic MediaWiki]] (SMW) is an extension for [[platform::MediaWiki]] that provides [[purpose::semantic markup]] capability. | ||
{{seed}} | {{seed}} | ||
+ | ===pages=== | ||
+ | As the SMW code API is not yet stable or well-documented, it appears that going directly to the database may be the best way to utilize SMW data. | ||
+ | * [[/data]]: tables | ||
+ | ===parser functions=== | ||
+ | SMW also uses a few standard-form parser functions: | ||
+ | * [[smw:Help:Inline queries|#ask]] | ||
+ | * #declare | ||
+ | * [[smw:Help:Adding tooltips|#info]] | ||
+ | * #set | ||
+ | * [[smw:Help:Recurring events|#set_recurring_event]] | ||
+ | * [[smw:Help:Inline queries#The_.23show_parser_function|#show]] | ||
===Notes=== | ===Notes=== | ||
− | * In #ask queries, the word "Category" is case-sensitive; <nowiki>[[category:...]]</nowiki> will not work. | + | * For MediaWiki deployments where initial characters in article titles are ''not'' automatically capitalized (the default is to capitalize them): |
− | * Special properties are also case-sensitive | + | ** In #ask queries, the word "Category" is case-sensitive; <nowiki>[[category:...]]</nowiki> will not work. |
+ | * Special properties are also case-sensitive: e.g. <nowiki>[[Has type:string]]</wiki> correctly references the special "Has type" property, but <nowiki>[[has type::string]]</nowiki> refers only to a non-special "has type" property. | ||
==Syntax== | ==Syntax== | ||
− | SMW introduces a new syntactical structure of the form ''<nowiki>[[property name::property value]]</nowiki>'', which may optionally be written with a display parameter: ''<nowiki>[[property name::property value|display text]]</nowiki>''. Both of these formats cause the current page to be assigned the value <u>property name</u> with the value <u>property value</u>. | + | SMW introduces a new syntactical structure of the form ''<nowiki>[[property name::property value]]</nowiki>'', which may optionally be written with a display parameter: ''<nowiki>[[property name::property value|display text]]</nowiki>''. Both of these formats cause the current page to be assigned the value <u>property name</u> with the value <u>property value</u>. The same value can be assigned to several properties with this syntax: ''<nowiki>[[property1 name::property2 name::value for both]]</nowiki>''. |
To set a property without displaying anything, there are two alternative forms: | To set a property without displaying anything, there are two alternative forms: | ||
Line 15: | Line 27: | ||
* ''<nowiki>{{#set:property name=property value}}</nowiki>'' | * ''<nowiki>{{#set:property name=property value}}</nowiki>'' | ||
** 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; the other form does not. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Links== | ==Links== | ||
* [[page::smw:Main Page|project home page]] | * [[page::smw:Main Page|project home page]] |
Revision as of 16:47, 22 January 2012
About
Semantic MediaWiki (SMW) is an extension for MediaWiki that provides semantic markup capability.
This page is a seed article. You can help HTYP water it: make a request to expand a given page and/or donate to help give us more writing-hours!
|
pages
As the SMW code API is not yet stable or well-documented, it appears that going directly to the database may be the best way to utilize SMW data.
- /data: tables
parser functions
SMW also uses a few standard-form parser functions:
- #ask
- #declare
- #info
- #set
- #set_recurring_event
- #show
Notes
- 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.
- Special properties are also case-sensitive: e.g. [[Has type:string]]</wiki> correctly references the special "Has type" property, but <nowiki>[[has type::string]] refers only to a non-special "has type" property.
Syntax
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; the other form does not.