(This is actually an epic) Stage 1: This should be fixed before constraint is workable for Commons. Stage 2: This should be fixed before constraint is workable for other Wikibase instances using only Wikidata entities (assumed the same set of constraints is used). Stage 2a: Other Wikibase instances may define their own constraints in their properties. Stage 3: This should be fixed before constraint is workable for other Wikibase instances using only Wikidata properties and both Wikidata and local items (assumed the same set of constraints is used). Stage 4: This should be fixed before constraint is workable for other Wikibase instances using both Wikidata entities and local entities (assumed the same set of constraints is used). Stage 5a: Other Wikibase instances can define and modify constraints, even for foreign properties (requires 2a). (In some cases a local property may be used, but we obviosly don't want properties with same meaning, only usable in Commons, with different constraints) Stage 5b: Other Wikibase instances can use items from more than one Wikibase instances other than Wikidata. = single value, multiple value, format, scope No issue = distinct value No issue. There may be some usecase to make the value unique among multiple Wikibase instances, but it is out of the scope of this task # type, value type * [2a] the "relation" parameter is not useful in custom constraints in other Wikibase instances. It should be replaced (see T169858#3539187). * [3] type constraint will require relationship between local and Wikidata items, e.g. local:Q111 local:Q222 d:Q5. It is currently not workable in simple SPARQL, though still possible in federated query. * [5b] the relation may involve multiple instances multiple times (e.g. a:Q123->b:Q456->a:Q111->b:Q222). This can only be checked only if 1. We require all instances to expose relations to a common graph store or 2. check the relation by means other than SPARQL (uncertain what the way is). # commons link See also T169538 and T90492 for issues involving only one media repo. Further improvement is needed if multiple repos should be supported together. A new qualifier may be needed if we need to specify a repo to be used in a property. # qualifiers # General * [5a] It may be possible to disable some or all constraints defined in Wikidata ** This requires metadata support for federated entity (which constraints is disabled) which might not be expressed in current Wikibase DataModel; but this may also be solved in next way * [5a] It may be possible to define new constraint for foreign property ** This requires an editable mirror of foreign property *** It only have information in a "diff", that is the difference of foreign property and the local mirror *** It may be able to add new local term/statement *** It may be able to modify foreign term/statement (e.g. add a local qualifier) *** It may be able to disable (=remove) foreign statement (and preferly, all statement with a same specific property) *** e.g. The mirror of Wikidata's `P31` in Commons may be located in https://commons.wikimedia.org/wiki/Property:d:P31 or https://commons.wikimedia.org/wiki/FederatedWikibase:d:P31