Archives

Categories

Bookmarklet to search Google Books from an HTML element

Install the bookmarklet by dragging the link to your bookmarks toolbar:

Or, create a bookmark manually, and change the Location property to the following:

javascript:(function(){window.location="https://www.google.com/search?tbm=bks&q=isbn:"+document.getElementById("isbn");})()

To use it, go to a page which has an element with an id of “isbn” then click on the bookmark.

You can edit the bookmark if the id is called something else (change the bit in brackets and quotes from isbn to something else) or you want to search on another index (change q=isbn to q=somethingelse).

RLUK/European Library linked data sample

RLUK and the European Library (of which the RLUK is now a member) have just released 17 million records as linked open data. They have released three sets (via Mike Mertens), for which links to the RDF turtle versions are below:

I’ve tried to have a quick look at the last just to get an idea and I’ve isolated what I think is all the data for one book, chosen at random. The whole block of turtle prefixes from the start of the file are included:


@prefix rdaa: <http://rdaregistry.info/Elements/a/> .
@prefix rdac: <http://rdaregistry.info/Elements/c/> .
@prefix rdae: <http://rdaregistry.info/Elements/e/> .
@prefix rdam: <http://rdaregistry.info/Elements/m/> .
@prefix rdaw: <http://rdaregistry.info/Elements/w/> .
@prefix rdau: <http://rdaregistry.info/Elements/u/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix edm: <http://www.europeana.eu/schemas/edm/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix frbrer: <http://iflastandards.info/ns/fr/frbr/frbrer/> .
@prefix ore: <http://www.openarchives.org/ore/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix wgs84pos: <http://www.w3.org/2003/01/geo/wgs84_pos#> .

<http://data.theeuropeanlibrary.org/BibliographicResource/3000084490807> a dcterms:BibliographicResource ;
      rdam:P30004 "local identifier: http://data.copac.ac.uk/iid/65204626" ;
      rdau:P60049 <http://rdvocab.info/termList/RDAContentType/1020> ;
      rdam:P30003 "single unit"^^<http://rdvocab.info/termList/ModeIssue> ;
      rdau:P60520 "Unkown"@en ;
      rdam:P30004 "isbn: 0198750315" ;
      rdam:P30156 "The philosophy of history" ;
      rdau:P60339 "edited by Patrick Gardiner." ;
      rdam:P30157 "Oxford readings in philosophy" ;
      rdau:P60398 _:node18kdvnimbx4386 .

_:node18kdvnimbx4386 a rdac:C10004 ;
      rdaa:P50111 "Patrick L. Gardiner" ;
      rdaa:P50121 "1922" .

<http://data.theeuropeanlibrary.org/BibliographicResource/3000084490807> rdau:P60073 "1974" ;
      rdau:P60099 <http://id.loc.gov/vocabulary/iso639-2/eng> ;
      rdau:P60163 _:node18kdvnimbx4387 .

_:node18kdvnimbx4387 rdau:P60366 "Oxford University Press" .

<http://data.theeuropeanlibrary.org/BibliographicResource/3000084490807> rdau:P60444 _:node18kdvnimbx4388 .

_:node18kdvnimbx4388 a rdac:C10005 ;
      rdaa:P50032 "London" .

<http://data.theeuropeanlibrary.org/BibliographicResource/3000084490807> rdau:P60163 <http://id.loc.gov/vocabulary/countries/uk> ;
      dcterms:subject _:node18kdvnimbx4389 .

_:node18kdvnimbx4389 a frbrer:C1007 ;
      rdfs:label "History, Philosophy." ;
      dcterms:hasPart _:node18kdvnimbx4390 .

_:node18kdvnimbx4390 a frbrer:C1007 ;
      rdfs:label "History" .

<http://data.theeuropeanlibrary.org/BibliographicResource/3000084490807> dcterms:extent "224 p. ;" , "21 cm." ;
      rdau:P60470 "Includes index." ;
      dcterms:description "Bibliography: p. [218]-222." .

