Page MenuHomePhabricator

Check distinct values (unique value) constraint on qualifiers and references
Closed, ResolvedPublic

Description

There are currently two properties with “used as qualifier” and “distinct values” constraints (query). We need to support that, but it’s not trivial because the SPARQL query we use gets somewhat more complicated.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 11 2017, 1:31 PM

Change 378921 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] WIP: unique value for qualifiers and references

https://gerrit.wikimedia.org/r/378921

Two semantics questions:

  • Is it a constraint violation if the same value is used in a statement and elsewhere in a qualifier? Or should values only be distinct between all main snaks / all qualifiers / all references? (My current WIP implementation only checks uniqueness within one “kind” of snak – main snak, qualifier, or reference.)
  • Is it a constraint violation if the exact same reference (same hash, same RDF node) is used several times (on the same entity or on different entities) and includes a “distinct values” property?

I'd say:

  1. distinct by type
  2. yes

Alright, that’s what Ic997019ab7 (no longer WIP) implements.

Change 378921 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Check “unique value” constraint on qualifiers and references

https://gerrit.wikimedia.org/r/378921

Lucas_Werkmeister_WMDE closed this task as Resolved.Oct 9 2017, 4:42 PM
Lucas_Werkmeister_WMDE moved this task from Review to Done on the Wikidata-Former-Sprint-Board board.