User talk:ElanHR/Proposals/Schema for describing templates and their fields

Hi all,

At WikidataCon 2019 (Q42449814) there was a breakout session where we discussed ways to use Wikidata schema to better structure templates as well as the mappings between template fields and the relevant Wikidata property (Q18616576) where one exists. Currently there are a few different efforts already working this - Harvestbot templates, DBpedia, etc. - however this information is stored across various locations and formats. This new schema would help coordinate efforts and increase visibility by putting this information in a central easily accessibly place - i.e. the Wikidata item for the template.

I've written up the main takeaways from the session as a proposal for new schema and wanted to open up discussion on the high level design to the broader community before submitting individual property proposals. :)

Cheers,

ElanHR (talk) 07:34, 13 November 2019 (UTC)Reply

Good catch I've fixed the mislabeled link.
By schema I mean new properties and how to use them - for the latter I think creating a ShapeExpression for these templates would be a perfect way to formalize these semantics.
This is a related but parallel effort to Wikidata Bridge. The main difference is scope, Wikidata Bridge will allow users to edit Wikidata-driven infoboxes directly on Wikipedia whereas this effort will initially aim to describe existing semantics of old-style (non-wikidata) templates. Once Wikidata Bridge is launched the label-property mappings for these new templates could also be described using this schema for consistency. ElanHR (talk) 16:19, 13 November 2019 (UTC)Reply
  • One issue that may or may not be relevant, depending on exactly what you're thinking of doing, is that a single Wikidata item may sitelink to templates on several different Wikipedias and/or sister projects, that may correspond in terms of subject, but not necessarily in terms of structure and arguments. (But where the sitelinks between them may be valuable to maintain nevertheless).
So any links from Wikidata items to your schemas (once we have that ability) may require a large number of applies to part (P518) = "xyz-wiki" qualifiers; which may impact on the readability of the item for the template. Jheald (talk) 10:56, 13 November 2019 (UTC)Reply
My original thought in order to reduce the need for applies to part (P518) statements was to use monolingual text (Q21044568) as the value to describe template argument keys. That said applies to part (P518) statements may still be required in some situations, primarily when sister projects are in the same language (e.g. English Wikipedia (Q328) and Simple English Wikipedia (Q200183)) and use the same key to describe different semantics.
I don't think templates having different arguments across wikisites is too much of an issue as not every property needs to have a field in every language. For instance in the officeholder example, only EN has a label for honorific prefix (P511) and indeed has more than one label for position held (P39). ElanHR (talk) 16:19, 13 November 2019 (UTC)Reply
  • This would only allow direct properties to stored. If a template needs an inverse relationship or other queries to fill it's values, the proposal doesn't allow that information to be expressed.
The proposed semantics don't tell the user whether or not the template is Wikidata driven or isn't. It might be valuable to find semantics that contain that information. ChristianKl10:13, 13 November 2019 (UTC)Reply
Correct, I think these more complicated relationships should be out of scope for the first iteration. Fortunately my impression has been that direct properties (and their qualifiers) should cover the majority of cases and can help identify the more complicated type of mappings that you describe.
I agree it would be useful to mark Wikidata-driven templates (e.g. Template:Infobox book/wikidata (Q51477100)instance of (P31)Wikidata-driven Wikimedia template (Q74980542) where Wikidata-driven Wikimedia template (Q74980542)subclass of (P279)Wikimedia template (Q11266439)). ElanHR (talk) 07:06, 14 November 2019 (UTC)Reply
It seems to me that what's Wikidata-driven is specific to individual fields on specific Wikipedia version. ChristianKl17:10, 19 November 2019 (UTC)Reply
Definitely, this is why the *LOCALE_SPECIFIC_KEY* property would take monolingual text as its value. This would allow these field labels to be specific to a wikisite/language. An existing example of such mappings can be found here Wikidata:WikiProject_Movies/Tools#Wikipedia_infobox_mapping. ElanHR (talk) 03:18, 24 November 2019 (UTC)Reply

TemplateData and translating a template documentation edit

Mediawiki TemplateData can be used to translate a template documentation. The worst: you have to copy from a Wikipedia to another Wikipedia, to see the documentation in the destination language.

I have done it in Wikipedia Template:Short description. I have translated the TemplateData from English to Spanish (you can edit TemplateData and select "español" -this is, Spanish- to see the translation into Spanish).

The problem: I have to translate the template documentation (TemplateData of the template) in the English Wikipedia and copy and paste it into the documentation page o f the template in the Spanish Wikipedia.

This is not good. The best idea is that I could see the translation in the Spanish Wikipedia, without copy and paste, in a Wikidata manner (global documentation from TemplateData).

Also, this translation into Spanish could be seen in Wikibooks in Spanish, Wiktionary in Spanish and so on, without copy and paste the TemplateData from the English Wikipedia to Wikibooks in Spanish, Wiktionary in Spanish and so on.--BoldLuis (talk) 11:01, 15 March 2021 (UTC)Reply

Return to the user page of "ElanHR/Proposals/Schema for describing templates and their fields".