Help talk:Property constraints portal/One of

From Wikidata
Jump to navigation Jump to search

erroneous value example[edit]

If anyone has a better example for “someone confused value X for value Y when adding the statement”, feel free to edit the possible actions – I’m a bit suspicious about the misadventure (Q4317891) vs accident (Q171558) example. --Lucas Werkmeister (WMDE) (talk) 14:30, 25 May 2017 (UTC)[reply]

It’s now left (Q13196750) vs. left-wing (Q164597), which feels a bit silly, but whatever. --Lucas Werkmeister (WMDE) (talk) 15:29, 17 July 2017 (UTC)[reply]

no value and unknown value in parameter[edit]

@Ivan A. Krestinin: do you agree with the interpretation of no value Help and unknown value Help I proposed in #Parameters? --Lucas Werkmeister (WMDE) (talk) 14:30, 25 May 2017 (UTC)[reply]

Yes, bot and migration code support novalue and somevalue as you described. — Ivan A. Krestinin (talk) 17:08, 25 May 2017 (UTC)[reply]

Sample[edit]

Maybe P21 could be used as a sample? (not necessarily with the full list).
--- Jura 13:05, 14 July 2017 (UTC)[reply]

sex or gender (P21) is tricky… I definitely do not want to say that the only values are male (Q6581097) and female (Q6581072), but the full list of all used values is currently 18 items long, so we’d have to cut it off somewhere. But I’d much rather use a simpler property, like manner of death (P1196), instead of deciding which gender identities have to be part of the example and which ones can be neglected. --Lucas Werkmeister (WMDE) (talk) 14:23, 14 July 2017 (UTC)[reply]
Yeah, that could lead to endless discussions. Maybe blood type (P1853) ?
--- Jura 14:29, 14 July 2017 (UTC)[reply]
 Support Oh, I like that idea. Apparently there’s only four values (do we not record rhesus factor and all that other stuff?), and people are probably more familiar with it than the US Standard Death Certificate. --Lucas Werkmeister (WMDE) (talk) 14:48, 14 July 2017 (UTC)[reply]
Potentially more could be added, but it's mainly there for Asian users.
--- Jura 14:52, 14 July 2017 (UTC)[reply]
Yeah, I heard it’s a cultural thing in Asia, similar to one’s zodiac sign elsewhere.
But I just realized – now that we have constraint statements, we can throw queries at the problem :) so here’s some more “one-of” constraints with few allowed values:
SELECT ?property ?propertyLabel (COUNT(?value) AS ?count) (GROUP_CONCAT(?valueLabel; separator=", ") AS ?values) WHERE {
  ?property p:P2302 [
    ps:P2302 wd:Q21510859;
    pq:P2305 ?value
  ].
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?property rdfs:label ?propertyLabel.
    ?value rdfs:label ?valueLabel.
  }
}
GROUP BY ?property ?propertyLabel
ORDER BY ?count
LIMIT 50
Try it!
There are some more very nice examples, like driving side (P1622) (two values), expected completeness (P2429) (three values) or interaction (P517) (four values). All of these are probably very stable, too (unless a fifth fundamental force is discovered). --Lucas Werkmeister (WMDE) (talk) 14:58, 14 July 2017 (UTC)[reply]
driving side (P1622) seems easily understood.
--- Jura 15:30, 14 July 2017 (UTC)[reply]
✓ Done --Lucas Werkmeister (WMDE) (talk) 15:29, 17 July 2017 (UTC)[reply]