Jump to content

Help:Property constraints portal/Value label

From Wikidata

complex constraint value label (Q100884525) specifies that the labels of items used as values for a property should conform to a certain pattern in a given language.

It can be suitable for properties with item-datatype that have a distinct value constraint. It is different from format constraint applicable to string-datatype properties.

For example, the English label of values for category for the interior of the item (P7561) would generally start with the string "Category:Interior of ". This can be written with the regular expression Category:Interior of .+ and the language code en.

Contrary to standard property constraints, this constraint is added with has characteristic (P1552) on properties. As a complex constraint, it also requires the addition of {{Complex constraint}} to the property talk page.

The output is available only as a periodically updated report at Wikidata:Database_reports/Complex_constraint_violations.

Possible actions

[edit]

The main report for the constraint violations allows top-down analysis and the correction of minor or systematic errors. It generally doesn't aim to achieve zero constraint violations. Sample corrections can be:

  • fix uppercase/lowercase errors on items: e.g. items for the history of topic shouldn't be labelled "History of <topic>", but "history of <topic>". This is an initial cleanup generally needed for labels based on Wikipedia article titles.
  • fix typos: e.g. ensure "geography" isn't spelled "gegography"
  • It's possible that the label of another language was incorrectly added to the language being checked: e.g. the French label shouldn't use the English label. This can happen through manual or bot edits
  • It's possible that the label incorrectly includes "Category:"
  • It's possible that the label misses "Category:"

Also:

  • It’s possible that the value is correct, but does not belong to this property, and that it should be moved to a statement for a different property: e.g. "Category:Films set in <place>" is added instead of "Category:Films shot in <place>".
  • It’s possible that the property has expanded its field and the regex needs to be adapted.

A second report lists languages that have labels for the values, but no regular expression defined.

Parameters

[edit]

This constraint has one mandatory and one optional parameter:

format as language specific regular expression (P8770)
Contains the format/pattern and the language code. It can contain one or several values for a given language. no value Help or unknown value Help are not permitted. It must be a valid regular expression.
syntax clarification (P2916)
Contains a human-readable description of the pattern. Can be specified several times in different languages.


Examples

[edit]

Example 1

[edit]

The labels of the values for category for the interior of the item (P7561) should start with Category:Interior of .+.

has characteristic
Normal rank complex constraint value label
format as language specific regular expression Category:Interior of .+ (English)
0 references
add reference
add value

Template

[edit]

To define the constraint, {{Complex constraint}} with a SPARQL query needs to be added to the property's talk page.

This can be done by adding:
{{subst:Define value label constraint}}

Lists

[edit]

Statistics

[edit]

By language

