OCS and KDE Forums – work continues

With my last entry, I announced the start of the work for an OCS library for the KDE Community Forums. Today I’d like to blog again about the recent developments.

First of all, now there isn’t one, but two Python modules:

  • ocslib, a pure Python module that can be used to interface with OCS-based forum systems;
  • ocslibkde, a PyKDE4 based module that can be used to interface with OCS-based forum system in KDE applications.

Currently ocslib supports reading and posting, while ocslibkde only reading (as of now). Both can be retrieved from the kde-forum-mods repository under the ocs-client subdirectory. The Python lib needs unit-testing, then I’ll be able to push a tarball soon for people to test (but you can always check out the Git repository). With regards to the PyKDE4 library, I plan on making a proof-of-concept plasmoid soon that shows how to use the API.

Speaking of API, here are some examples using ocslib:

>>> from ocslib import service# Connect to OCS
>>> ocs_service = ocslib.service.OCService("http://www.example.com")
#Retrieve all forums
>>> forums = ocs_service.list_forums()
# Elements have attributes for name, posts, etc.
>>> print forums[0].name
"Test forum"
#Retrieve threads for forum 15
>>> threads = ocs_service.list_forum_threads(forum_id=15)
# Retrieve thread 8945 from forum 15
>>> messages = ocs_service.show_thread(forum_id=15, topic_id=8945)
>>> print messages[0].text
"Hello world!
#Post to a forum - requires authentication
>>> ocs_service = service.OCService("http://www.example.com", username="foo", password="bar")
>>> message = "Hello, KDE people!"
>>> subject = "Test message"
>>> ocs_service.post(forum_id=15, subject=subject, message=message)
True # Return code of operation

Feedback (especially on the API) welcome!

Open Collaboration Services and KDE Forums

For KDE developers, web-based forums are often uncommon workflows. Indeed, for communication among developers mailing lists are much better tools, especially since you can handle everything inside a client (most of the time), compared to forums where you have to use a web browser. The ways of reading, replying and interacting with posters are dramatically different. And that is why some developers find themselves uncomfortable with the KDE Community Forums.

A dedicated application would be usually much better than a browser, because you can work around the intrinsic limitations of the browser itself. The problem is that you can’t really access a forum with anything else than a browser. That is, it used to be like this, but now things are changing.

In the past months fellow administrator bcooksley has been working quite hard implementing the Open Collaboration Services (OCS) specification in the KDE Community Forums. For the uninformed, it’s the same API that powers OpenDesktop.org and related web pages. This means that you could access the forum contents programmatically using a REST API and parsing the XML that is returned by the service.

Unfortunately, bcooksley had no time to implement a client that would make use of this newly-made service.

That’s where I stepped in. This morning I committed in the kde-forum-mods repository the first implementation of a backend to access the forums’ OCS service. Currently it’s extremely basic – just a few classes to wrap the XML responses into decent data representation, and a basic class to perform reading requests: that means that technically it is possible to request forum listings, thread listing, and posts. I’m still working on the ability of replying and posting messages.

Being a Pythonista, the backend is written entirely in Python: currently it uses the standard library plus dateutil and lxml to do its bidding, but the next steps would be to turn it into a PyKDE4 library to access all the KDE related goodness (hello, KIO!). Bear in mind that currently there is no application using this: I merely completed (part of) the backend.

If you’re interested, the code can be found on gitorious.org, in the ocs-client directory, branch experimental, inside the kde-forum-mods repository.

What’s cooking at the KDE Community Forums?

In the past weeks and days, the KDE Community Forums staff has been working to bring new features to improve even more the user experience. A few months ago, the staff was discussing the idea of finding a way to guide users to the most appropriate forum to post their questions or discussions. Now, thanks also to the return in service of one of our admins (welcome back, sayakb!) the feature is now being implemented, as the screenshots below will show.

Bear in mind that everything for now is running on a testing server, to make sure it doesn’t break anything. Once the tests and the implementation are complete, we’ll integrate the feature in the forums. How soon we are not sure, but it won’t be too long.

"Help me post a topic"

Upon logging in, you will be greeted by a new "New Post" button:

You can either click on the arrow to quickly post an idea for Brainstorm, a new discussion, access the "getting started" forum or contact the staff:

