Property talk:P2302

From Wikidata
Jump to: navigation, search

Documentation

property constraint
constraint applicable to this Wikidata property
Represents property constraint (Q21502402)
Data type Item
Domain
According to this template: properties
According to statements in the property:
Wikidata property (Q18616576)
When possible, data should only be stored as statements
Allowed values
According to statements in the property:
allowed qualifiers constraint (Q21510851), allowed units constraint (Q21514353), Commons link constraint (Q21510852), conflicts-with constraint (Q21502838), contemporary constraint (Q25796498), difference within range constraint (Q21510854), distinct values constraint (Q21502410), format constraint (Q21502404), inverse constraint (Q21510855), item requires claim constraint (Q21503247), mandatory qualifier constraint (Q21510856), multi-value constraint (Q21510857), one-of constraint (Q21510859), range constraint (Q21510860), single value constraint (Q19474404), symmetric constraint (Q21510862), type constraint (Q21503250), used as qualifier constraint (Q21510863), used as reference constraint (Q21528959), used for values-only constraint (Q21528958), value requires claim constraint (Q21510864) and value type constraint (Q21510865)
When possible, data should only be stored as statements
Usage notes Both Special:Constraint report and Wikidata:Database reports/Constraint violations starts to use constraint statements since July 2017
Example IMDb ID (P345)distinct values constraint (Q21502410)
date of birth (P569)single value constraint (Q19474404)
Robot and gadget jobs Migrate constraints from property talk pages.
See also mandatory qualifier (P1646), inverse of (P1696)
Lists
Proposal discussion Property proposal/Archive/40#P2302
Current uses 3,193
[create] Create a translatable help page (preferably in English) for this property to be included here
Qualifiers “exception to constraint (P2303), group by (P2304), qualifier of property constraint (P2305), property (P2306), namespace (P2307), class (P2308), relation (P2309), minimum date (P2310), maximum date (P2311), maximum quantity (P2312), minimum quantity (P2313), comment (DEPRECATED) (P2315), constraint status (P2316), format as a regular expression (P1793), syntax clarification (P2916): this property should be used only with listed qualifiers.
Exceptions are possible as rare values may exist.
List of this constraint violations: Database reports/Constraint violations/P2302#Allowed qualifiers, SPARQL
Type “Wikidata property (Q18616576): element must contain property “instance of (P31)” with classes “Wikidata property (Q18616576)” or their subclasses (defined using subclass of (P279)).
Exceptions are possible as rare values may exist.
List of this constraint violations: Database reports/Constraint violations/P2302#Type Q18616576, SPARQL
Value type “property constraint (Q21502402): This property should use items as value that contain property “subclass of (P279)”. On these, the value for subclass of (P279) should be an item that uses subclass of (P279) with value property constraint (Q21502402) (or a subclass thereof).
Exceptions are possible as rare values may exist.
List of this constraint violations: Database reports/Constraint violations/P2302#Value type Q21502402, SPARQL
One of allowed qualifiers constraint (Q21510851), allowed units constraint (Q21514353), Commons link constraint (Q21510852), conflicts-with constraint (Q21502838), contemporary constraint (Q25796498), difference within range constraint (Q21510854), distinct values constraint (Q21502410), format constraint (Q21502404), inverse constraint (Q21510855), item requires claim constraint (Q21503247), mandatory qualifier constraint (Q21510856), multi-value constraint (Q21510857), one-of constraint (Q21510859), range constraint (Q21510860), single value constraint (Q19474404), symmetric constraint (Q21510862), type constraint (Q21503250), used as qualifier constraint (Q21510863), used as reference constraint (Q21528959), used for values-only constraint (Q21528958), value requires claim constraint (Q21510864), value type constraint (Q21510865): value must be one of the specified items. Please expand list if needed.
Exceptions are possible as rare values may exist.
List of this constraint violations: Database reports/Constraint violations/P2302#One of, values statistics, SPARQL
Title ID Data type Description Examples Inverse
property constraint P2302 Item property constraint: constraint applicable to this Wikidata property IMDb ID <property constraint> distinct values constraint -
exception to constraint P2303 Item item that is an exception to the constraint, qualifier to define a property constraint in combination with P2302 Property talk:P2303 -
group by P2304 Property qualifier to define a property constraint in combination with P2302 Property talk:P2304 -
qualifier of property constraint P2305 Item qualifier to define a property constraint in combination with P2302 Property talk:P2305 -
property P2306 Property Wikidata property: qualifier to define a property constraint in combination with P2302 Property talk:P2306 -
namespace P2307 String qualifier to define a property constraint in combination with P2302 Property talk:P2307 -
class P2308 Item qualifier to define a property constraint in combination with P2302 Property talk:P2308 -
relation P2309 Item qualifier to define a property constraint in combination with P2302 Property talk:P2309 -
minimum date P2310 Point in time qualifier to define a property constraint in combination with P2302 Property talk:P2310 -
maximum date P2311 Point in time qualifier to define a property constraint in combination with P2302 Property talk:P2311 -
maximum quantity P2312 Quantity maximum: qualifier to define a property constraint in combination with P2302 Property talk:P2312 -
minimum quantity P2313 Quantity minimum: qualifier to define a property constraint in combination with P2302 Property talk:P2313 -
format as a regular expression P1793 String regular expression: regex describing an identifier or a Wikidata property IMDb ID <format as a regular expression> ev\d{7}\/\d{4}(-\d)?|(ch|co|ev|nm|tt)\d{7} -
constraint status P2316 Item qualifier to define a property constraint in combination with P2302 Property talk:P2316 -
syntax clarification P2916 Monolingual text syntax: qualifier to provide extra details on the syntax of a statement value, in particular for P1793 (regular expression), qualifier to provide details on the function or purpose of a property constraint Property talk:P2916 -