Some initial observations:

A short snippet from another book showing a blank node asserted as being the same as a VIAF entity, having a relationship with a work using RDA, and the detailed RDA data elements for the name:


_:node18kdvnimbx245 owl:sameAs <http://viaf.org/viaf/17463572/> .

<http://data.theeuropeanlibrary.org/BibliographicResource/3000087185802> rdau:P60398 _:node18kdvnimbx245 .

_:node18kdvnimbx245 a rdac:C10004 ;
      rdaa:P50111 "Niccolo Pagliarini" ;
      rdaa:P50121 "1717" ;
      rdaa:P50120 "1795" .

Bumblebees in Sandy, 2013

Last I managed to see six species of bumblebee in Sandy* and another one further afield in Bedfordshire**. This year I managed to spot eight in Sandy, all but one in the garden. I’m hoping to have lots more wild flowers in the garden this year so hope to attract the bees to go with them.

I’ve submitted all the following as records to Beewatch, which is also very useful in getting confirmation of IDs.

Bombus hortorum

Bombus hortorum

Bombus hortorum

The garden bumblebee, seen in the garden. This is the first one of these I’ve seen, despite them being very common.

Bombus hypnorum

Bombus hypnorum

Bombus hypnorum

The tree bumblebee. We in fact had two nests in our house and garden. The bee above is coming out of one they made in an old bird box in the garden. The birds never used it but these bees did. We had a second nest in the roof too.

Bombus lapidarius

Bombus lapidarius (worker)

Bombus lapidarius (worker)

Bombus lapidarius (male)

Bombus lapidarius (male)

The red-tailed bumblebee. Both in the garden.

Bombus pratorum

Bombus pratorum

Bombus pratorum

The early bumblebee, one of the smaller species. In the garden. They seem to like flatter flower heads, like on this senetti.

Bombus lucorum

Bombus lucrorum (female)

Bombus lucrorum (worker)

Bombus lucorum (male)

Bombus lucorum (male)

White-tailed bumblebee. The queens and workers look practically identical to the buff-tailed bumblebee (B. terrestris) although the males are very much more yellow and quite striking. In the garden.

Bombus pascuorum

Bombus pascuorum

Bombus pascuorum

Common carder bee. In the garden.

Bombus terrestris

Bombus terrestris (queen)

Bombus terrestris (queen)

Buff-tailed bumblebee. The buff tail is more obvious in the queen especially just forward of the tail.

Bombus vestalis

Bombus vestalis

Bombus vestalis

Bombus vestalis

Bombus vestalis

The southern cuckoo bumblebee. It takes over nests of B. terrestris. Sadly not seen in the garden but the bee on the bramble flower was on a piece of waste ground next to a path a stone’s throw away. The one on clover was near the railway station.

* Bombus vestalis?, B. pratorum, B. terrestris, B. rupestris, B. hypnorum, B. pascuorum

** B. campestris?

Automatic table of contents for RDA Toolkit workflows

Below is described a way to add tables of contents to RDA Toolkit workflows automatically, i.e. without manually adding anchors and creating a list. You can see an example of it action on this workflow (although of course I can’t guarantee that this workflow will always be around or look like this).

It uses some Javascript but requires no knowledge of it as it can be dropped in. It is 95% a script written by Stuart Langridge (@sil) with some minor amendments to get round some strange internal linking behaviour and to provide links to the top of the document throughout the workflow.

