Making Location-Based Timelines With Wikipedia, Wikidata, and Mojeek

Making Location-Based Timelines With Wikipedia, Wikidata, and Mojeek

I started learning JavaScript in Mayish 2022. I wanted to make tools to address some of the things I disliked about Google search, and after looking around it seemed like JavaScript was the best solution. So I signed up for a course, thrashed and flailed my way through 50 of the 59 lessons, and then went off to apply knowledge.

You would probably laugh if you knew how difficult it was for me to wrap my head around some of JavaScript’s concepts. Like okay, you’ve fetched the data, you’ve logged it to console, so how do you get it out of console? That feels like a very dumb question now, but I can also see how I was overthinking, acting like the data was a physical object that had been delivered to some outbuilding and I had to go get it.

In the last six months or so I’ve gotten enough knowledge under my belt that I’m more willing to spend time “doodling” with JavaScript. Before I waited until I had a solid idea of the program I wanted to make, I figured out what I had to do and wrote down all the steps, and I built it. Now I’ll run an API call, look at the returned object, play with analyzing it, experiment with hooking it up to other things, add this bit, remove that bit, and basically scribble until I make something that looks interesting. Then I try to flesh it out. I spent the weekend goofing around like this with Wikipedia and Mojeek and came up with something that makes nifty location-based timelines.

A web page. The top reads "Timeline for 118 E South Street, Raleigh NC (300 meters radius.) That's the address of Shaw university. Underneath is the subhead "1864: Inception, Shaw University." Finally, there's a list of Mojeek search results for '"Shaw University" Raleigh NC 1864'.

Where am I and what’s around here?

I started with the Wikipedia Geosearch API, which has you specify a lat/long pair and gives you a list of all Wikipedia indexed pages within x meter radius. If you’d like to see how it works, try the “Wikipedia Points of Interest” feature part of Nosy Raleigh which uses this API.

A screenshot of Nosy Raleigh's "Wikipedia Points of Interest" feature. There's a map centered on 200 N Blount Street (the Executive Mansion.) Small red markers with blue stars mark Wikipedia points of interest on the map. Underneath the map there is displayed information on the Heck-Andrews House, because it has been clicked on in the map.

I Know The Where, Now What Is The When?

I’ve used that API a lot, but this time I wanted to add some date searching on top. So I went through Wikidata’s properties list and picked out 30 date-related Wikidata properties — things like the inception of organizations, birth and death dates, demolition dates, etc. Then I added a bit to filter the Geosearch results for those Wikidata properties and organize the found properties by date. And hey presto, we have a timeline!

A console log of a bunch of dates organized into a timeline. It starts with the inception of the North Carolina General Assembly on November 16, 1715, and ends with the inception of the North Carolina State Legislative Building in 1962.

Originally I had the idea of using the dates to build date-based searches and API calls for newspaper archives like Chronicling America. The problem was what I got back when I did experiments was very uneven. Occasionally I’d get decent results but more often I’d get nothing. (It’s true that I might get more from a commercial database but I have to use what I can afford.)

After connecting the data to a newspaper archives search didn’t pan out, I tried running some web searches for the basics of each timeline event: the place (site name / city / state) and year to see if I got useful results. And that worked really well! I did get some Wikipedia-fueled sites, but I also got a lot of local reference sites and enthusiast/hobbyist sites. I even got some news articles, historic event roundup / “don’t miss this place” type write-ups. So instead of trying to get the newspaper searches more productive, I added in a Mojeek API call to get related Web pages for each event.

For recent history, the Web search results can be kind of mixed. But for established history — I want to type “textbook’d history” — I like it a lot. It tends to find reference, deep web type sites. It reminds me a bit of the results I get using Carl’s Name Net or The Anti-Bullseye Name Search, which both use usual and unusual name patterns to get deeper results on a human search query. (You can use both tools at Search Tweaks.)

I can’t make this timeline tool available as it since it uses Mojeek which I have to pay for. However, I might try redoing it with the Stract API and see what kind of results I get. Maybe I can find some more data sources to bring in as well.

Back To Top