Old style constraints[edit]

Label/description[edit]

As label and description seemed to have been made for a general list for Special:ConstraintReport, I adapted it a bit to the usual format. The same might need to be done with the others. --- Jura 10:02, 18 November 2015 (UTC)

✓ solved more or less.

Constraints currently not included in Special:ConstraintReport[edit]

New value for property: allowed units constraint (Q21514353)[edit]

This wasn't included in mw:WikidataQuality/Constraints, but as we have a corresponding template, I created this as well. --- Jura 19:31, 19 November 2015 (UTC)

Full list should eventually be available at Help:Property constraints/list of constraints. --- Jura 20:00, 19 November 2015 (UTC)

There is also units used for this property (P2237) for the same. Not sure if that should be converted as well. --- Jura 20:07, 19 November 2015 (UTC)

Other[edit]

There is also:

--- Jura 12:09, 23 November 2015 (UTC)


Conversion of existing properties[edit]

Property:P1646[edit]

The above property should eventually be converted from

position held (P39) > mandatory qualifier (P1646) > start time (P580)

to:

position held (P39) > property constraint (P2302) > mandatory qualifier constraint (Q21510856) > property (P2306) > start time (P580)

(sample, possibly outdated, from property talk:P1646). --- Jura 19:31, 19 November 2015 (UTC)


format as a regular expression (P1793)[edit]

This is currently used directly on properties. Eventually this should be change to be used with property constraint (P2302). --- Jura 20:42, 19 November 2015 (UTC)

Current:

Wikimedia database name (P1800) > format as a regular expression (P1793) > "([a-z]{2,3}(_[a-z]*){0,2}|simple|wikidata|commons|species|meta|mediawiki)wiki(books|news|quote|source|voyage|)"

New:

Wikimedia database name (P1800) > property constraint (P2302) > format constraint (Q21502404) > format as a regular expression (P1793) > "([a-z]{2,3}(_[a-z]*){0,2}|simple|wikidata|commons|species|meta|mediawiki)wiki(books|news|quote|source|voyage|)"

