Template talk:Constraint:Type
Please review template name, property name, description and etc. My English is not well. — Ivan A. Krestinin (talk) 18:00, 9 June 2013 (UTC)
How can I constraint type to more than one item like in this? Infovarius (talk) 10:15, 22 October 2013 (UTC)
- Define base class that include both classes, inherit your items from this class using subclass of (P279) and use base class item for constraint. — Ivan A. Krestinin (talk) 18:52, 22 October 2013 (UTC)
- Всё-таки, если это не слишком сложно, сделайте пожалуйста шаблон, который будет отслеживать, выполнено ли хотя бы одно из двух ограничений. Например, work (Q386724) или version, edition or translation (Q3331189). Я подозреваю, что произвольный класс такого вида не пройдёт по WIkidata:Notability. Danneks (talk) 17:12, 26 August 2014 (UTC)
Do subclasses only go one level deep?
editI noticed that legislative body (P194) requires elements to have "instance of => administrative division" or one of its subclasses. The problem is that many pages have "instance of => US state" (or Canadian province or region of Italy, etc), all of which have "instance of => first-level administrative division (Q13220202)", which in turn has "subclass of => administrative division". Does that mean that this constraint is only looking one level deep for subclasses? If so, should all of the pages like US state, Canadian province, and region of Italy be given "subclass of => administrative division"? --Arctic.gnome (talk) 05:08, 26 November 2013 (UTC)
How to specify "subclass or instance"?
edit@Ivan A. Krestinin: For field of this occupation (P425) the type constraint {{Constraint:Type|class=Q13516667|relation=...}} refers to occupation (Q13516667) (and implicitly subclasses of it, like profession (Q28640) because of
). Now, both
are considered valid items to carry field of this occupation (P425) but playing with the "relation" parameter of Template:Constraint:Type between "subclass" and "instance" either one or the other item passes the constraint test, never both. Could the relation parameter be slightly extended to allow combinations of properties, perhaps even more than P31 and P279 (I could imagine that part of (P361) sometimes also would be useful here)? Or could any problem already be solved if "relation=subclass" would automatically imply "relation=instance"? -- Gymel (talk) 08:14, 23 September 2014 (UTC)
- Same discussions appears from time to time. Last time I saw discussion about chemical compound (Q11173). The question is: what is occupation (Q13516667)? Solution depends of answer to this question. — Ivan A. Krestinin (talk) 18:31, 23 September 2014 (UTC)
- Not at all. occupation (Q13516667) is just something broader than profession (Q28640) but the problem actually was exactly the same two weeks ago when we formulated {{Constraint:Type|class=28640|relation=...}}. The problem might be that is wrong and should be . But and this again "is a" profession (as instance or class) and so on: Not using P31 for professions but P279 IMHO would demand to remove any reference to profession (Q28640) from most professions since it should be P279-wise inherited from the top level item (probably scientist or something even broader). The current situation is, that some items with P245 are (P31) professions and other items are subclasses (P279) of such items and the "relation" parameter allows to specify one of these two cases, leaving the other one as constraint violation. -- Gymel (talk) 19:33, 23 September 2014 (UTC)
- I suppose that the solution here is to use - then we have no counter examples. profession (Q28640) we can consider as a metaclass (Q19361238). --Infovarius (talk) 10:54, 6 October 2016 (UTC)
- Not at all. occupation (Q13516667) is just something broader than profession (Q28640) but the problem actually was exactly the same two weeks ago when we formulated {{Constraint:Type|class=28640|relation=...}}. The problem might be that is wrong and should be . But and this again "is a" profession (as instance or class) and so on: Not using P31 for professions but P279 IMHO would demand to remove any reference to profession (Q28640) from most professions since it should be P279-wise inherited from the top level item (probably scientist or something even broader). The current situation is, that some items with P245 are (P31) professions and other items are subclasses (P279) of such items and the "relation" parameter allows to specify one of these two cases, leaving the other one as constraint violation. -- Gymel (talk) 19:33, 23 September 2014 (UTC)
- For intangible cultural heritage status (P3259) this might be needed as well.
--- Jura 06:49, 5 October 2016 (UTC) - I just noticed the same problem on from narrative universe (P1080), which requires items to be an instance of (P31)fictional entity (Q14897293). This works fine for individual objects, like Millennium Falcon (Q19901) (which is instance of (P31)fictional spacecraft (Q14637321)). But not for types of objects, like lightsaber (Q19873) (which is subclass of (P279)fictional sword (Q15720873) but has no instance of (P31) value). Maybe the solution is to apply "instance of → class of fictional object" on every fictional item that isn't unique? --Arctic.gnome (talk) 16:35, 13 October 2016 (UTC)
- Sandrart.net person ID (P1422) should probably be allowed to be instance of (P31) OR subclass of (P279) of abstract being (Q15619164), cf. here. --Marsupium (talk) 16:12, 26 May 2017 (UTC)
- Is there a way to change the template functionality or is it necessary to use Template:Complex constraint? --Marsupium (talk) 16:14, 26 May 2017 (UTC)
- Info more discussion at Topic:Ttr8hnl0p538ondh and a ticket at Phab:T169858
--- Jura 09:49, 6 July 2017 (UTC) - Support I need instance or subclass of (Q30208840) to claim about "all organizations" and particular organization using same constraints. d1g (talk) 19:12, 28 September 2017 (UTC)
Notified participants of WikiProject property constraints
- @Gymel, Ivan A. Krestinin, D1gggg, Jura1: WikibaseQualityConstraints support for the instance or subclass of (Q30208840) relation is now deployed. Let me know if anything’s not working as expected. --Lucas Werkmeister (WMDE) (talk) 14:26, 12 February 2018 (UTC)
- I find this constratint type very suspect, and its need an indication that sloppy modelling has happened. Consider, for example, professions. It is not really the case that economist is a subclass of profession, but that economist is a subclass of professional (which is itself a subclass of person). So professions are instances of profession, and are themselves classes of people. Peter F. Patel-Schneider (talk) 12:01, 24 May 2018 (UTC)