Module:LanguageVarietyQuery/doc

From The Seven Sages of Rome

This is the documentation page for Module:LanguageVarietyQuery

This module retrieves language variety pages related to a given language from Semantic MediaWiki.

Usage

The module can be invoked using #invoke in a template or wiki page.

Parameters

The first unnamed parameter specifies the language name for which varieties should be retrieved.

Behavior

Queries Semantic MediaWiki for all pages categorized under Category:Language that are marked as a variety of the specified language.

If no varieties are found, it returns "No language varieties found."

Constructs a query to find entities associated with the retrieved language varieties.

Returns the query results in JSON format.

Example Output

If LanguageName = Latin and the wiki has the following varieties:

Has Variety Of = Classical Latin

Has Variety Of = Vulgar Latin

The module will return a JSON-encoded result containing entities related to Classical Latin and Vulgar Latin.

Notes

The module relies on Semantic MediaWiki (mw.smw.ask).

If no varieties exist for the given language, it returns an appropriate message.

The output is encoded in JSON for structured data handling.