Hi, I would like to implement a new property type for my project. Are there any examples of extensions that add new prop types to wikibase?
I already implemented most of what I need by changing wikibase code, but I doubt a property to store multiline code snippets will be accepted into wikibase at this stage, so it has to be done as an extension. Any suggestions would be appreciated.
Note that I had to change two repos:
https://github.com/nyurik/mediawiki-extensions-Wikibase/pull/1/files
https://github.com/nyurik/data-values-value-view/pull/1/files
WikibaseLexeme https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseLexeme/ and WikibaseMediaInfo https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseMediaInfo/ are two extensions that add new entity types, including datatypes for those entities. I suspect that WikibaseMediaInfo might be easier to look into – in WikibaseLexeme, the extension registration is complicated a bit by the fact that the extension has to be installed on client wikis as well, but only the client parts, not the repo parts, whereas WikibaseMediaInfo doesn’t have this issue.
Several other extensions add new datatypes (but not entity types): at least Math https://gerrit.wikimedia.org/g/mediawiki/extensions/Math/, Score https://gerrit.wikimedia.org/g/mediawiki/extensions/Score/, Kartographer https://gerrit.wikimedia.org/g/mediawiki/extensions/Kartographer, I believe.
I’m not aware of any extensions that add new datatypes and are specifically intended to be used as examples or building blocks for your own extensions.
Cheers, Lucas
On 30.05.20 17:52, Yuri Astrakhan wrote:
Hi, I would like to implement a new property type for my project. Are there any examples of extensions that add new prop types to wikibase?
I already implemented most of what I need by changing wikibase code, but I doubt a property to store multiline code snippets will be accepted into wikibase at this stage, so it has to be done as an extension. Any suggestions would be appreciated.
Note that I had to change two repos:
https://github.com/nyurik/mediawiki-extensions-Wikibase/pull/1/files
https://github.com/nyurik/data-values-value-view/pull/1/files
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Lucas, thanks for the links!
It seems none of the overriding extensions implement the "expert mode" -- allowing custom javascript editor. I was able to do what I need with this tiny extension -- https://github.com/nyurik/ThatSrc https://github.com/nyurik/ThatSrc/blob/master/modules/MultilineTextValue.js#L33 , but in order to get the proper server-side validation, I still had to add the word "multiline" to the dataTypeParserIDs array
see https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/94544f0ec34e...
Is there a way to dynamically register my own data type parser? The goal is to have a full blown ACE editor instead of a simple string value for my property.
Thanks!
On Sat, May 30, 2020 at 5:56 PM Lucas Werkmeister mail@lucaswerkmeister.de wrote:
WikibaseLexeme https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseLexeme/ and WikibaseMediaInfo https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseMediaInfo/ are two extensions that add new entity types, including datatypes for those entities. I suspect that WikibaseMediaInfo might be easier to look into – in WikibaseLexeme, the extension registration is complicated a bit by the fact that the extension has to be installed on client wikis as well, but only the client parts, not the repo parts, whereas WikibaseMediaInfo doesn’t have this issue.
Several other extensions add new datatypes (but not entity types): at least Math https://gerrit.wikimedia.org/g/mediawiki/extensions/Math/, Score https://gerrit.wikimedia.org/g/mediawiki/extensions/Score/, Kartographer https://gerrit.wikimedia.org/g/mediawiki/extensions/Kartographer, I believe.
I’m not aware of any extensions that add new datatypes and are specifically intended to be used as examples or building blocks for your own extensions.
Cheers, Lucas On 30.05.20 17:52, Yuri Astrakhan wrote:
Hi, I would like to implement a new property type for my project. Are there any examples of extensions that add new prop types to wikibase?
I already implemented most of what I need by changing wikibase code, but I doubt a property to store multiline code snippets will be accepted into wikibase at this stage, so it has to be done as an extension. Any suggestions would be appreciated.
Note that I had to change two repos:
https://github.com/nyurik/mediawiki-extensions-Wikibase/pull/1/files
https://github.com/nyurik/data-values-value-view/pull/1/files
Wikidata mailing listWikidata@lists.wikimedia.orghttps://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata