Omeka updates

In the very little spare time I manage to find, I still try and update my personal family archive project. Again, it’s been a great experience working with a wonderful (and very personal collection!) and I’ve learned so much. I feel like I should write a little about that project here to show what I’ve learned.

People – This was surprisingly difficult and I dithered on this for quite sometime. First, I created a controlled vocabulary of sorts using the person’s official birth (therefore maiden) name. Then I decided to use the tagging system within Omeka to describe the people in the resource. For the intended audience, this is perhaps the most important piece of metadata and I wanted it featured prominently.

Date – trying hard to use the international standard yyyy-mm-dd consistently through out this project. Inferred dates are entered in square brackets [] and partial dates are left incomplete.

Language – for the few items I’m including that have a language component, I’m using a controlled vocabulary (via the Simple Vocab plugin) to describe the language of these resources. Right now it’s just English and Dutch.

Regular Expressions in the Library – 2

Imagine you’ve just witnessed a hit and run accident. A car hit a biker and sped away. Despite the shock, you managed to remember the license plate number and promptly report it to the police. Great! You think the license plate number was 123ABC. They search their system and – yes! – it’s a match and justice was served.

This (obviously fictional) story is my way to introduce the idea of regular expressions. Theoretically, regular expressions could enable the police to find this car without perfect search terms.

Regular Expressions Solve Crime

Let’s change the memory. Instead of remembering the whole license plate number, you remember the first five characters –  123AB – and that the license plate had six characters total. You could do multiple searches like this:

123AB1
123AB2
 …
123ABZ

That would work…but it would be much easier to use the search term:

123AB.

In regular expressions, the dot character represents a single character. Searching “123AB.” would be functionally equivalent to searching all of the examples listed above (“123AB1“, “123AB2“, etc.). Again, the dot metacharacter matches only single items. Searching for “123AB.” would not match a license with 7 characters – if the license plate number was 123ABCD, they would get away!

Better Searching with Brackets

Let’s say that searching 123AB. worked, but it gave too many results. And, even though you can’t remember it exactly, you are pretty sure the last character was a letter and not a number (or perhaps this is a requirement for valid license plate numbers). The police could tighten up their search by using the following search term:

123AB[A-Z]

This expression uses two new characters: it uses square brackets and the hyphen symbol. Defined quickly, square brackets “identifies a user-defined class of characters, any of which will match” and the hyphen will “identifies a range of characters to match” (Source). The hyphen requires that items appear in their natural order – searching for 123AB[Z-A] would not return any matches. Other examples:

  • If you knew the last character wasn’t an A 0r B = 123AB[C-Z]
  • If you thought the last character was a vowel = 123AB[AEIOU]
  • If you thought the last character was a number = 123AB[1-9]

Summary

Three metacharacters in regular expressions could help solve this crime:

  • The dot characters matches any single character
  • Square brackets define allowable characters
  • Hyphens can be used to define an allowable range of characters.

Regular Expressions in the Library – 1

In several library contexts (MarcEdit, for example) , I’ve read or been told “have you tried doing that using Regular Expressions?”. Having no idea what this meant or referred to, I did a little wikipedia-ing and found out a little more about this method of matching text strings. Initial thoughts:

  • Yes, I think this can accomplish some important library-related tasks.
  • No, I don’t know anything about them.

I’ll chronicle my attempts to understand and explore Regular Expressions on this blog under this heading. I’m doing so with the intended context of MarcEdit, but hope to think of other ways Regular Expressions could be used to do library work.

First, a definition via Wikipedia:

In computing, a regular expression provides a concise and flexible means to “match” (specify and recognize) strings of text, such as particular characters, words, or patterns of characters

I’ll jump right in and discuss some special characters that made regular expressions so powerful. I like examples and getting messy, so here we go! I’ve decided to adopt a crime show format genre for my initial explorations. Enjoy!