Instructions follow and some caveats are below.

  1. Open an RDA Toolkit workflow for editing
  2. Click on Source
  3. Insert the following snippet of HTML where you want the table of contents to appear:
    <div class="generate_from_h2" id="generated-toc"><a name="top"></a></div>
  4. If you have access to a local web server:
    1. Copy the Javascript file generate_toc_rda.js and put it somewhere sensible.
    2. At the very end of the workflow, put the following HTML snippet, changing the URL to where your copy of generate_toc_rda.js now lives:
      <script type="text/javascript" src="http://www.myserver.org/pathto/generate_toc_rda.js"></script>
  5. If you don’t have access to a local server:
    1. At the very end of the workflow, put the following HTML snippet:
      <script type="text/javascript">
    2. Copy the complete contents of the Javascript file generate_toc_rda.js and paste it on the next line. There will be a lot of it.
    3. On another line underneath, i.e. right at the end, put the following snippet of HTML:
      </script>
  6. Save the workflow.
  7. Click on the workflow in the Toolkit to refresh it.
  8. Buy Stuart some beer next time you see him, e.g. some gueuze, or give him some custom.

Caveats: it is not official and while the script was designed to work on any web page, these things always depend on the approach taken by the encompassing page to be logical and consistent over time, and this can be particularly unpredictable in a CMS, which the Toolkit basically is. I am also unsure of the publisher’s attitude towards dropping Javascript into workflows, although cannot see why there should necessarily be objections to this. Lastly, using this approach also means  removing any existing apparatus of table of contents or links to the top. It would be advisable to back up everything, including the source of generated tocs, although in the worst case, it would probably be possible to move the contents of a workflow to an external file, run the toc script on it, then re-import the HTML source.

Please do let me know if you try this and how you get on. I might be amenable to making changes to it, time and circumstances allowing. Stuart released the original toc script “under an X11 licence. What this boils down to is: do what you like with it. You can use the script in commercial environments, you can use it on your intranet, you can use it anywhere you like.” Sounds good to me too.

Minimising images in a Twitter feed on Firefox

Recent changes to the standard Twitter timeline have resulted in all images in posts being expanded, thereby interrupting the compressed textual display. Here is a simple way to minimise embedded images in posts on a Twitter feed on Firefox. It uses Firefox’s ability to set up a custom stylesheet so that styles can be applied on top of or instead of those supplied by the website’s creator.

  1. Find your Firefox profile folder[*] and look for a folder called chrome. If it’s not there, create it.
  2. In the chrome folder, create a file called userContent.css and open it in a text editor.
  3. Add the following line to the file: a.twitter-timeline-link img {width:15% !important;}
  4. Save userContent.css.
  5. Restart Firefox
  6. Hurrah, hopefully. It works for me.

It should reduce the large images down to a little blob. It’s not the most elegant looking blob, but it’s small and clickable.

[*] The profile folder will normally live somewhere in a path like Appdata\Mozilla\Firefox, at least on Windows.

Red Mason Bee Sealing a Nest

This year I have a bee hotel attached to the house which provides somewhere for solitary bees to nest. The most commonly seen garden solitary bee is the red mason bee (Osmia bicornis) which finds cavities, such as in walls or canes in which to lay its eggs. It adds some pollen for food and seals up the cell with mud.

Yesterday I managed to catch a female red mason bee sealing off one of the tubes in the nest box and took some photos. They are not amazing photos, my main excuses being failing light and rubbish photography skills; I was also watering the garden and getting some washing in at the same time, etc etc. A selection of photos in chronological order are below, with the time taken in the caption.

In the first photo, you can see the female deep inside the tube.

17:10

Twenty minutes later the start of a wall is in place and the bee has gone off to get some more mud.

17:27

A few minutes later and she’s back constructing the wall.

17:29

Again she’s off, and there is now a complete ring.

17:29

Three minutes later and the ring is closing in.

17:32

17:32

The female is back with more mud.

17:33

Now the hole is clearly too small for her to get in or out.

17:34

More work…

17:42

…and the hole is sealed!

17:44

The bee continues to add more mud for a better seal.

17:56

The last photo is from over an hour later and shows the cap jutting out from the wall, not entirely neatly.

19:29

