Wikidata:Property proposal/Wikidata property example statement ID
Wikidata property example statement ID
[edit]Originally proposed at Wikidata:Property proposal/Generic
Description | ID of a statement that is an example of this property being correctly used |
---|---|
Data type | External identifier |
Domain | property |
Example 1 | CVX vaccine code (P10876)Wikidata property example statement IDQ798309$59194e8f-4bec-3e80-b72c-06efea30532f |
Example 2 | CVX vaccine code (P10876)Wikidata property example statement IDQ4007170$e9e18d81-45f9-8eb4-8283-3b584ec1576f |
Example 3 | CVX vaccine code (P10876)Wikidata property example statement IDQ18388297$50654082-4cde-b427-a70b-af84bd7b6e58 |
Formatter URL | https://www.wikidata.org/wiki/$1 |
Wikidata project | WikiProject Properties (Q60008075) |
Motivation
[edit]This property will be a replacement for Wikidata property example (P1855). To allow the user to view the example statement, I have created a multilingual gadget that I am proposing should be enabled for all users that will show the statement embedded below the statement ID value:
I want to do this because:
- It's easier for property creators to add the examples to the property after they add the statement with the new property to the proposal examples. All they need to do is copy and paste those statement IDs.
- Users can see qualifier property examples better.
- If someone deletes the example statement from the origin item, a bot could easily delete the example on the property. Too many times do I see property examples, check their usage on the linked item, and they no longer exist or never existed in the first place.
- When we eventually have a statement property data type, we can easily switch this property's values over to it.
- It is easier for API users to use property examples. They just need to call call
wbgetclaims
with the statement ID.
Lectrician1 (talk) 00:16, 6 December 2022 (UTC)
Discussion
[edit]- Is there any way, this property could be generalized to point to claims in qualifiers or claims in references so that we can also use it for linking to examples for properties which are intended to be used in qualifiers or references? I'm asking because the current state of this proposal considers the following notation:
which would only work for pointing to statements, but not claims in qualifiers or claims in references. Recall that there are properties which are intended to be used as qualifiers (see Wikidata qualifier) or in sources (see Wikidata property to indicate a source) (see also Note 1 below), we should also have a way to link to examples for those properties.<<QID>>$<<ID of the statement>>
- Note 1: This query can be used for getting the count of uses in qualifiers for properties that are instances of Wikidata qualifier or any of its sub classes. This query is similar, but the class taken into account is Wikidata property to indicate a source and it counts the uses in references.
- Note 2: I used "View page source" and noticed that claims in qualifiers and claims in sources are assigned an identifier. However, this information is stored in
class=""
tag in HTML, but not inid="..."
tag in HTML in as occurs for statements. I wonder how we could create a direct link to a use of a property in a qualifier or reference given the current mentioned state. I also wonder how this link would be stored when the claim belongs to a reference node that is used in multiple statements. - -- Rdrg109 (talk) 01:59, 6 December 2022 (UTC)
- Is there any way, this property could be generalized to point to claims in qualifiers or claims in references so that we can also use it for linking to examples for properties which are intended to be used in qualifiers or references?
- The parent statement is relevant when seeing an example usage of a qualifier or reference so I would think this wouldn't be important. Lectrician1 (talk) 14:31, 6 December 2022 (UTC)
Comment The proposed property label, description, and example 1 say that this is a statement id, however that won't work with the proposed formatter URL. Examples 2 and 3 use Qid#Statementid instead, which works with the formatter URL but then this can't be called a statement id. That formatter URL requires a non-standard value that duplicates the Qid that it is at the beginning of the statement id, which makes it error-prone and difficult to label and use. A formatter URL on https://wikidata-externalid-url.toolforge.org/ could potentially work with simple statement ids, although routing through another site to get from one Wikidata statement to another isn't a particularly clean solution. –LiberatorG (talk) 07:03, 6 December 2022 (UTC)
- Ohhh thank you. I think "Allowed values" and a better formatter URL should fix this? Lectrician1 (talk) 14:22, 6 December 2022 (UTC)
- Actually, no, you're right. We'd need to use https://wikidata-externalid-url.toolforge.org/. Lectrician1 (talk) 14:24, 6 December 2022 (UTC)
Strong oppose This makes the examples harder to consume for other applications/data consumers and such statement IDs are also likely to break e.g. when a statement is removed and added back again. Besides examples are part of the documentation for a property and changes to examples should be in the page history of the property. Also this would let you change the examples of properties without people that are watching the property being made aware of that change in their watchlist. All in all just a terrible idea. Sidenote: I also oppose the idea of a "Wikibase statement" datatype for the same reason. --Push-f (talk) 08:17, 6 December 2022 (UTC)
- @Push-f The reason it's important that the property example statement actually exists is that then we know that the statement is an actual example of the property being used correctly. If the example still on the property but not on the item, well then how do we know if the example is correct? We don't. Then people are confused and the property examples become meaningless.
- You end up with situations like this when:
- Property creators don't put down property examples because they don't want to (this property would solve this)
- Property creators put examples on the item but not example statements on the examples (this property would solve this)
- Someone deletes a property example on the example item because its no longer valid or there's another, better property (this property would solve this because the property examples could be automatically updated and the people who watch the property would see this change).
- This makes the examples harder to consume for other applications/data consumers
- I would think this would be easier and ensure the example is actually valid for the above reasons. API users would just need to call
wbgetclaims
with the statement ID. They would then get back a statement whose value and qualifier snaks are the actual values and qualifiers and wouldn't have to make a conversion system to get back a proper example statement. - such statement IDs are also likely to break e.g. when a statement is removed and added back again
- Yes, I also realize this concern. My gadget will have a warning if a user edits or deletes a statement that is used as a property example. Really, if the property is being used correctly as an example, someone shouldn't have a reason to delete it. If someone does delete it, then at least people who watch the property will know when the statement is automatically removed from the list of examples.
- Besides examples are part of the documentation for a property and changes to examples should be in the page history of the property.
- Examples would still be part of the page history...
- Also this would let you change the examples of properties without people that are watching the property being made aware of that change in their watchlist.
- If you change the value of a property, that change will show up in your watchlist... Lectrician1 (talk) 14:19, 6 December 2022 (UTC)
- I agree that the current situation is suboptimal but I still strongly oppose outsourcing the examples because they really should be part of the property page.
- Changing the values of a claim does not change the hash, so you could easily change the showcased examples for a property to something the property is not intended for without anybody who's just watching the property page to notice. You cannot track how examples changed over time ... you cannot even reliably see examples from a year ago because
wbgetclaims
only works for claims that are currently present. - The proper way to implement this would be to store the JSON encoding of an example as a string. Storing claim IDs is a bad idea. --Push-f (talk) 04:27, 23 December 2022 (UTC)
Weak support I agree that is a complex question, but I like the idea in principle. Even if it is not created, a gadget for ~3 random examples of property usage could be useful. TiagoLubiana (talk) 14:15, 14 December 2022 (UTC)
Support I always thought the way examples were added to properties is somewhat weird; I think this is the right way. --Tinker Bell ★ ♥ 07:13, 20 December 2022 (UTC)
@Rdrg109 @LiberatorG @Push-f @TiagoLubiana @Tinker Bell. I have updated the gadget. Please see the video above in Motivation. It is multilingual, shows if a statement ID is not valid, and can change the example statement shown when the example statement ID is changed. It supports showing statements for every example on a property. Lectrician1 (talk) 18:57, 22 December 2022 (UTC)
- This may be URL datatype to allow linking to statements in Commons.--GZWDer (talk) 01:31, 9 January 2023 (UTC)
Question Should the name of the property perhaps be something like “model-statement ID”? An analogy with model item (P5869) and model lexeme (P11464) suggests itself. Otherwise,
Support. ―BlaueBlüte (talk) 09:26, 31 January 2023 (UTC)
Withdrawing. @User:Push-f brings up some great points. The inability to control examples being changed or see past examples is a big downside. To solve the annoyances I originally had that motivated me to propose this property, I am going to at some point create a userscript that:
- Allows users to easily add statements as examples to properties with the click of a button.
- Reformats qualifier property examples so that they are understandable.
- Shows a warning on a property example if it does not exist or is different on the example item being used.
When done, this userscript could become a gadget so that it is available to everyone. Lectrician1 (talk) 06:04, 20 March 2023 (UTC)