Template talk:Constraint:Item

From Wikidata
Jump to navigation Jump to search

Several values[edit]

Hi, per Property talk:P245, would it be possible to have a set of possible items? Eg, to be either a person or an organisation, {{Constraint:Item|property=P107|item=Q215627|item2=Q43229}}

Thanks! --Jean-Frédéric (talk) 16:15, 28 May 2013

I agree, this would be very useful - LaddΩ chat ;) 23:31, 7 June 2013 (UTC)[reply]
+1, I was also just checking the documentation to find out how to introduce an "OR" into the logic. --Beat Estermann (talk) 17:59, 28 July 2013 (UTC)[reply]

hi, i added {{Constraint:Item|property=P107|item=Q386724|item2=Q215627|item3=Q43229}} to Property talk:P345, but on Wikidata:Database reports/Constraint violations/P345 was generated "Item main type (GND) (P107) = creative work (Q386724)" violations". Why? --Jklamo (talk) 13:52, 23 July 2013 (UTC)[reply]

Is this still actual for some properties? — Ivan A. Krestinin (talk) 18:07, 10 September 2013 (UTC)[reply]
Yes, for example for P132 (P132) see Property_talk:P964#Type_constraint:_Add_.7B.7BQ.7C262882.7D.7D.2C_.7B.7BQ.7C261023.7D.7D. Actually, I guess the same is probably true for every country, where there are more complex administrative units, which play on different levels of the hierarchy. --Zuphilip (talk) 14:32, 2 November 2013 (UTC)[reply]

@Ivan A. Krestinin: If Plant List ID (Royal Botanic Gardens, Kew) (P1070) is present then taxon rank (P105) has to be one of the following items: species (Q7432), variety (Q767728), subspecies (Q68947) or form (Q279749). So it would be great to have something like {{Constraint:Item|property=P105|oneof=Q7432, Q767728, Q68947, Q279749}}. --Succu (talk) 10:40, 23 March 2014 (UTC)[reply]

✓ Done, please use {{Constraint:Item|property=P105|items={{Q|7432}}, {{Q|767728}}, {{Q|68947}}, {{Q|279749}}}}. — Ivan A. Krestinin (talk) 19:38, 23 March 2014 (UTC)[reply]

How to check "should not have"?[edit]

How can I check an item to not have a certain property? For example items having ISO 3166-3 should not have ISO 3166-1. --Pabouk (talk) 12:44, 20 August 2013 (UTC)[reply]

There is no such ability now. I did not implement it because it can greatly increase visual size of constraint section on property talk pages. But if you make constraint templates more compact, I will try to implement this ability. — Ivan A. Krestinin (talk) 18:05, 10 September 2013 (UTC)[reply]
✓ Done, please use {{Constraint:Conflicts with}}. — Ivan A. Krestinin (talk) 19:40, 23 March 2014 (UTC)[reply]

any of some properties[edit]

Since P107 (P107) is going to be deleted or replaced, can the constraints be changed to something like "is instance of X or subclass of Y"? --AVRS (talk) 10:13, 10 September 2013 (UTC)[reply]

I think we need to find a sensible replacement for P107. --  Docu  at 16:58, 10 September 2013 (UTC)[reply]
There are {{Constraint:Type}} and {{Constraint:Value type}} for this purpose. But be warning: many items/classes are conflicting because linked using iwiki pages describe similar, but not exact the same term. For example: Nova Gorica (Q1018) is instance of en:Town and Nova Gorica (Q1018) is instance of ru:Город, but ru:Город is linked with en:City. P107 (P107) is less conflicting because it is more general and well-defined. — Ivan A. Krestinin (talk) 17:59, 10 September 2013 (UTC)[reply]

Checks[edit]

As you might have noticed, my tool, which template links to, does not work anymore. Good news: There is a much better replacement!

  • For "items with property A that do not have property B", try this.
  • For "items with property A that do not have property B => item C", try this.

Someone should change that in the template. Note that the new tool can be lagging up to ~10min behind. --Magnus Manske (talk) 16:35, 30 October 2013 (UTC)[reply]

Subtree of item[edit]

How to make such a constraint, for example for located in the administrative territorial entity (P131)? So we want to define not specific administrative unit but any of subunits too. --Infovarius (talk) 12:52, 13 January 2014 (UTC)[reply]

Do you mean Template:Constraint:Type? But I really doubt that we want that for located in the administrative territorial entity (P131)... --Zuphilip (talk) 17:13, 13 January 2014 (UTC)[reply]
Yes, look at constraints at Canmore ID (P718) - without that they are going wrong. --Infovarius (talk) 14:15, 14 January 2014 (UTC)[reply]
Ah, now I understand, you want to change a constraint at Property_talk:P718, namely the one with located in the administrative territorial entity (P131). That is reasonable, but I guess it is not (yet) possible. --Zuphilip (talk) 16:56, 14 January 2014 (UTC)[reply]

Wikidata query Toolserver to Toollabs[edit]

Hi just changed the url to point to to toollabs instead of the Toolserver. Looks like the syntax has changed. Someone has to do some template magic (lua/) to make a link like "CLAIM[<property id of the talk page without the P> AND NOCLAIM[<P in template without the P>]". Multichill (talk) 10:46, 13 July 2014 (UTC)[reply]

Fixed. — Ivan A. Krestinin (talk) 15:52, 13 July 2014 (UTC)[reply]

Several properties[edit]

For Property talk:P219, I need {{Constraint:Item|property=property1 OR property2}}. Please ping me if/when it is implemented. Visite fortuitement prolongée (talk) 20:55, 30 December 2014 (UTC)[reply]