Template:SmwDictGlosses/doc: Difference between revisions

From Guild of Archivists
(Created page with "This template is designed to be used with SMW queries, specifically for queries done on the Dictionary namespace. It's passed to the "template" parameter of an #ask statement....")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This template is designed to be used with SMW queries, specifically for queries done on the Dictionary namespace. It's passed to the "template" parameter of an #ask statement.
This template is designed to be used with SMW queries, specifically for queries done on the Dictionary namespace. It's passed to the "template" parameter of an #ask statement and formats the returned subobjects as a part of 'dictionary' style line. Note that the actual word is not returned, or any properties of the page itself - this just aggregates the 'definition' subobjects.  


Example:
Example:
Line 8: Line 8:
|valuesep=^
|valuesep=^
|link=none
|link=none
|template=SmwDictLine
|template=SmwDictGlosses
|sep= 
|sep= 
}}
}}
</nowiki></code>
</nowiki></code>
Result:
: ''interj'' 1. hello 2. goodbye ''n'' peace
A query such as the above is intended to be used inside another template that provides the full dictionary line


====Assumptions====
====Assumptions====
Line 17: Line 21:
* that the query is pretty much identical to the one above in terms of options (the lines beginning with {{!}}). That is, the only property being returned is ''Gloss'', the values in a property are separated by carats (^), and no link data is being sent through.
* that the query is pretty much identical to the one above in terms of options (the lines beginning with {{!}}). That is, the only property being returned is ''Gloss'', the values in a property are separated by carats (^), and no link data is being sent through.
* that the dictionary page has its subobjects arranged properly. That is, is using the appropriate part-of-speech templates and that each definition is defined with the {{tl|df}} template.
* that the dictionary page has its subobjects arranged properly. That is, is using the appropriate part-of-speech templates and that each definition is defined with the {{tl|df}} template.
Using this template in other situations will have unexpected results.

Latest revision as of 19:19, 18 September 2020

This template is designed to be used with SMW queries, specifically for queries done on the Dictionary namespace. It's passed to the "template" parameter of an #ask statement and formats the returned subobjects as a part of 'dictionary' style line. Note that the actual word is not returned, or any properties of the page itself - this just aggregates the 'definition' subobjects.

Example:

{{#ask:
[[-Has subobject::Dictionary:shorah]]
| ?Gloss
|format=plainlist
|valuesep=^
|link=none
|template=SmwDictGlosses
|sep= 
}}

Result:

interj 1. hello 2. goodbye n peace

A query such as the above is intended to be used inside another template that provides the full dictionary line

Assumptions[edit]

The template assumes:

  • that the query is pretty much identical to the one above in terms of options (the lines beginning with |). That is, the only property being returned is Gloss, the values in a property are separated by carats (^), and no link data is being sent through.
  • that the dictionary page has its subobjects arranged properly. That is, is using the appropriate part-of-speech templates and that each definition is defined with the {{df}} template.