Wikidata:Property proposal/Wikidata property example statement ID

From Wikidata
Jump to navigation Jump to search

Wikidata property example statement ID[edit]

Originally proposed at Wikidata:Property proposal/Generic

   Withdrawn
DescriptionID of a statement that is an example of this property being correctly used
Data typeExternal identifier
Domainproperty
Example 1CVX vaccine code (P10876)Wikidata property example statement IDQ798309$59194e8f-4bec-3e80-b72c-06efea30532f
Example 2CVX vaccine code (P10876)Wikidata property example statement IDQ4007170$e9e18d81-45f9-8eb4-8283-3b584ec1576f
Example 3CVX vaccine code (P10876)Wikidata property example statement IDQ18388297$50654082-4cde-b427-a70b-af84bd7b6e58
Formatter URLhttps://www.wikidata.org/wiki/$1
Wikidata projectWikiProject 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:

  1. 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.
  2. Users can see qualifier property examples better.
  3. 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.
  4. When we eventually have a statement property data type, we can easily switch this property's values over to it.
  5. 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)[reply]

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: <<QID>>$<<ID of the statement>> 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.
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 in id="..." 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)[reply]
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)[reply]
  •  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)[reply]
    @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:
    1. Property creators don't put down property examples because they don't want to (this property would solve this)
    2. Property creators put examples on the item but not example statements on the examples (this property would solve this)
    3. 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)[reply]
    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)[reply]
  •  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)[reply]
  •  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)[reply]

@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)[reply]

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:

  1. Allows users to easily add statements as examples to properties with the click of a button.
  2. Reformats qualifier property examples so that they are understandable.
  3. 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)[reply]