WMDE-leszek added a comment.

Disclaimer: In this comment I exclusively focus on technical/Wikibase as a software aspects of the topic. I am entirely opaque to what might be good or not so good social/community process additions to what the software allows/provides.

Thinking about the problem at hand (Commons case), the possible (though not certain) future needs of WMF wikis, and the needs we've collected from non-WMF Wikibase instances , and having my brain melted multiple times I came with the following:

It seems there are two problems that Wikibase tries to solve with prefixes/federation:

  1. Being able to use/reference entities from other Wikibase instances (e.g. Commons using items/properties from Wikidata, or FactGrid using properties from Wikidata)
  2. Being able to, within a Wikibase instance, mix entities of a particular type coming from multiple sources (ie. Wikibase instances - potential example of this would be FactGrid using Wikidata items, but also have their own, Fact-Grid specific items.

In my understanding, what 1 needs is to be able to access other wikis database (either through direct DB access, or through some more sophisticated API), and 2 could be solved by prefixes as the way to disambiguate identifiers.

The existing code, which is now causing trouble, is imperfect in the sense that, while trying to solve both tasks 1 and 2 at the same time, it seem to be giving to much importance to prefixes, and specifically it makes the empty/no prefix somehow special and bound the "local" database.

That would be it for stating the obvious.

Instead of trying to bend the existing code to work for Commons and hopefully for other future uses, I tried to take a step back, and was thinking about solving those two challenges kind of separately.
The idea I'd like to hear comments from @daniel, @Addshore and others about would be the following:

  • forget about the currently implemented prefixes, repositories, special '' prefix etc
  • As a first step implement the possibility to configure Wikibase to read entities from different "sources" (for now only using different DBs accessed through MW DB code)
  • As a next step (not required for SDoC), implement the possibility to allow using entities of type X coming from multiple sources. To differentiate IDs prefixes would be used.

Without I doubt I have a limited perspective so I might be missing some important use case. Please point out wholes in the plan above.
I am aware I might be simply suggesting to do https://xkcd.com/927/ here, the plan outlined above might be a viable:

  • It would allow Commons define MediaInfo without needing to change any existing pages, templates etc on Commons which refer to P123 and Q456 already
  • It would leave the topic of prefixes/disambiguation for the second implementation phase, meaning faster unblocking SDoC features
  • Adding prefixes as a second step would be still fulfilling needs of wikibase instances that e.g. want to use both Wikidata and own items.

As we have spent quite some time talking about the configuration, and how clumsy it is now, this is how potentially this all would be configured in pseudo JSON if the "entity sources" and "prefixes" concept got split.

Configuring different sources of entities:

...
"entitySources": {
    "item": {
        "database": "wikidatawiki",
        "namespaceId": 120,
        "conceptUriBase" : "http://wikidata.org/entity/"
    },
    "property": {
        "database": "wikidatawiki",
        "namespaceId": 122,
        "conceptUriBase" : "http://wikidata.org/entity/"
    },
    "mediainfo": {
        "database": false,
        "namespaceId": 777,
        "conceptUriBase" : "http://commons.wikimedia.org/entity/"
    },
}
...

And once the multiple source for entity type functionality is implemented, the config could for example look along the lines of (with of course some B/C code handling the single-source kind of config too)

...
"entitySources": {
    "item": [
         {
            "prefix": "",
            "database": "wikidatawiki",
            "namespaceId": 120,
            "conceptUriBase" : "http://wikidata.org/entity/"
        },
    ],
    "property": [
        {
            "prefix": "",
            "database": "wikidatawiki",
            "namespaceId": 122,
            "conceptUriBase" : "http://wikidata.org/entity/"
        },
        {
            "prefix": "commons",
            "database": false,
            "namespaceId": 555,
            "conceptUriBase" : "http://comons.wikimedia.org/entity/"
        },
    ],
    "mediainfo": [
         {
            "prefix": "",
            "database": false,
            "namespaceId": 777,
            "conceptUriBase" : "http://commons.wikimedia.org/entity/"
        }
    ]
}
...

It should be possible to provide some rough estimates on timeline of implementing this, but I would not like to use it as a means of choosing between options. I would like to be certain we are about to build the right thing before we get into discussing timelines and see what could be the minimum version to account for deadlines etc.

Thoughts?


TASK DETAIL
https://phabricator.wikimedia.org/T211800

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: WMDE-leszek
Cc: Smalyshev, Lydia_Pintscher, Addshore, MarkTraceur, WMDE-leszek, Cparle, Jdforrester-WMF, Abit, EBjune, Ramsey-WMF, Aklapper, daniel, Nandana, JKSTNK, Lahi, PDrouin-WMF, Gq86, E1presidente, Anooprao, SandraF_WMF, GoranSMilovanovic, QZanden, Tramullas, Acer, LawExplorer, Silverfish, Poyekhali, _jensen, D3r1ck01, Susannaanas, Wong128hk, Jane023, Wikidata-bugs, Base, matthiasmullie, aude, El_Grafo, Dinoguy1000, Ricordisamoa, Wesalius, Fabrice_Florin, Raymond, Steinsplitter, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to