Jump to content

Abstract Wikipedia:Useful functions for article composition

From Abstract Wikipedia

These functions are considered useful for composing abstract articles, in that they have typical use cases in composing them and have broad support across languages. For more discussion and tracking of fragment functions, see f:Wikifunctions:Abstract Wikipedia/2025 fragment experiments. For a list of functions relating to natural language, see f:Wikifunctions:Catalogue/Natural language operations/Global language functions.

Subject is instance of

[edit]

Function subject is instance of (Z26039) creates a sentence along the lines of "X is a(n) [instance of] Y.".

The "entity" field (X in the formula above) should be the subject (typically, but not always, your abstract article's subject). The "class" field should be what the entity is being described as.

Example

[edit]
Entity: Q3870/Nairobi
Class: Q515/city
Language: English
Result: "Nairobi is a city"

Note that this function converts the subject's name's first letter to uppercase in some languages, which may not always be appropriate. If needed, you can use f:Z32953 to undo that behavior.

Subject is kind of

[edit]

f:Z26095 creates a sentence along the lines of "A(n) X is a(n) [kind of] Y." The "entity" field should be the subject (typically, but not always, your article's subject). The "class" field should be what it is being described as.

Example

[edit]
Entity: Q89/apple
Class: Q3314483/fruit
Language: English
Result: "An apple is a fruit"

Defining role sentence

[edit]

f:Z28016 creates a sentence along the lines of "X is the Y of Z." The "subject" field should be the subject (typically, but not always, your article's subject). The "role" field should be which role it serves to the dependency. The dependency should be what is related to the subject.

Example

[edit]
Subject: Q3870/Nairobi
Role: Q5119/Capital city
Dependency: Q114/Kenya
Language: English
Result: "Nairobi is the capital city of Kenya"

State location using entity and class

[edit]

f:Z26570 creates a sentence along the lines of "X is a Y in Z." The "entity" field should be the subject (typically, but not always, your article's subject). The "class" field should be what is being described as. The "location" field should say where it is located. It should only be used for physical locations.

Example

[edit]
Entity: Q3870/Nairobi
Class: Q515/city
Location: Q114/Kenya
Language: English
Result: "Nairobi is a city in Kenya"

Sentence-case section title from Wikidata label

[edit]

f:Z32145 makes a capitalised section title (level 2 heading), using the label of the chosen Wikidata item from the appropriate language or a fallback.

Example

[edit]
Entity: Q309/history
Language: English
Result: "<h2>History</h2>"

Plural sentence-case title from Wikidata label

[edit]

A plural version of f:Z32145 is f:Z32839.

Example

Entity: Q121769/reference
Language: English
Result: "<h2>References</h2>"

Join text-like objects into HTML fragments

[edit]

f:Z32234 combines certain text-like objects (currently strings, monolingual texts, and HTML fragments) into one big HTML fragment. It is useful for making multi-sentence paragraphs and avoiding the divide between the 3 types in linguistic functions.

Monolingual text as HTML fragment w/ auto-langcode

[edit]

f:Z29749 converts a monolingual text into an HTML fragment. If the target language is not matched, it prepends a language code. This helps to still display a fallback when the functions available to a language are incomplete.

Collective role sentence

[edit]

f:Z32326 creates a sentence along the lines of "Xs are Ys of Z." The "subject" field should be the subject (typically, but not always, your article's subject). The "role" field should be which role it serves to the dependency. The dependency should be what is related to the subject.

Example

[edit]
Subject: Q523/star
Role: Q31464082/source entity
Dependency: Q9128/light
Language: English
Result: "Stars are sources of light."

Simple present collective sentence

[edit]

f:Z32531 creates a sentence along the lines of "Xs verb Ys." The "subject" field should be the subject (typically, but not always, your article's subject). The "object" field should be the entity or concept that the subject is acting upon or relating to (i.e. what receives the action in the sentence). The "verb" field should describe the type of relationship or action between the subject and object, typically expressed as a base concept that can be converted into a natural verb.

Example

[edit]
Subject: Q523/star
Object: Q11426/metal
Verb: Q6014822/containment
Language: English
Result: "Stars contain metals."