There are now six holes filled up in the bee hotel. I understand that each of the holes will have a number of cells, one in front of the other. Next spring, the small males, whose eggs are laid near the front, will hatch first, followed shortly by the larger females. There are hundreds of sorts of solitary bee in the UK, although only the larger ones will use the bee hotel. I saw some leaf-cutter bees, such as the one below, last year.

Leaf-cutter bee cutting a leaf

They use mashed-up leaf pulp instead of mud to do much the same thing, so I hope they might pop by too.

The BIBFRAME Work

BIBFRAME has worked on modelling works as Works within the BIBFRAME model, similar to the RDA modelling work, itself modelled on the work on the FRBR model of Works and Expressions. A BIBFRAME Work is a creative work, perhaps a FRBR Work, or an RDA FRBR Work but it also expresses a FRBR Expression, and of course an RDA FRBR Expression. A Work may express another Work based on others’ work, not just a FRBR Work or an RDA Work. That also works. FRBR Works or RDA Works expressed as BIBFRAME Works can relate to FRBR Expressions (BIBFRAME Works or RDA Expressions). So, Works are works that can be Works but also Expressions linked to Works that really are Works.

Bumblebees in Sandy, 2012

Following on from my other enthralling posts about grasshoppers and bush-crickets, here is one about bumblebees. I always used to think there were two sorts of bee: honey bees and bumblebees. I later thought there are two sorts of bumblebee: buff-tailed and red-tailed. However, it turns out that there are loads of bumblebees: about 25 species in the UK, although some of them are rare. Like the grasshoppers, bumblebees can be tricky to identify as they vary according to whether they are male or female or what kind of female they are: queen or worker. There are also considerable variations within species while some different species look the same as each other: see the first one below which is impossible to positively identify from a photo, or at least my photo. I got myself an excellent book recommended by Emily Heath* and submitted records to Beewatch, which has tools for identification as well as well as adding to national distribution data. Like the orthoptera scheme they also email you with confirmation of whether you got it right or not. I saw seven confirmed species of bumblebee in Bedfordshire over the summer, six of those in Sandy, and four in the garden.

I have followed the book’s practice of using the scientific name of each species as there is no consistency in common names. And it saves me some hassle. I have also noted whether each species is a social bumblebee (queen, workers, and males living in a nest a bit like a honey bee hive) or a cuckoo bumblebee (only females and males: the females take over social bumblebee nests whose workers raise the cuckoo female’s young). I never dreamt that such things as cuckoo bumblebees existed.

Bombus vestalis or Bombus bohemicus

Bombus vestalis or Bombus bohemicus

Bombus vestalis or Bombus bohemicus

A cuckoo bumblee, but uncertain precisely which species it is. These two species are very difficult to tell apart without catching them and examining them properly. From the photo, the Beewatch people could not be definite which it was. In Sandy, just off Sunderland Road.

Bombus pratorum

Bombus pratorum

Bombus pratorum

A social bumblebee. In Sandy, in the garden.

Bombus terrestris

Bombus terrestris

Bombus terrestris

The buff-tailed bumblebee, a social bumblebee. In Sandy, in the garden.

Bombus rupestris

Bombus rupestris

Bombus rupestris

A cuckoo bumblebee. In Sandy, near the station.

Bombus hypnorum

Bombus hypnorum

Bombus hypnorum

Tree bumblebee, a social bumblebee. First seen in the UK in 2001. In Sandy, in the garden.

Bombus campestris (probably)

Bombus campestris

Bombus campestris

A cuckoo bumblebee. In Willington (between Sandy and Bedford).

Bombus pascuorum

Bombus pascuorum

Bombus pascuorum

Bombus pascuorum male

Bombus pascuorum male

A social bumblebee. In Sandy, in the garden. Beewatch confirmed the first picture and I’m pretty sure about the id for the male (ginger beard and very round body), which makes it the first time I’ve seen a male bee and known it was a male.

* Edwards and Jenner. Field guide to the bumblebees of Great Britain & Ireland. 2005