So many things get lost to the edges. Too many commitments, too little motivation, etc. etc.
For many a moon I’ve been meaning to write up how Alex and I turned my QueerLCSH into a libGuide. I’m finally doing it!
The very first thing, of course, was the QueerLCSH itself which you can read ALL about over at that link. (Scroll past the updates for the original post and a link to the headings themselves)
Then I was alerted by Jessica Colbert that she had made a very cool LibGuide at her institution using my headings! Clicking any of the headings brings the user directly into the library catalog, performing a subject search.
Naturally I thought, “hey, why not do that here too?”
I talked to Alex about the idea and they were totally on board and excited. The question was how to turn a looooooong list of headings into a LibGuide without it being totally tedious?
As it usually is (to me), the answer was XSLT. Remember that I made my QueerLCSH by painstakingly (and tediously) downloading records 1-by-1 from id.loc.gov as RDF/XML (MADS and SKOS). That means that I still have all the raw material to work with and transform however I want.
Alex pointed out that even if I could generate the links easily, we’d have to load those links into the LibGuide one at a time, thereby returning us to tedium land. I reached out to Springshare Support, and learned that if you upload a set of links as a database, they can then flip them to be link assets. I don’t know why that power isn’t given to users of LibGuide software, but I was glad they were willing to do it for us.
At this point we were ready for me to generate the links. I wrote the following XSLT transformation:
<?xml version=”1.0″ encoding=”UTF-8″?>
<xsl:stylesheet xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”
xmlns:xs=“http://www.w3.org/2001/XMLSchema”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:madsrdf=“http://www.loc.gov/mads/rdf/v1#”
xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:ng=“http://www.netanelganin.com”
exclude-result-prefixes=“xs” version=“2.0”>
<xsl:function name=“ng:norm” as=“xs:string”>
<xsl:param name=“arg” as=“xs:string”/>
<xsl:sequence select=“normalize-space(lower-case(translate($arg, ‘-.,’, ‘ ‘)))”/>
</xsl:function>
<xsl:template match=“/rdf:RDF”>
<xsl:apply-templates
select=“madsrdf:Topic/madsrdf:authoritativeLabel | madsrdf:ComplexSubject/madsrdf:authoritativeLabel”>
<xsl:sort select=“ng:norm(.)”/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match=“madsrdf:authoritativeLabel”>
href=“{concat(‘http://search.library.brandeis.edu/primo_library/libweb/action/dlSearch.do?&query=sub,contains,’,ng:norm(.),’&vid=BRAND&institution=01BRAND&search_scope=ALMA‘)}”>
select=“.”/>
</xsl:template>
</xsl:stylesheet>
It’s pretty straight forward — there’s a function which I use to normalize the headings, it turns commas, periods and dashes into spaces. Then all the headings get sorted, and tossed into a big list. I’ve highlighted the most important part in bold. This is what’s called a ‘deep link’. I learned while doing this that you can’t just perform a subject search in Alma and then create a link based on that. It’ll decay eventually. You need to build a subject search using this deep link thing. Here’s some Ex Libris documentation on deep links.
As you can see there’s an “ng:norm(.)” buried in the middle of the deep link, that’s where the heading slides in. This particular link is a subject search, but it could easily be a browse search.
So this stylesheet processed all the headings and turned them into links which bring a user directly into our catalog. We tossed ’em all into an Excel spreadsheet, uploaded it to the LibGuide software, and then Springshare turned them into link assets!
Pretty cool, right?
Feel free to snag this XSLT and do the same for your institution, or if you’re interested in having something similar but aren’t sure how — let me know and I’ll try to help you out!
Some interesting things to consider:
- We made no attempt to guarantee that any of the subject searches would actually return results. While that does mean patrons are presented with topics we don’t actually have any resources for, we couldn’t think of how to maintain the upkeep as new books entered our catalog. How would we know if new material matched a topic which we had previously removed?
- We didn’t add any of the subject headings which were only added toLCSH for validation purposes, e.g. “African American gays–Fiction”, “Gay couples–Legal status, laws, etc” (in truth I’ve never really understood why they do that…)
- We didn’t add any subdivisions unless the LGBT aspect was in that subdivision, i.e. “World War, 1939-1945–Participation, Gay” but not “Bisexuality — Religious aspects”. We felt that performing the subject search of the main topical term itself without the subdivisions would probably be sufficient.
- If you do decide to include subdivisions, consider the pattern headings, ex. “Gay rights–Religious aspects–Baptists, [Catholic Church, etc.]” searching that subject string as is would be unfruitful because that isn’t how pattern headings look in the wild.
- We opted not to include any of the Library of Congress Genre/Form Terms or Library of Congress Demographic Group Terms because in our ILS it is not possible for users to actually target a search to those fields. If it becomes possible, we’ll add ’em in!
- Scope notes: keep ’em or not?
Upkeep:
After the initial transformations were done, I stepped back from the project and Alex now maintains the LibGuide. They check the New LCSH each month and add any new relevant terms themselves.