Template:senseid


This template generates link targets for senses. Whenever a page of Wiktionary has multiple senses for each language you can give the sense you want to link to an ID. You can then link to this specific id using a variety of linking templates, with the |id= parameter of those templates.

Recommended: You can also use this template via the graphical editor by User:Yair_rand, which you can find under preferences -> Gadgets -> Enable definition editing options.

This template uses Module:senseid and Module:senseid/templates as a back-end.

Parameters

|1=
The language code (see Wiktionary:Languages) of the current language section.
|2=
The ID that you want to assign to the current sense. This can be anything, and can include spaces. However, you should probably keep it short and concise, as it will have to be typed verbatim by anyone who wants to create a link to this sense. Also make sure to choose something that will not need to be changed in the future, because if the ID is changed later, all links that point to it will break.
When using the template in an English entry, the translation table corresponding to this sense should be given an |id= argument with the same ID as this sense.
Wikidata item ID's can be used as sense ID's; see below for more information.

Examples

For example you want to add a sense ID to the English word "house" in the sense of a "house music", you can {{senseid}} to the sense:

# {{senseid|en|genre of music}} [[house music|House music]].

resulting in

  1. House music.

Now, when you want to link to this sense from within Wiktionary, you can use the |id= parameter on, for example, {{l}} or {{m}}:

{{m|en|house|id=genre of music}}

The URL to the link will look like this:

https://en.wiktionary.org/wiki/house#English-genre_of_music

The result is:

house

Since this is an English entry, the translation table should be tagged with a matching ID.

Using Wikidata item IDs

Wikidata is a repository for structured data about just about anything. In some cases, a sense on Wiktionary will refer to something that Wikidata has an item on. In that case, it is possible to use the Wikidata ID (Q followed by numbers) as the senseid. For example, for the music style demonstrated above, one could use {{senseid|en|Q20502}}, with Q20502 being the ID of the Wikidata item for house music. This not only establishes a conceptual link between the Wiktionary sense and Wikidata item, but also establishes that all senses with that senseid anywhere on Wiktionary with that senseid are synonyms. In the future, the {{senseid}} template may be extended to query Wikidata itself as well.

Keep in mind that Wikidata ids should only be used when the sense matches exactly. This will mean that a Wikidata ID should only be used on nouns, as Wikidata items are generally "things" or "concepts" which are noun-like in nature. It is unclear how such ID's should be interpreted for other parts of speech, for example the adjective green with the Wikidata item Q3133 about this colour. Moreover, green is both a noun and an adjective, and senseids must be unique per language per page, so you can't use the same senseid Q3133 twice on the page, and it is not clear whether it belongs on the noun or the adjective sense.

Use with affixes

The templates {{affix}}, {{suffix}} and such use the |idN= parameter to disambiguate the categories for various homographical affixes. When the parameter is provided on these templates, then in addition to linking to the correct sense ID anchor, the derivations category name is also modified to include this ID. For example, {{affix|la|habeō|-tus|id2=action noun}} will link to the "action noun" sense id on the page -tus, but it will also place the entry in the category Category:Latin words suffixed with -tus (action noun) rather than the plain Category:Latin words suffixed with -tus.

Use in regular wikilinks

The format of the anchor generated by this template is LanguageName-id, such that {{senseid|en|leading or managerial position in certain organizations}} in the entry for secretary can be linked to using [[secretary#English-leading or managerial position in certain organizations|secretary]].

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

TemplateData for senseid

Anchors a sense ID tag on the entry for the term to aid entries referring to a specific sense of the word, phrase or morpheme.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Language code1

The language code of the current entry

Example
en
Stringrequired
Sense ID2

The ID that you want to assign to the current sense. This can be anything, and can include spaces. Make sure to choose something that will not need to be changed in the future, because if the ID is changed later, all links that point to it will break. See template page for more

Example
music genre
Linerequired
https://en.m.wiktionary.org/wiki/Template:senseid
en.m.wiktionary.org
crawl=CC-MAIN-2020-16
28198
application/http; msgtype=response
sha1:77IYQ7KYJJNNHOX5NJOEFPYRSAPSNGHM
<urn:uuid:1e02c3a7-bf5d-4882-9afd-bbb327f8bfac>
2020-03-30T02:12:54Z
208.80.154.224
text/html
sha1:DBETWT56JPWXG2X7FFJMO33I4QEML2S7
<urn:uuid:fd46cbcd-e11f-4548-a675-b79e53303593>
https://en.m.wiktionary.org/wiki/Template:senseid
response
<urn:uuid:381c5502-c1b4-432e-aff3-935677919a34>
isPartOf: CC-MAIN-2020-16
publisher: Common Crawl
description: Wide crawl of the web for March/April 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-202.ec2.internal
software: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/