Haunted Keywords Explained
With Halloween almost here, it should not be all that surprising to know that keywords in Aperture 1.5 are haunted. Really they are. In 1.1 keyword management was somewhat confusing and a little dusty, but at least it was under control: you applied keywords to images and there they sat. Suddenly in 1.5 they jump out at you in the dark.
I have turned my attention to keywords. Before I tackled my own scramble of keywords, I wanted to understand what makes the new system tick so I could use if effectively and not fall afoul of anything sinister. I had read a number of reports of some very odd behavior; some of it I had seen myself. One of the first things I did after upgrading to 1.5 was open up the keyword HUD. Where did all that come from? I had many more keywords than before, all sorts of old stuff, and things I didn't think I had ever entered.
So I looked at Apple's documentation for guidance on keywords in Aperture 1.5 and saw what it has to say:
Automatic Updating of the Keywords HUD
The Keywords HUD provides a versatile way to apply keywords to images. The Keywords
HUD is now updated automatically with any keywords you add. For example, when you
enter a new keyword in the Metadata Inspector, that keyword also appears in the
Keywords HUD. When you change a keyword, for example, by changing its spelling or
capitalization, the keyword is updated on all images that have that keyword assigned. In
addition, the Keywords HUD can be locked to prevent unintended changes.
That is all I could find. Two new features; no mention of the spirit world's involvement.
Investigation has shown that there are a lot of changes under the hood, and they are for the better. The behavior of keywords has quite substantially changed in Aperture 1.5 and with a little work I hope to help you understand them. But first, I need to explain keywords in Aperture 1.1.
The diagram below shows how I understand keywords worked in Aperture 1.1 (you may want to drag a copy of this to the desktop and open it so you can view it alongside the text):

The dotted lines are manual operations and the solid lines are automatic operations. When Aperture 1.1 was launched, the Keyword HUD got its list of keywords from a global list of keywords stored in the user's Application Support folder. When the application quit, that list was written back to the Keywords.plist file. If you imported a list of keywords, that list just overwrote what was in the plist and the Keyword HUD was updated automatically.
The images themselves were stored as files in the library (managed images only on 1.1) with sidecar files that contained the metadata. When a keyword was manually applied to an image, those sidecar files were updated to reflect the new keywords. If an image was imported and it had keywords, those were put in the sidecar file too. I have also shown another library, Library B. When Library B was opened with Aperture 1.1 it was handled the same way as Library A, reading from the global list of keywords. In that way adding keywords only had to be done once, and they were available in every library.
If new keywords were added to the HUD or current keywords were edited, nothing happened to the keywords in the image sidecar files unless the new keywords were manually applied. So tagging 55 images with Ferd meant that those keywords had to be removed in one operation, then the HUD edited, and then Fred added to the images to correct the error.
Now look at this diagram that attempts to illustrate how keywords are managed in Aperture 1.5. Note that although all of the images are not present (they are referenced), their sidecar files are still in the library:

