Hi Jeroen,

Sorry about the late response...

On Fri, Sep 6, 2013 at 11:47 AM, Jeroen De Dauw <jeroendedauw@gmail.com> wrote:
Hey,

While looking at the source of the pywikipediabot in the past, I noticed that it contained a bunch of Wikibase specific code (sometimes even Wikidata specific). The code I saw often did a poor job at separating different concerns, and did some weird things to represent parts of the Wikibase data model.

Right now I think our biggest issue is that Claim subclasses PropertyPage. I originally wrote this thinking it would be convenient, but now after using the code for a while, the only function we actually use is PropertyPage.datatype(), which can easily be fixed. I'll start working on that.

We've tried to keep most of the Wikidata-specific code in the family files, like storing globes in the Wikidata family file. If there's any more of that, we should fix it.

I figured it'd be a lot nicer if there was a clean and correct implementation of the Wikibase data model that can then be used by pywikipediabot, and other Python projects that need to interact with a Wikibase instance. I went ahead and created what is essentially my first ever Python project [0] to do exactly this. (This is far from fully implemented, and only linked to here to give you an idea of what I am talking about.)

I took a look at your code and while it probably is technically correct, I think it adds a level of complexity that we as bot developers don't actually need. For example, we have no need to have different item and item_id classes, they really are basically the same thing for us.

Since I'm not following pywikipediabot development closely, I'm not aware of how much interest there is for having such a component. I'm also not sure on what exactly would need to be implemented to serve the needs to the pywikipediabot codebase, or on how to proceed to then starting with the refactorings required to make use of it.

What is essentially needed for this to go forward is a pywikipediabot developer that takes charge of this project. If that happens I'll happily make the contributions required to ensure the data model implementation is done both correctly and cleanly.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--


--Legoktm