Skip to main content
The Collation

Folger Tooltips: Hamnet URLs, part two

Hello and welcome to another installment in a series of tooltips on the quiet, yet oh-so-ubiquitous universal resource locator (aka URL).

As pointed out in Hamnet URLs, part one: because “live” URLS in the Hamnet database are session-based, they can’t be just grabbed from your browser’s address bar and re-used to generate persistent (or “static”) hypertext links to the results of your specific search. However, there are methods for creating such links for instance to embed in your syllabi, Moodle site, or to email to students and colleagues, etc.

You may remember our last discussion, which addressed how to utilize and / or construct your own static URLs that point in a variety of useful ways to Hamnet. Well today, we’ll go all “advanced.” Read on for details on how to construct static URLs representing dynamically-updating keyword searches, based on the many dropdown choices available on our Advanced Search page.

Linking to a Hamnet Advanced Search

For today’s example, I’ll be using a Hamnet search for records describing photographs from the art collection that include both early 20th century actors Julia Marlowe and E.H. Sothern. Here’s a screenshot of my “Advanced Search” strategy:

Hamnet Advanced Search Screenshot

Hamnet Advanced Search Screenshot

Note that I’m using a question mark to truncate my keyword search of the “Physical Description” field. This will help ensure that my search results include both those records that might describe only a single photograph, as well as any records where multiple photographs are described.

Grabbing the URL for the search results from my address bar as a starting point, I’ve ended up with:

http://shakespeare.folger.edu/cgi-bin/Pwebrecon.cgi?
SAB1=marlowe+sothern&BOOL1=all+of+these&FLD1=Keyword+Any+Bib+Field+
%28GKEY%29&GRP1=AND+with+next+set&SAB2=photograph%3F&BOOL2=all+of+these&
FLD2=Physical+Description+%28300A%29&GRP2=AND+with+next+set&SAB3=&BOOL3=
all+of+these&FLD3=Keyword+Any+Bib+Field+%28GKEY%29&
PID=5YnaIzY1v0HrbEfNh7u0JdN9JyPK&SEQ=20120208220417&CNT=50&HIST=1

As with the Hamnet Basic Search I demo’ed last time, in order to render today’s URL “static” there are elements I both need to add (“DB=local&SL=none” after that question mark) and remove (the “PID”, “SEQ”, and “HIST” bits), which leaves me with:

http://shakespeare.folger.edu/cgi-bin/Pwebrecon.cgi?
DB=local&SL=none&SAB1=marlowe+sothern&BOOL1=all+of+these&FLD1=
Keyword+Any+Bib+Field+%28GKEY%29&GRP1=AND+with+next+set&SAB2=
photograph%3F&BOOL2=all+of+these&FLD2=Physical+Description+%28300A%29&
GRP2=AND+with+next+set&SAB3=&BOOL3=all+of+these&FLD3=
Keyword+Any+Bib+Field+%28GKEY%29&CNT=50

This is great, especially because it is “dynamically updated.” Now, when we acquire or catalog additional photographs or photograph collections where Marlowe and Sothern are both mentioned, the search results from this hyperlink automatically will include those new results as well.

OK, but let’s break it apart for easier parsing. To make things just a bit clearer, and to provide easy cut-and-paste-able elements for you DIY’ers out there, I’ve bolded my own search terms below, along with those elements that are up to Hamnet users to choose. The rest of it is scaffolding:

http://shakespeare.folger.edu/cgi-bin/Pwebrecon.cgi?DB=local&SL=none

&SAB1=marlowe+sothern
&BOOL1=all+of+these
&FLD1=Keyword+Any+Bib+Field+%28GKEY%29

&GRP1=AND+with+next+set

&SAB2=photograph%3F
&BOOL2=all+of+these
&FLD2=Physical+Description+%28300A%29

&GRP2=AND+with+next+set

&SAB3=
&BOOL3=all+of+these
&FLD3=Keyword+Any+Bib+Field+%28GKEY%29

