Page MenuHomePhabricator

Add a new qualifier for the conflicts-with constraint to specify the properties and values that should be used instead
Open, Needs TriagePublicFeature

Description

When a property is used for a entity class where a different one should be used instead the current way of doing it is adding a conflicts-with constraint for the property instance of with the value to avoid. One example of that would be P407, which shouldn't be used for humans and we should use P103 and P1412 instead. Anyway, when the editors see the error on the entity page they only see that they shouldn't use that property for that type of entity, but they don't know that they should add the information using a different property.

Would it be possible creating a new qualifier to specify which property or properties should be used instead of that one and displaying that information in the error message? I know that we already have that information in the description of the property, but I consider that a workaround and it is harder to keep in sync among languages.


Review July 2021:

Such properties are:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Maybe possible alternate values could be displayed too (we don't have a property for that yet).

Esc3300 changed the subtype of this task from "Task" to "Feature Request".Jun 15 2021, 9:04 AM
Esc3300 renamed this task from Add a new qualifier for the conflicts-with constraint to specify the properties that should be used instead to Add a new qualifier for the conflicts-with constraint to specify the properties and values that should be used instead.Jul 11 2021, 2:15 PM
Esc3300 updated the task description. (Show Details)

I started working on this, but I'm not sure how should I handle the messages when multiple properties and multiple values are specified with the replacement property and replacement value qualifiers.

When only one property is provided I went with An entity should not have statements for both $1 and $2. Use $3 instead., and when only one property and one value are provided I went with An entity should not have statements for both $1 and $2. Use $3 with value $4 instead.

The one with only the property would be easy adapting it to multiple properties using PLURAL and becoming something like An entity should not have statements for both $1 and $2. Use {{PLURAL:$3|1=$5.|2=either $5 or $6.|one of the following:$4}}, and one replacement property with multiple values could work with something like this: An entity should not have statements for both $1 and $2. Use $3 with {{PLURAL:$4|1=value $6.|2=either $6 or $7 as value.|one of the following values:$5}}. But what can I put in the message when multiple properties and multiple values are provided?

Note that it’s also possible to have only a replacement value but no replacement property. Query of conflicts-with constraints with replacements. (Also, the message documentation should make it clear to translators that “instead” needs to be as vague as it is, because looking at that query, it seems like $3 should sometimes be used “instead of $1” and sometimes “instead of $2” – this needs to be left to the interpretation of the human reader of the message, I think.)

For the multi-multi case I would suggest a message with more than one paragraph, something like:

An entity should not have statements for both $1 and $2.

Replacement properties:

Replacement values:

This is probably a separate message; I’m not sure how many of the other options should be combined into shared messages (using PLURAL) and how many of them should also be separate messages.

Note that it’s also possible to have only a replacement value but no replacement property.

In this case should I assume that the same property with a different value should be used instead?

One of the few examples currently where replacement value without replacement property is used is P9650, should the message in this claim be something like this?

An entity should not have a statement for Internet Game Database company ID if it also has a statement for instance of with value company. Use instance of with value video game developer instead.

If the same property should be used not repeating the "instance of" property in the replacement part makes the message more confusing, because it's not that clear if the property that needs a change is the one that triggered the constraint message or the other one.

Additionally, we could also make that if "replacement value" is provided "replacement property" would be mandatory for the constraint to be valid, that way there wouldn't be confusion about which of the properties should have its value replaced.

I would prefer to avoid interpreting the constraint too much, and limit the message to something like “Use the value video game developer instead.” The user can hopefully make a better decision about what a correct fix looks like. (But yes, making the replacement value invalid when no replacement property is given would also be an option, I think.)

For the multi-multi case I would suggest a message with more than one paragraph, something like:

An entity should not have statements for both $1 and $2.

Replacement properties:

Replacement values:

How can I do a message with multiple paragraphs as the one in the example above? The only way I can think of is adding HTML code to the messages, but checking the list of the existing messages in the extension I don't see any message with HTML tags in it, so I suppose there's a better way to get the same result.

Include two line breaks in the source (\n\n – you can often see that in qqq.json before the list of parameters for a message, for example), then it’ll be wikitext-parsed as a paragraph break.