Wikidata Map in 2024

This entry is part 16 of 17 in the series Wikidata Map

Another year on from the last generation of the Wikidata map, @tarrow and @outdooracorn spent some time in preparation for the Wikidata birthday to prepare a new map (see git commits).

The latest images have already been uploaded to Wikimedia Commons, and appear in the Wikidata map commons gallery.

In this post, I’ll have a look at what has changed in the past year that is visible from the map!

Read more

Toit: Infinite resilient application loops (try “catch”)

Toit is a modern high-level language designed specifically for microcontrollers. I’m spending some time at work making use of it these days, and as it’s a younger language, there are not as many resources out there in comparison to others.

In Toit, you could write a very simple hello world application with the following code…

main:
    print "Hello world"Code language: PHP (php)

Say you wanted to get a new name from an external package to say hello to, you might do the following, which would call the method names.next, which can return a string, and print it to the user.

import somePackage show names

main:
    print "Hello world $names.next"Code language: JavaScript (javascript)

To do this in a loop every second, your code might look something like this…

import somePackage show names

main:
    while true:
        print "Hello world $names.next"
        sleep --ms=500Code language: JavaScript (javascript)

If you wanted two separate tasks running with their own control flows, you might make use of tasks, and a second loop.

Read more

Visualizing Wikibase connections, using wikibase.world queries

This entry is part 1 of 3 in the series Wikibase ecosystem

Over the past week I have spent some time writing some code to start running a little bot on the wikibase.world project, aimed at expanding the number of Wikibases that are collected there, and automating collection of some of the data that can easily be automated.

Over the past week, the bot has imported 650 Wikibase installs that increases the total to 784, and active to 755.

I mainly wanted to do this to try and visualize “federation” or rather, links between Wikibases that are currently occurring, hence creating P55 (links to Wikibase) and P56 (linked from Wikibase).

251 Wikibases seem to link to each other, and Wikidata is very clearly at the centre of that web.

Read more

READ FIRST: Installing kubuntu-desktop on WSL2

This post is meant as a warning, DONT DO IT, without some research first.

But if you end up here, you have likely already made the mistake ;)

It in this case is, “this” is…

sudo apt install kubuntu-desktop

Before you attempt this, do some reasearch, head the warning, and be casefull (maybe even backup your disk so you can undo the mess if you make it ;).

If you have already done this and partially bricked your Ubuntu installation, don’t worry, you can fix it!

Symptoms

  • apt, dpkg, service commands and more basically unresponsive and hanging
  • Extremely slow boot times
  • System never seems to entirely boot correctly
  • sudo su etc might also not work

Read more

2 years of wikibase.cloud by WMDE

It’s been somewhere between 2 and 3 years since WMDE took over WBStack, turned it into wikibase.cloud. During this time, my techy focus has slowly shifted away from the world of Wikibase, though I still enjoy following along and working on other Wikimedia areas.

Here I will ramble on about what I saw in terms of potential for wikibase.cloud within the Wikibase ecosystem, as well as what developments have happened within the past years.

The initial problems, goals and dreams

From An introduction to WBStack, I said:

The idea behind the project is to provide Wikibase and surrounding services, such as a blazegraph query service, query service ui, quick statements, and others on a shared platform where installs, upgrades and maintenance are handled centrally.

Now, this is fairly obvious, and clearly something that wikibase.cloud still offers today, however I didn’t write why!? And this is potentially something that has gotten lost through the years of multiple PMs, multiple engineers, multiple project names etc.

Read more

Cloudflare workers for wikibase.cloud uptime & status

Recently I wanted to create a live status page for wikibase.cloud, that also tracking the status of the various services and response times, so that people in the Telegram group might be able to try and correlate their experiences (possibly slow behaviour) with what was seen by others in other locations on other sites, without needing to message in the Telegram group.

In a way, this could be seen as an iteration on the current status page for the service, which is maintained as a static site on Github, making use of cState, a static status page.

Screenshot of the current status page

I initially chose to experiment with Cloudflare Workers to do the minutely checks, after looking around at the current offerings for free online code running (thinking Heroku style etc).

Why Workers?

Read more

Reading from USB COM port in go

If you want an easy copy and paste, no nonsense way to print the output of a COM PORT to the terminal in go, then have a look at the code at the bottom of this post.

Firstly, the go.bug.st/serial/enumerator package provides a very nice interface for getting details of connected devices, and includes more details than the example code in go.bug.st/serial that I found first time around.

Thanks to the toit devs for being responsive and helping me quickly figure out how I could make my ESP spit some USB content out over the COM port.

The code

In a nutshell is this:

  • Loops forever
  • Targets a specific device ID, such a 1a86:7523
  • Waits for it to appear as connected
    • Uses baud rate 115200
    • Opens the port
    • Prints all output received to the console

Read more

WSL2 COM port pass-through with usbipd (firewall issues)

I’ll start by saying that ultimately you want to read and follow the Connecting USB devices documentation for WSL.

However, a few things cropped up along the way that I think might be worth writing down for future me, and others.

Requirements

Firstly, you need to be on WSL2.

Next, install the USBIPD-WIN program.

winget install --interactive --exact dorssel.usbipd-winCode language: CSS (css)

Listing devices

In windows cmd or powershell, you can use usbipd list to list all devices. This should line up with what you see in Windows device manager if you open it.

Read more

Wikibase Phrase Entity, Viewing

This entry is part 7 of 7 in the series Wikibase Entities

In my previous post, we got to the point of being able to create a new Wikibase Entity, it is stored in the MediaWiki database as a page, however we can’t actually view it via any interface currently.

In this post, we will work through another set of code changes, tackling each issue as we see it arise, until we can see the entity represented in the various places that users might expect.

Viewing the page

The provided entity serialization is neither legacy nor current

When clicking on one of the links on Special:RecentChanges to a phrase page that we have created, we get our first error.

/wiki/Phrase:Phrase66900b01937842.29097733 MWContentSerializationException: The provided entity serialization is neither legacy nor current
from /var/www/html/w/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php(253)Code language: JavaScript (javascript)

The full stack trace is a little large, but you can find it in a paste bin.

This error is very similar to an issue we saw in the creation blog post, but this time the codec class can not deserialize what we have stored in the database, as we have not registered a deserializer for phrases.

Adding a deserializer to the entity registration file is very simple:

Read more

Wikibase Phrase Entity, Creation

This entry is part 6 of 7 in the series Wikibase Entities

Finally, after a long lead up of discussing what an entity is, looking at some examples of entity extensions, and one extension that chose not to make use of the Wikibase Entity system & EntityDocument. What does it take to create a new type of data entity within Wikibase that implements the EntityDocument interface and makes use of the various integrations that have evolved over the past 10+ years?

I slapped together a very rough branch exploring this in 2022, but it’s hard to follow at best, and doesn’t really discuss any of the challenges that crop up along the way. This post, and those following are the redo, with much more context. And with any luck, it will work mostly as before (as Wikibase hasn’t changed much internally when it comes to how Entities are handled in the last 2 years)

If you want to follow along, you’ll need a development environment, and for that I would recommend the mwcli walkthrough that I wrote in the past weeks.

Where to start

I have a slight advantage here, as the closest thing that comes to documentation around how to add a new entity type to Wikibase is the documentation of the various fields that make up the entity registration system.

Beyond that, your only way in would likely be to start looking at one of the extensions that already provides an additional entity type, such as WikibaseMediaInfo, and the entity type registration that it makes. But each of these extensions come with their own complexity to muddle your view.

Read more