&CNT=50

What in the world does all of that mean? Well, there’s a few things to point out that should make this less seem a bit less gibberistic:

First, if you check out that screenshot above again and compare it with the URL, you’ll see three lines, each of which has three elements:

  • A “Search for:” box (aka SAB1, SAB2, and SAB3), in two of which I typed my keyword(s)
  • A boolean operator dropdown (aka BOOL1, BOOL2, and BOOL3), where the choices end up rendered this way:
    • all+of+these
    • any+of+these
    • as+a+phrase
  • A “Search in:” dropdown (aka FLD1, FLD2 and FLD3), where I chose from among twenty choices the restrictions I wanted to impose on my keyword search (or instead in future might build from scratch using the handy list below).

Second, you’ll see that the “in between booleans” are rendered here as GRP1 and GRP2 elements. These ones seem pretty straightforward: 1

  • AND+with+next+set
  • OR+with+next+set
  • NOT+with+next+set

Third, there’s some syntax worth noting:

  • Spaces are to (+) signs as caterpillars are to butterflies. So notice how my marlowe sothern became marlowe+sothern? And how for instance that “all of these” dropdown turned into “all+of+these”? Make it so in any URLs you might be building.
  • There’s a passel of other characters that will eat your URL for lunch. For all the gory details about reserved vs. unreserved characters in URIs, check out Wikipedia’s “Percent-encoding” entry. But I tell you what: other than the space, the only other characters you’re most likely to have troubles with in this context are two Hamnet truncation / wildcard symbols:
    • the question mark, a single wildcard used to match on zero or more characters: don’t use ? but instead use %3F
    • the percent sign, a repeatable wildcard used to match on a specified number of characters: don’t use %, but instead use %25

Finally, the last bit of detail you’ll need is the following, a list of all twenty “Search in” choices, in URL-friendly syntax, ready to cut and paste into your FLD1=, FLD2=, and / or FLD3= areas:

  • All Notes: All+Notes%28NOTE%29
  • Bibliographic Citation: Bibliographic+Citation%28510A%29
  • Call Number: Call+Number%2809XA%29
  • Edition Statement: Edition+Statement%28250A%29
  • Folger Copy Notes: Folger+Copy+Notes%28LNOT%29
  • Form/Genre: Form/Genre%28655A%29
  • Holdings Record: Holdings+Record%28HKEY%29
  • ISBN: ISBN%28ISBN%29
  • ISSN: ISSN%28ISSN%29
  • Keyword Any Bib Field: Keyword+Any+Bib+Field%28GKEY%29
  • Material Type [GMD]: Material+Type+[GMD]%28245H%29
  • Name: Name%28NKEY%29
  • Physical Description: Physical+Description%28300A%29
  • Published/Created Date: Published/Created+Date%28260C%29
  • Published/Created Place: Published/Created+Place%28260A%29
  • Publisher/Printer Name: Publisher/Printer+Name%28260B%29
  • Series: Series%28SERI%29
  • Size/Format: Size/Format%28300C%29
  • Subject: Subject%28SKEY%29
  • Title: Title%28TKEY%29

One final caveat for the ambitious: this sort of search URL construction won’t work correctly when using sorting, or search limits, since some of that information doesn’t actually end up in the URL.

Happy searching!

  1. For those of you thinking “Seems? I know not seems,” it is worth emphasizing one point of friction with Advanced Searches: overly-complex boolean logic can sometimes yield unexpected search results, if the system can’t quite interpret just where the nesting parentheses should appear. As we put it in the help text on our Advanced Search page, “For best results, place like terms (example: london londini) in a single Search for box and use “any of these” rather than combining terms using multiple Search for boxes connected by OR. To combine previous searches with AND, go to Search History (button at top right of page) and select the searches to be combined. For more complex or precise nested boolean keyword searches, use “Expert Search” from the Basic Search tab.”