inverse of (P1696)[edit]

Another one.

Current

part of (P361) > inverse of (P1696) > has part (P527)

New:

part of (P361) > property constraint (P2302) > inverse constraint (Q21510855) > property (P2306) > has part (P527)

--- Jura 22:42, 19 November 2015 (UTC)


units used for this property (P2237)[edit]

See #New_value_for_property:_allowed_units_constraint_.28Q21514353.29--- Jura 12:09, 23 November 2015 (UTC)


New approach limitations[edit]

Incomplete TODO/to think list:

1. One of and quantity:

Mohs' hardness (P1088): {{Constraint:One of|values=1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}
parity (P1123): {{Constraint:One of|values=-1, 1}}
Hermann-Mauguin notation (P1632): {{Constraint:One of|values=1, {{overline|1}}, 2, m, 2/m, 222, mm2, mmm, 4, {{overline|4}}, 4/m, 422, 4mm, 42m, 4/mmm, 3, {{overline|3}}, 32, 3m, {{overline|3}}m, 6, {{overline|6}}, 6/m, 622, 6mm, 6m2, 6/mmm, 23, m3, 432, {{overline|4}}3m, m{{overline|3}}m}}

2. Properties in exceptions:

formatter URL (P1630): {{Constraint:Type|classes=Q19847637,Q18614948|relation=instance|exceptions={{P|625}}}} and other
mix'n'match catalogue ID (P2264): {{Constraint:Single value|exceptions={{P|350}} }}

3. 'now' value and range constraint:

date of taxon name publication (P574): {{Constraint:Range|min=1753|max=now|mandatory=true}}
retrieved (P813): {{Constraint:Range|min=2001|max=now}}
and other

4. How to copy-paste constraints?

5. Blocker issue: Wikidata editor hung on editing long lists. Real-life case: Property talk:P225, can be tested on Property:P370.

Ivan A. Krestinin (talk) 19:14, 22 November 2015 (UTC)


Some comments:
1. The new datatype for integers that is being discussed could be the better choice for Mohs' hardness (P1088). For indexes that do have a maximum number of decimals, a constraint for quantity could be helpful. Hermann-Mauguin notation (P1632) could be done with a regex. I wasn't aware that "one of" works for non-items, so we might need to change the module.
5. I tried an approach with Q21532100, see Property talk:P369
--- Jura 12:09, 23 November 2015 (UTC)
5. Several workarounds are possible, but its have negative points. For example your approach makes exception list querying too complex. Also exception list item will have the same issue with long list. — Ivan A. Krestinin (talk) 12:54, 23 November 2015 (UTC)
5. The problem with adding them to properties is that they are loaded every time we load the property. Given their length, maybe these lists should not be defined as exceptions, but handled through different definitions of the constraints. --- Jura 13:07, 23 November 2015 (UTC)
5. The page is loaded quickly, as I see. Main issue is editing. Editor can not process so long list. Exceptions is not the only long list. qualifier of property constraint (P2305) will have many items for some properties too. — Ivan A. Krestinin (talk) 13:16, 23 November 2015 (UTC)
5. https://www.wikidata.org/wiki/Special:EntityData/P370.rdf is a bit slow. --- Jura 13:26, 23 November 2015 (UTC)
5. https://phabricator.wikimedia.org/T118232 might be a problem for the qualifier approach. --- Jura 13:14, 23 November 2015 (UTC)
6. +Wikidata:Property_proposal/Property_metadata#Constraint_report_mode. Currently Special:ConstraintReport doesn't apply constraints that are placed after a section heading. If the same should be possible in the new format, we need a property for this. --- Jura 09:33, 24 November 2015 (UTC)
1. Property talk:P1632#Formatting seems to be a problem in any case. --- Jura 10:22, 24 November 2015 (UTC)
1. Sample for a quantity-property that could be limited to three decimals: Property talk:P1081. --- Jura 12:41, 24 November 2015 (UTC)