Or if you just click on the button itself, you access the guided post section:

The "Share an idea" and "Chat and discuss" buttosn will bring you to the relevant forums (Brainstorm and Discussions and Opinions), while "Ask a question" will bring about an additional screen:

You’ll be able to select your favorite application and you’ll be able to post directly in the relevant forum.

Open Collaboration Services

But that’s not all. Thanks to the hard work of Ben Cooksley (fellow admin and System Settings maintainer) there is also an implementation of the Open Collaboration Services (OCS), the same system that powers the well-known Get Hot New Stuff connected to OpenDesktop.org. This will mean, in principle, that you could access forum posts and discussions in a programmatic way, using a REST API. This opens up possibilities like Brainstorm plasmoids, other means to access the forum (like an Akonadi resource – there’s some ongoing work in KDE SVN). If you’re interested in testing the OCS for the forum (or if you want to develop some kind of application that ties to the forums themselves), let us know on IRC (#kde-forum on freenode).

Akademy: my own BoF

I'm going to Akademy 2010 image

My Akademy talk proposal was not accepted, but the organizers were kind enough to offer me the chance to hold a BoF on the same subject. Now I bet you wonder on what I’m going to discuss, and I think the title already gives you an idea:

KDE and bioinformatics: the missing link

Although in the KDE community we have our fair share of scientists (hey there, Stuart!), my BoF will focus on the adoption of KDE in the field of bioinformatics (my day job, not-so-by-chance) on the "outsiders" front and how to improve the current situation. To elaborate further, bioinformatics is a rather broad field where biological data are treated with computational methods. The oldest and most famous branch of bioinformatics is sequence analysis and related field, where sequences of DNA are analyzed, for example, to find common ancestors among several species, or to reconstruct the genetic code of an organism by comparing it to a related species. Another recent example is related to high-throughput technologies, technologies which produce huge amounts of data from a very small number of experiments ("ultramassive sequencing" and DNA microarrays are examples of such a technology).

Either way, bioinformaticians have to deal with large amounts of data all the time, and usually there’s no "shrink-wrap" solution to the problems they have to face, software-wise. That’s because we do research, so we need to find something new. So the solution is often to write algorithms, or re-implement existing ones in a form that is suited for the tasks at hand. So, bioinformaticians also write software, although they’re by no means (usually) professional coders: some have a mathematical or statistical background, others (like me) come from an experience at the lab bench. What kind of programs bioinformaticians write? Normally scripts and small stuff, but in certain cases even full blown-algorithms and applications. Some become so famous that are even trend-setters.

Which brings us to the heart of the matter: how does KDE stand in all of this? Sadly, not too well. I’ve done some research in the published literature, but there’s just one hit returned that’s proper: a KDE application for neuroscience (based on the 3.5.x Development Platform) published in 2008. I know that big research places like CERN use KDE, but to my knowledge smaller realities such as research group code in the majority of the cases for Windows or for web-based solutions. Given that at least a signficant portion of bioinformaticians uses UNIX-like operating systems, the question we need to answer is: why?

The first and foremost problem is related to market share. Research groups don’t even know that KDE exists, so it’s unlikely they develop something using the Development Platform (even now that’s becoming more cross-platform). This is where some promo efforts could help. Secondly, the problem lies in the "difficulty" (notice the quotes!) of developing using the KDE Development platform: most bioinformaticians, as I wrote, are not professional coders, and few of them know C++. The most used languages in bioinformatics are Perl and Java (with some Python and Ruby thrown into the mix). Thus, the need for proper bindings. The bindings are there, thanks to the excellent work of the kde-bindings team, but documentation is still lacking (namely in the examples department, but also in tutorials and getting started guides that aren’t aimed at C++). Some documentation is auto-generated, and while the KDE API docs are usually not too hard to read, they can still scare off newcomers. Of course this is not the fault of the kde-bindings team: namely, more help is needed.

Promo efforts and better bindings are the keys to spread KDE more in the field of the bioinformatics. This is what my BoF is about, plus an informal discussion on the use of FOSS in academia and related matters.

Interested? If you are, you can come to the BoF which will be on Tuesday, 6th July at 15.00 in the Area 2 of the main room at Demola.

I’ll also be around later till the following morning (sadly, two days is the best I can do to attend) in case you’re interested for a chat.