The big difference is that there is a thing called SQLite database inside the libraries. In the 1.1 diagram I did not show the library database because although it is there, it does not participate in keyword management. The other thing to notice is that the database is central to everything connected to keywords. And Aperture's database is very hungry for keywords. Every keyword Aperture 1.5 ever comes across is put into the currently open library's database.
The keywords in the database are synchronized to the Keyword HUD and to the sidecar files. So if you edit a keyword, Aperture 1.5 knows exactly where it is used and can update it immediately. This centralization also explains why Aperture 1.5 is so much faster than 1.1 on filtering with keywords: it's just a database query and it is easily combined with other queries that are used to make the complex filtering that is possible. Aperture 1.5 also allows you to move keywords between hierarchies and move hierarchies of keywords around. All the affected images have their keywords updated to match the new organization.
Because of the close association between the database and the sidecar files, 1.5 can enforce the requirement that the database contain all the keywords of all the images it is managing at all times. This is why in 1.5 when you go to delete a keyword you are forced to remove it from all the images that have it if you proceed: if this were not done, then the keyword database would no longer be complete. The database also contains keywords that are not used in any image.
Another difference is that imported keywords now add to the list of keywords in the HUD (via the database) rather than replacing the list, as was the behavior in 1.1. And images with keywords that are imported, alone or as part of an imported project, (or have keywords added during import) also have those keywords added to the hungry database.
This explains the first spooky behavior of Aperture 1.5: where did all those old keywords come from? They came from Aperture 1.5 rescanning all of my images and sidecar files during the upgrade and storing everything it could find in its database. So all those old images with old keywords have come back from the dead to haunt me. I also think that 1.1 was incorrectly recording the keyword hierarchy in the sidecar files in some cases, so I actually had Activity > Running as well as Running on my images. On 1.1 it made no difference, they behaved the same. But on 1.5 the two show up in two places on the Keyword HUD.
The reason for my including Library B is more obvious now. When Aperture quits and the database is written out to the Keywords.plist file, it will include every keyword that is in any image of library A. If library B is opened, all the keywords used in images in library A will be added to the database in library B because that global list of keywords will be read in. So even if I delete keywords in one library, those same keywords can come back to haunt me via another library that still has them in its database. This is the second type of spooky behavior: Zombie Keywords. To kill them once and for all (after you have added the appropriate correct keywords), select all the zombies with command-clicks, and delete them from all versions. Then close Aperture and open another library. Repeat the delete with all the libraries in turn and they will finally be dead.
There is a third spooky behavior that I think is simply a bug. Sometimes if I delete a keyword and accept that it is going to be removed from all the versions it disappears. But then a short while later it reappears in the Keyword HUD, right in front of my eyes! However if after deleting the keyword I immediately quit Aperture, all is well and it does not come back.
So how will I work with the new keyword system of 1.5? I haven't tried yet, so I don't know (another article). But I already know that I prefer the new way: it is faster, more consistent, more comprehensive, and importantly more comprehensible. It gives me the complete picture, warts and all, and allows me to do something about what I see.
I did find a couple of keyword bugs. Show keyword Controls (shift D) is grayed out unless the viewer is visible. And using the period and comma shortcuts for moving up and down the list of keyword sets results in some very odd widths for the keyword buttons. What is with the central justification of the buttons and pop-up anyway? Just right-justify the whole thing and it will stay in exactly the same place as I navigate.
The filter dialog really needs to show keywords as a hierachy. The biggest improvement to the keyword system I can think of centers around the HUD. Each line should show how many images in the library use that keyword. And all keywords used in the current selection should be bolded. iView works like this and it is very, very useful.
I have turned my attention to keywords. Before I tackled my own scramble of keywords, I wanted to understand what makes the new system tick so I could use if effectively and not fall afoul of anything sinister. I had read a number of reports of some very odd behavior; some of it I had seen myself. One of the first things I did after upgrading to 1.5 was open up the keyword HUD. Where did all that come from? I had many more keywords than before, all sorts of old stuff, and things I didn't think I had ever entered.
So I looked at Apple's documentation for guidance on keywords in Aperture 1.5 and saw what it has to say:
Automatic Updating of the Keywords HUD
The Keywords HUD provides a versatile way to apply keywords to images. The Keywords
HUD is now updated automatically with any keywords you add. For example, when you
enter a new keyword in the Metadata Inspector, that keyword also appears in the
Keywords HUD. When you change a keyword, for example, by changing its spelling or
capitalization, the keyword is updated on all images that have that keyword assigned. In
addition, the Keywords HUD can be locked to prevent unintended changes.
That is all I could find. Two new features; no mention of the spirit world's involvement.
Investigation has shown that there are a lot of changes under the hood, and they are for the better. The behavior of keywords has quite substantially changed in Aperture 1.5 and with a little work I hope to help you understand them. But first, I need to explain keywords in Aperture 1.1.
Keywords in Aperture 1.1
The diagram below shows how I understand keywords worked in Aperture 1.1 (you may want to drag a copy of this to the desktop and open it so you can view it alongside the text):

