Linking Name Authorities and Wikipedia Entries

I love the idea of linked data. As a comic book, science fiction, and fantasy geek the relationships between different works, titles, series, and the characters in them are fascinating to me and the idea of being able to explore all those relationships just by following links is basically Nerdvana. I will also confess to having spent entire evenings following link to link to link on TV Tropes  (it’s roughly as addictive as breathing oxygen) and reading Night Court/ Doctor Who crossover fan fiction on Archive of Our Own (yes, it really is a thing).

But I try to read papers on linked data and they start to talk about FRBR and triples and RDF and my eyes glaze over. I just don’t get it very well without seeing it work. But I found a way to at least create links between data that doesn’t require a massive database or knowing SPARQL or having access to paid subscription tools. I don’t think it’s real linked data because it’s one way and there’s not a described relationship, but it’s a start, and it’s something I understand so I’m going to roll with it for now and try to build on this later.

The short version is that there is a really easy way to add Library of Congress Control Numbers (LCCNs, the unique identifiers for Name Authority Records, or NARs) to Wikidata pages, which are in turn linked to Wikipedia pages. So that’s what I’m going to describe here.

The first thing we need to do is find a Wikipedia entry without an LCCN. The LCCNs are shown in the Authority Control template of the Wikipedia page. As a counter-example of what we’re looking for, I chose the Wikipedia page for Weird Al Yankovic. Of course Weird Al’s page has his LCCN listed, because he’s Polka Megastar Weird Al Yankovic. The arrow shows the location of the LCCN, which links to the Name Authority Record. Some Wikipedia pages don’t have the Authority Control template, and that is fixable, but involves editing the page and is beyond what we’re doing here so for now we’re just looking at pages with that template.


In keeping with the novelty music theme, I found a Wikipedia page without an LCCN. That page is for Barnes & Barnes, the musical duo best known for their 1978 hit song “Fish Heads” (the video was directed by Bill Paxton, no joke, which is another reason I want linked data to take off because the world needs to know this when they Google Bill Paxton.). As you can see below, there’s a MusicBrainz ID, but no LCCN for Barnes & Barnes on their Wikipedia page. We’re going to change that.


We need to get the LCCN so we search to find Barnes & Barnes Name Authority Record. Once we find the right record we copy the LCCN, but please make sure you have the right record so you don’t add an incorrect LCCN. In this case the 670 is for Barnes & Barnes 1980 album Voobaha (the reissue includes “The Vomit Song”), so we’ve got the right record. I’m trying to keep this open and accessible to everyone, but if you’re not familiar with NARs and searching authorities it might be wise to get a foundational knowledge of those before trying this. Copy the LCCN (shown here as LC control no: ).


And then go back to the Barnes & Barnes Wikipedia page and click on the Wikidata item link.


This takes you to the Barnes & Barnes Wikidata page, which is where we’re going to add the LCCN we copied earlier. Scroll down to Identifiers, and then click on + add statement at the bottom.


This will open up the box, just type in LCCN and the Library of Congress authority ID will appear. Click on that option.


Then paste the LCCN you copied earlier into the text box. For this entry we need to (1) delete the space between the n and the 9, since URLs don’t like spaces. If there is no space in the LCCN you copied, you can just paste the number into the box as is. Then (2) click on save. If you’re not logged in, you’ll have to do a captcha to save.


And once we’ve saved, we can see the LCCN in the Wikidata page. It’s a link, and you can click on it to make sure you’ve entered the right number (recommended just in case, I really suggest avoiding creating incorrect links). And there it is.


This won’t appear in the Wikipedia page for Barnes & Barnes right away (it seems to take about 24 hours to refresh, but that’s just a guess), but when it does we get this:


Success! I didn’t add the Worldcat Identies, I suspect that was done automatically when the LCCN was added, but I’m not sure and there may be more people interested in adding links to Barnes & Barnes than I suspect. And now the Wikidata page (and the Wikipedia page through it) is linked to the Library of Congress Name Authorities. The link is only one way (we didn’t create a link from the NAR page to the Wikidata page), and there’s no relationship described so I’m pretty sure it’s not linked data, but it’s at least something I understand and can tinker with for five or ten minutes while I’m waiting on something else.

On the other hand so what, who cares? It’s a fair question. And I don’t know what this accomplishes at the moment, beyond the obvious (anyone who does know, please comment). But it at least connects NARs to a big open database, and hopefully people experimenting with that database will find a use for it. Until then, I’m happy just doing it for the sake of doing it.

If you’re looking to experiment with this yourself, for some reason it seems like a lot of musical groups don’t have their LCCN on their Wikipedia page. And they’re easy to pull out of, just do a keyword authorities (all) search for music group and then pick one and check the Wikipedia page.


Tech Tricks: Copying Folder and File Names from a Directory into a Word Document

I don’t know if anyone will find this useful, but sometimes there are simple tech things that I don’t do just because I don’t know I can do them. Once I find out I can do them my life gets a lot easier. For example, what if I have a directory with folders or files in it and I want to copy just the names of the folders and files into a word list? Say I have a folder with a bunch of images, and I want to send a patron a list of the file names, but don’t want to send all of the files themselves for whatever reason. I could screen shot it, but that can be annoying if I have to grab an image, scroll, grab an image, scroll, etc.

I also can’t just open the directory, select them, and do a CTRL-C because it will copy the contents of the files and folders and not just their names. But what you can do is open the location of the directory in Firefox (for whatever reason this doesn’t work in Chrome for me), copy the filenames there, and paste them into a text editor (word processing programs seem to bring formatting information that doesn’t format well for me). I’ll walk you through it (and demonstrate how far behind I am in gaming) using a folder on my computer with the caveat that usually you would use this for a lot more files.

Just navigate to the directory with the files and/or folders you want to copy the names of. The folders I’m using for my example live in my computer at C:\GOG Games.


Click in the location bar and copy the address.


Open Firefox (or possibly another web browser, this doesn’t work in Chrome for me) and paste in the location of the folder.


Firefox will now show those folders and files in the browser window. You can click and go into them or open some files in your browser window, but we don’t want to, we just want to copy the names.


So you can either drag to select some or all, or CTRL-A, and then CTRL-C to copy the names of the files and folders you want to make into a list. I did a CTRL-A so it’s going to grab everything.


Then just paste using CTRL-V into a text editor to get rid of formatting info. This shows it in Notepad, and I usually start in a text editor no matter where I’m ultimately going. If I don’t put it in a text editor and then copy (CTRL-C) it again, it brings weird formatting information with it (tips on making it not do this are welcome).


The image below shows the folder names in a spreadsheet program after I’ve copied it into Notepad, selected it and copied it again, and pasted it into LibreOffice Calc. From there it’s easy to delete columns with information you don’t want (file size or last modified information maybe), and sort the file names if you want to.


That’s all there is to it. I hope it’s useful. One of those things that’s easy enough to do, if you know you can do it in the first place. Any improvements to the process, questions, or suggestions are very welcome.