Wikifunctions:Abstract Wikipedia/2025 fragment experiments
This page is a WikiProject for creating the basic natural language building blocks for Abstract Wikipedia articles.
Background
What is a semantic fragment?
We're using the term "semantic fragment" to refer to the concept of a piece of prose text that makes a particular claim about the world. We're seeing these as the building blocks for Abstract Wikipedia articles, and expect that each such article will be generated from several or dozens of such fragments. They may be whole sentences, but also parts of bigger structures.
A very basic such fragment is the class statement:
"<X> is a <Y>."
This can be used for many different statements. Here are some examples of that statement in English:
"Berlin is a city."
"Berlin Brandenburg Airport is an airport."
"Anser anser anser is a species."
What is a semantic fragment Function?
A semantic fragment Function is a Wikifunctions Function that takes some Wikidata references and a language, and outputs some text in that language matching a given semantic fragment.
For example fragment given above, we created Z26039/Article-less instantiating fragment, which can be used to generate each of the above statements in English by changing the first and second inputs:
| Input | Result |
|---|---|
{{#function:Z26039|Q64|Q515|Z1002}} |
⏳ Function is being called… |
{{#function:Z26039|Q160556|Q1248784|Z1002}} |
⏳ Function is being called… |
{{#function:Z26039|Q27601002|Q7432|Z1002}} |
⏳ Function is being called… |
By changing the third input, we can instead change the language in which we get the fragment (if available):
| Input | Result |
|---|---|
{{#function:Z26039|Q64|Q515|Z1003}} |
⏳ Function is being called… |
{{#function:Z26039|Q160556|Q1248784|Z1004}} |
⏳ Function is being called… |
{{#function:Z26039|Q27601002|Q7432|Z1001}} |
⏳ Function is being called… |
In this WikiProject, we're trying to create many such fragment Functions, and importantly, make them available in as many languages as possible.
Completed examples
To do We'll list complete example semantic fragment Functions in the catalogue under Global language functions.
Here is a list of examples that are "complete", in that they have at least two languages hooked up to them. We'll never complete all 6000 human languages, but we've listed the "UN 6" as a quick working list. In future, we'll make it easier to see what is and is not yet available in any given language.
| Models | English examples | Function | EN | AR | ES | FR | RU | ZHs | ZHt |
|---|---|---|---|---|---|---|---|---|---|
| "<X> is a <Y>." | "Berlin is a city." | Z26039 | ✅ | ✅ | ✅ | ✅ | 🚧 | ✅ | ❌ |
| "<X>s are <Y>s." | “Antelopes are mammals.”
"Squares are rectangles." |
Z26627 | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
| "An <X> is a <Y>." | “An antelope is a mammal.”
"A frog is an amphibian." |
Z26095 | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
How to get involved
Propose a new kind of fragment
To do
Add a test case for a fragment in your language
To do
Add an implementation for a fragment in your language
To do
Create a fragment Function
To do
Guidance
- All top-level ("Outer") Functions should take only Wikidata items / lexemes as references, and a Language
- They should output a Monolingual string, to indicate exactly what language was used to generate
- e.g. if the user asks for
de-at(Austrian German) but there's only ade(general German) response
- e.g. if the user asks for
- The outer Function should route requests using a Z14294/language configuration or similar
Fragments being developed
Starting in July 2025, the Abstract Wikipedia team has been co-creating some experimental Functions with the Wikifunctions community to try to generate fragments that demonstrate how we might use code to generate Wikipedia-like text in languages, using Wikidata's lexemes.
| Name | Models | English examples | 2+ Languages that are fully working | Outer Function | Selector Function | Status |
|---|---|---|---|---|---|---|
| Defining sub-class: class / adjective / class | “<X> is <Y> <Z>.”
Mass noun form |
“Ice is frozen water.” | Z27173 | Z27174 | ||
| Location: entity / class / location | “<X> is a <Y> in <Z>” | "Berlin is a city in Germany."
"San Francisco is a city in California." "The Sargasso Sea is a sea in the Atlantic Ocean." |
Z26570 | TBC | ||
| Defining, compound role for entity | "<X> is the <Y> of <Z>" | “Charles III is the son of Elizabeth II.”
"Sol is the star of the Solar System." “Berlin is the capital of Germany.” “Amsterdam is the capital of the Netherlands.” |
Z28016 | Z28020 | ||
| Superlative: entity / adjective / class / location | "<X> is the <Cest> <Y> in <Z>." | "Los Angeles is the biggest city in California."
"Canada is the largest country in North America." "The Amazon is the longest river in the world." “The Nile is the longest river in Africa.” "Io is the most volcanic planetary body in the Solar System." |
Z27243 | TBC | ||
| Ordinal: entity / ordinal / adjective / class / location | "<X> is the <N>th <C> <Y> in <Z>" | "San Francisco is the 4th largest city in California."
"Saturn is the 2nd largest planet in the Solar System." |
Z27627 | |||
| Time-specific property claim: entity / property | "The <X> of <Y> was <Z> in <year>." | "The population of North Epping was 4657 in 2021 AD." | Z28436 | Z28435 |
Fragments to consider starting
Here are some proposed semantic fragments, along with sub-types needed for some languages, and examples (generally in English) which can later become test cases.
If you can think of another fragment that you think is good to work on soon/now, please add it. This is especially valuable for fragment types you think are hard to do in your language, as it will give us the opportunity to learn.
- Definition: class / class
- "<X>s are a kind of <Y>." e.g. "Antelopes are a kind of mammal."
- "An <X> is a kind of <Y>." e.g. “An antelope is a kind of mammal.” or "A frog is a kind of amphibian."
- Specific subclass: class / class-type / class
- “<X>s are a <Y> of <Z>.” e.g. “Lions are a species of mammal.” or "Ships are a class of watercraft."
- Defining sub-class: class / adjective / class
- “<X> is a <Y> <Z>.” e.g. "A ram is a male sheep.” or “A woman is a female human.” or “A daughter is a female child.”
- Profession: person / nationality / profession / current?
- "<X> is/was a <Y> <Z>" e.g. "Marie Curie was a Polish scientist" or “Alan Turing was a British mathematician” or “Plato was an Athenian philosopher." or “Friedrich Merz is a German politician.”
- Generic role: thing / role / thing
- "<X> is a <Y> of <Z>" e.g. "California is a State of the United States of America.” or “Wales is a Part of the United Kingdom."“Bavaria is a State of Germany.”“Bo is a pet of Barack Obama.” or “Earth is a planet in the Solar System."
- Source: entity / class / source
- "<X> is a <Y> from <Z>." e.g. "Frodo is a character from the Lord of the Rings saga.” or “Raclette is a dish from Savoie."
- Defining, atomic role for entity
- "<X> is the <Y>." e.g. "Charles III is the Monarch of the United Kingdom.” or “Vladimir Putin is the President of the Russian Federation."
- Cardinal possessive: entity / cardinal / class
- "<X> has <C> <Y>s." e.g. "The United States has 50 states."
- Cardinal typical possessive: entity / cardinal / adjective / class
- "<X> has <C> <Y> <Z>s." e.g. "The Solar System has 2 gas giant planets."