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 properties
Allowed values Items for property constraint (Q21502402): Help:Property constraints/list of constraints. (see overview page here) (note: this should be moved to the property statements)
Usage notes Implementation is still pending. See talk page page for overview.
Example IMDb ID (P345)distinct values constraint for Wikidata properties (Q21502410)
date of birth (P569)single value constraint (Q19474404)
Robot and gadget jobs Migrate constraints from property talk pages.
See also qualifier of property constraint (P2305)
Lists
Proposal discussion Property proposal/Archive/40#P2302
Current uses 1,616
[create] Create a translatable help page (preferably in English) for this property to be included here
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 for Wikidata properties -
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 Number value: qualifier to define a property constraint in combination with P2302 Property talk:P2312 -
minimum quantity P2313 Number value: 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} -
comment P2315 Monolingual text comment: user note about usage of property or item (generally used as qualifier). For user notes currently in descriptions and later to be displayed in addition to descriptions, use Property:P2559. Do not use this to add unstructured content to Wikidata. Property talk:P2315 -
constraint status P2316 Item qualifier to define a property constraint in combination with P2302 Property talk:P2316 -

Old style constraints[edit]

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 (P2315),constraint status (P2316),format as a regular expression (P1793): 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#Qualifiers, SPARQL
Type "Wikidata property (Q18616576)": element must contain property instance of (P31) with class Wikidata property (Q18616576) or its 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

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 qualifiers 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)