The dotted lines are manual operations and the solid lines are automatic operations. When Aperture 1.1 was launched, the Keyword HUD got its list of keywords from a global list of keywords stored in the user's Application Support folder. When the application quit, that list was written back to the Keywords.plist file. If you imported a list of keywords, that list just overwrote what was in the plist and the Keyword HUD was updated automatically.
The images themselves were stored as files in the library (managed images only on 1.1) with sidecar files that contained the metadata. When a keyword was manually applied to an image, those sidecar files were updated to reflect the new keywords. If an image was imported and it had keywords, those were put in the sidecar file too. I have also shown another library, Library B. When Library B was opened with Aperture 1.1 it was handled the same way as Library A, reading from the global list of keywords. In that way adding keywords only had to be done once, and they were available in every library.
If new keywords were added to the HUD or current keywords were edited, nothing happened to the keywords in the image sidecar files unless the new keywords were manually applied. So tagging 55 images with Ferd meant that those keywords had to be removed in one operation, then the HUD edited, and then Fred added to the images to correct the error.
Keywords in Aperture 1.5
Now look at this diagram that attempts to illustrate how keywords are managed in Aperture 1.5. Note that although all of the images are not present (they are referenced), their sidecar files are still in the library:

The big difference is that there is a thing called SQLite database inside the libraries. In the 1.1 diagram I did not show the library database because although it is there, it does not participate in keyword management. The other thing to notice is that the database is central to everything connected to keywords. And Aperture's database is very hungry for keywords. Every keyword Aperture 1.5 ever comes across is put into the currently open library's database.
The keywords in the database are synchronized to the Keyword HUD and to the sidecar files. So if you edit a keyword, Aperture 1.5 knows exactly where it is used and can update it immediately. This centralization also explains why Aperture 1.5 is so much faster than 1.1 on filtering with keywords: it's just a database query and it is easily combined with other queries that are used to make the complex filtering that is possible. Aperture 1.5 also allows you to move keywords between hierarchies and move hierarchies of keywords around. All the affected images have their keywords updated to match the new organization.
Because of the close association between the database and the sidecar files, 1.5 can enforce the requirement that the database contain all the keywords of all the images it is managing at all times. This is why in 1.5 when you go to delete a keyword you are forced to remove it from all the images that have it if you proceed: if this were not done, then the keyword database would no longer be complete. The database also contains keywords that are not used in any image.
Another difference is that imported keywords now add to the list of keywords in the HUD (via the database) rather than replacing the list, as was the behavior in 1.1. And images with keywords that are imported, alone or as part of an imported project, (or have keywords added during import) also have those keywords added to the hungry database.
This explains the first spooky behavior of Aperture 1.5: where did all those old keywords come from? They came from Aperture 1.5 rescanning all of my images and sidecar files during the upgrade and storing everything it could find in its database. So all those old images with old keywords have come back from the dead to haunt me. I also think that 1.1 was incorrectly recording the keyword hierarchy in the sidecar files in some cases, so I actually had Activity > Running as well as Running on my images. On 1.1 it made no difference, they behaved the same. But on 1.5 the two show up in two places on the Keyword HUD.
The reason for my including Library B is more obvious now. When Aperture quits and the database is written out to the Keywords.plist file, it will include every keyword that is in any image of library A. If library B is opened, all the keywords used in images in library A will be added to the database in library B because that global list of keywords will be read in. So even if I delete keywords in one library, those same keywords can come back to haunt me via another library that still has them in its database. This is the second type of spooky behavior: Zombie Keywords. To kill them once and for all (after you have added the appropriate correct keywords), select all the zombies with command-clicks, and delete them from all versions. Then close Aperture and open another library. Repeat the delete with all the libraries in turn and they will finally be dead.
There is a third spooky behavior that I think is simply a bug. Sometimes if I delete a keyword and accept that it is going to be removed from all the versions it disappears. But then a short while later it reappears in the Keyword HUD, right in front of my eyes! However if after deleting the keyword I immediately quit Aperture, all is well and it does not come back.
The Way Ahead
So how will I work with the new keyword system of 1.5? I haven't tried yet, so I don't know (another article). But I already know that I prefer the new way: it is faster, more consistent, more comprehensive, and importantly more comprehensible. It gives me the complete picture, warts and all, and allows me to do something about what I see.
I did find a couple of keyword bugs. Show keyword Controls (shift D) is grayed out unless the viewer is visible. And using the period and comma shortcuts for moving up and down the list of keyword sets results in some very odd widths for the keyword buttons. What is with the central justification of the buttons and pop-up anyway? Just right-justify the whole thing and it will stay in exactly the same place as I navigate.
The filter dialog really needs to show keywords as a hierachy. The biggest improvement to the keyword system I can think of centers around the HUD. Each line should show how many images in the library use that keyword. And all keywords used in the current selection should be bolded. iView works like this and it is very, very useful.
The Bagelturf site welcomes Donations of any size