[edit]

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang ?count sample
regex
sample
prop
English en 28 Category:Honorary citizens (of|in|from) .+ P10280
Danish da 11 .+[s'] bibliografi P8625
French fr 11 Catégorie:Citoyen? d'honneur d.+ P10280
Spanish es 8 Categoría:Ciudadanos honorarios de.+ P10280
Portuguese pt 8 Categoria:Filmes em língua .+ P5996
Italian it 7 Categoria:Film in .+ P5996
Polish pl 7 Kategoria:Filmy w języku .+ P5996
Swedish sv 7 Kategori:Hedersmedborgare .+ P10280
German de 6 USDA-Klimazone 1?\d[ab]? P8193
Dutch nl 6 economie van (de |het )?.+ P8744
Romanian ro 6 Categorie:Filme în limba .+ P5996
Catalan ca 5 economia d.+ P8744
Czech cs 5 ekonomika .+|.+ ekonomika P8744
Canadian English en-ca 4 Category:Films shot (in|at) .+ P1740
Bokmål nb 4 Kategori:.+språklige filmer P5996
British English en-gb 3 list of .+ episodes P1811
Esperanto eo 3 ekonomio de .+ P8744
Finnish fi 3 .+ talous P8744
Hungarian hu 3 .+ gazdasága P8744
Lithuanian lt 3 Kategorija:.+ garbės piliečiai P10280
Brazilian Portuguese pt-br 3 filmografia d.+ P1283
Afrikaans af 2 ekonomie van .+ P8744
Welsh cy 2 economi('r)? .+ P8744
Estonian et 2 Kategooria:.+ aukodanikud P10280
Basque eu 2 .+ ekonomia P8744
Galician gl 2 economía d.+ P8744
Nynorsk nn 2 .+ økonomi|økonomien til.+ P8744
Russian ru 2 экономика .+ P8744
Slovak sk 2 filmografia .+ P1283
Slovene sl 2 Kategorija:Častni meščani .+ P10280
Turkish tr 2 .+ filmografisi P1283
Ukrainian uk 2 економіка .+ P8744
Asturian ast 1 economía d.+ P8744
Azerbaijani az 1 .+ iqtisadiyyatı P8744
Bavarian bar 1 Kategorie:Ehrenbürger P10280
Belarusian be 1 Катэгорыя:Ганаровыя грамадзяне .+ P10280
Taraškievica be-tarask 1 Катэгорыя:Ганаровыя грамадзяне .+ P10280
Bulgarian bg 1 Категория:Почетни граждани .+ P10280
Chechen ce 1 Категори:.+ сийлахь гражданаш P10280
Indonesian id 1 ekonomi .+ P8744
Japanese ja 1 .+の経済 P8744
Kazakh kk 1 Санат:.+ құрметті азаматтары P10280
Mongolian mn 1 Ангилал:.+ хүндэт иргэн P10280
Malay ms 1 ekonomi .+ P8744
Occitan oc 1 economia .+ P8744
Tatar tt 1 Төркем:.+ шәрәфле ватандашлары P10280

∑ 46 items.

End of automatically generated list.

By property

[edit]

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

Property Patterns Link Violations Missing langs Sample pattern (English)
economy of topic (P8744) 35 def violations missing langs economy of (the )?.+
category for honorary citizens of entity (P10280) 22 def violations missing langs Category:Honorary citizens (of|in|from) .+
geography of topic (P2633) 21 def violations missing langs geography of .+|.+ geography
filmography (P1283) 19 def violations missing langs filmography of .+|.+ filmography|.+ in film
demographics of topic (P9241) 14 def violations missing langs demographics of .+
category for films in this language (P5996) 11 def violations missing langs Category:.(+-language|Sign Language) films
category for films shot at this location (P1740) 9 def violations missing langs Category:Films shot (in|at) .+
discography (P358) 8 def violations missing langs .+ discography|.+ catalog|discography of .+
list of episodes (P1811) 6 def violations missing langs list of .+ episodes
bibliography (P8625) 4 def violations missing langs bibliography o[fn] .+|.+ bibliography
KML file (P3096) 3 def violations missing langs Template:Attached KML/.+
hardiness of plant (P8193) 3 def violations missing langs 1?\d[ab]?
topic's main Wikimedia portal (P1151) 3 def violations missing langs Portal:.+
property usage tracking category (P2875) 2 def violations missing langs Category:Pages using Wikidata property P\d+|Category:.+ template using Wikidata
category for the interior of the item (P7561) 2 def violations missing langs Category:Interior of .+
history of topic (P2184) 2 def violations missing langs (history|timeline|chronology) of .+|.+ history
category for the view from the item (P8933) 2 def violations missing langs Category:Views from .+
list related to category (P1753) 2 def violations missing langs lists? of .+|births in .+|deaths in .+
has list (P2354) 2 def violations missing langs lists? of .+
category for recipients of this award (P2517) 1 def violations missing langs Category:.*([Ww]inner|[Ll]aureate|[Rr]ecipient|[Hh]onorary [Cc]itizen|[Ii]llustrious [Cc]itizen|[Hh]onorary [Dd]octor|[Ll]ecturer|[Ff]ellow|[Aa]cademician|[Ss]portsperson|[Mm]ember|[Mm]edalist|[Mm]edallist|[Ww]ork|[Ww]riter|[Pp]oet|[Cc]oache|[Mm]aster|[Ss]cholar|[Ss]ignatorie|[Hh]eroe|[Aa]ppointee|[Gg]rand [Cc]rosse|[Gg]rand [Oo]fficer|[Cc]ommander|[Oo]fficer|[Kk]night|[Dd]ame|[Mm]edal|[Cc]hevalier|[Hh]onoree|[Cc]ompanion|[Ff]ilm|[Ii]nductee|[Hh]ero [Cc]itie|[Cc]osmonau|[Cc]hampion|[Oo]rder|[Aa]rtist|[Pp]layer|[Ww]orker|[Ee]mployee|[Pp]laymate|[Cc]andidate|[Hh]older|[Cc]rosse|[Nn]ame|[Ss]ong|Named Reference)s|([Aa]lumn)i|(Sportsmen of the year|Sportswomen of the year).*
category for pictures taken with this camera (P2033) 1 def violations missing langs Category:(Photos t|T)aken with .+
content partnership category (P8464) 1 def violations missing langs Category:(Contributions|Media|Images|Books|Photographs|Photos|Files|Documents|Content donations) (contributed by|donated by|owned by|from|provided by|by) .+
list of characters (P1881) 1 def violations missing langs list of .+ characters|list of characters (of|in) .+
category for people who died here (P1465) 1 def violations missing langs Category:Deaths (in|on|at) .+
category for the view of the item (P8989) 1 def violations missing langs Category:Views of .+
category for people born here (P1464) 1 def violations missing langs Category:Births (in|on|at) .+
category for alumni of educational institution (P3876) 1 def violations missing langs Category:(.+ alumni|Alumni of .+|Graduates of .+|People educated at.+)
category for people buried here (P1791) 1 def violations missing langs Category:Burials (in|at) .+

∑ 28 items.

End of automatically generated list.

By consistency with regex

[edit]

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
British English en-gb geography of .+|.+ geography 33 0 100
Canadian English en-ca geography of .+|.+ geography 32 0 100
French fr géographie .+ 659 4 99.4
Finnish fi .+ maantiede 351 10 97.2
English en geography of .+|.+ geography 792 9 98.9
Portuguese pt geografia d[aoe]s? .+ 608 9 98.5
Dutch nl geografie van .+|.+geografie
geografie van (de |het )?.+
1038 11 98.9
Romanian ro geografia .+ 240 4 98.3
Basque eu [A-Z].+[kg]o geografia 370 6 98.4
Esperanto eo geografio de .+|.+ geografio 473 2 99.6
Italian it geografia d.+ 422 11 97.4
Polish pl geografia .+ 375 1 99.7
Spanish es geografía .+ 653 4 99.4
Catalan ca geografia d['e].+ 431 10 97.7
Swedish sv .+geografi 628 2 99.7
Danish da .+[s'’] geografi 46 4 91.3
Czech cs geografie .+ 492 7 98.6
Lithuanian lt [A-ZĄČĘĖĮŠŲŪŽ].+ geografija 226 5 97.8
Nynorsk nn .+sk geografi|geografien til.+|.+ sin geografi 73 4 94.5
Bokmål nb .+[s'’] geografi 217 8 96.3
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
Italian it Categoria:Film girati .+ 206 0 100
Canadian English en-ca Category:Films shot (in|at) .+ 51 0 100
Brazilian Portuguese pt-br Categoria:Filmes gravados (na|em|no|nos) .+ 50 0 100
French fr Catégorie:Film tourné .+ 1015 3 99.7
Polish pl Kategoria:Filmy kręcone .+ 842 1 99.9
Spanish es Categoría:Películas rodadas .+ 279 2 99.3
English en Category:Films shot (in|at) .+ 1190 2 99.8
Portuguese pt Categoria:Filmes gravados .+ 325 2 99.4
Swedish sv Kategori:Filmer inspelade (i|på) .+ 477 3 99.4
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
French fr Category:Intérieur de .+ 101 98 3
English en Category:Interior of .+ 21690 1293 94
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
French fr liste des épisodes d.+ 923 85 90.8
English en list of .+ episodes 4464 80 98.2
Portuguese pt lista de episódios d[aeo] .+ 798 47 94.1
Catalan ca llista d'episodis d.+ 437 63 85.6
British English en-gb list of .+ episodes 122 93 23.8
Canadian English en-ca list of .+ episodes 114 76 33.3
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
Esperanto eo diskaro de .+ 62 26 58.1
French fr discographie d.+ 11073 83 99.3
Italian it discografia d.+|catalogo .+ 5409 77 98.6
Polish pl dyskografia .+ 1641 70 95.7
Spanish es discografía d.+ 9735 554 94.3
English en .+ discography|.+ catalog|discography of .+ 15013 86 99.4
Portuguese pt discografia d.+ 2230 134 94
Danish da .+[s'] diskografi 144 10 93.1
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
French fr filmographie (du |de |des |d').+ 1411 33 97.7
German de Filmogra(f|ph)ie von .+|.+ Filmogra(f|ph)ie 201 33 83.6
Finnish fi .+ filmografia 214 3 98.6
English en filmography of .+|.+ filmography|.+ in film 1566 119 92.4
Dutch nl filmografie .+|.+ filmografie
filmografie van (de |het )?.+
52 25 51.9
Romanian ro filmografia .+ 72 14 80.6
Slovak sk filmografia .+ 6 5 16.7
Hungarian hu .+ filmográfiája|.+[- ]filmográfia 47 9 80.9
Turkish tr .+ filmografisi 100 6 94
Italian it filmografia .+ 308 15 95.1
Spanish es filmografía de .+ 1259 58 95.4
Portuguese pt filmografia d.+ 215 51 76.3
Catalan ca filmografia d.+ 86 12 86
Swedish sv .+ filmografi 129 7 94.6
Danish da .+[- ]filmografi 402 5 98.8
Czech cs filmografie .+ 23 6 73.9
Bokmål nb .+[- ]filmografi 50 5 90
Brazilian Portuguese pt-br filmografia d.+ 18 14 22.2
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
English en economy of (the )?.+ 1395 26 98.1
Romanian ro economia .+ 181 8 95.6
Turkish tr .+ ekonomisi|.+[td][ae] ekonomi 236 11 95.3
Polish pl gospodarka .+ 327 15 95.4
Catalan ca economia d.+ 327 9 97.2
Ukrainian uk економіка .+ 227 21 90.7
Czech cs ekonomika .+|.+ ekonomika 203 10 95.1
Slovene sl gospodarstvo .+ 487 13 97.3
Lithuanian lt .+ ekonomika 80 5 93.8
Malay ms ekonomi .+ 140 29 79.3
Galician gl economía d.+ 219 10 95.4
Occitan oc economia .+ 203 5 97.5
Nynorsk nn .+ økonomi|økonomien til.+ 95 16 83.2
Bokmål nb .+ økonomi 205 159 22.4
Italian it economia d(ella|ello|elle|egli|el|ei|i|ell|)[ '].+ 266 13 95.1
Spanish es economía de(l| las| la)? .+ 574 13 97.7
Japanese ja .+の経済 317 9 97.2
Russian ru экономика .+ 476 28 94.1
Swedish sv .* ekonomi 239 10 95.8
Danish da .+ økonomi|økonomi .+ 76 6 92.1
Indonesian id ekonomi .+ 171 27 84.2
Azerbaijani az .+ iqtisadiyyatı 95 8 91.6
Welsh cy economi('r)? .+ 84 6 92.9
Afrikaans af ekonomie van .+ 47 6 87.2
Asturian ast economía d.+ 146 5 96.6
Esperanto eo ekonomio de .+ 416 11 97.4
French fr économie d(u |es |e l'|e la |e |').+ 578 17 97.1
German de Wirtschaft .+ 236 15 93.6
Finnish fi .+ talous 215 9 95.8
Portuguese pt economia d(os|as|e|o|a) .+ 413 10 97.6
Dutch nl economie van (de |het )?.+ 1190 12 99
Basque eu .+ ekonomia 141 8 94.3
Slovak sk ekonomika .+ 113 12 89.4
Hungarian hu .+ gazdasága 103 10 90.3
Estonian et .+ majandus 42 9 78.6
End of automatically generated list.

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

lang ?lang regex labels ≠regex % regex
English en Template:Attached KML/.+ 9549 10 99.9
Swedish sv Wikipedia:KML/.+ 461 1 99.8
Czech cs Šablona:Mapa souřadnic/.+ 1056 1 99.9
End of automatically generated list.