Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Hvordan sette opp en OAI-PMH metadata-innhøster
1. Hvordan sette opp en OAI-PMH
metadata-innhøster
(PKP Open Archives Harvester)
Magnus Enger
Biblioteklaboratorie-workshop
Bergen, 12. - 13. november 2007
2.
3.
4. System Requirements
● PHP >= 4.2.x (including PHP 5.x); Microsoft IIS
requires PHP 5.x
● MySQL >= 3.23.23 (including MySQL 4.x/5.x)
or PostgreSQL >= 7.1 (including PostgreSQL
8.x)
● Apache >= 1.3.2x or >= 2.0.4x or Microsoft IIS
6 (untested)
● Operating system: Any OS that supports the
above software, including Linux, BSD, Solaris,
Mac OS X, Windows
7. Med SSH (PuTTY)/Telnet
● Logg på serveren
● Last ned fila
$ wget http://pkp.sfu.ca/harvester2/download/harvester-2.0.1.tar.gz
● Pakk ut fila
$ tar -xvf harvester-2.0.1.tar.gz
● Gå inn i mappa
$ cd harvester-2.0.1
● Flytt innholdet til ønsket plass
$ mv * ~/subdomener/harvester/
8. Med FTP
● Last ned fila til lokal maskin
● Pakk ut fila
● Logg på server med FTP-klient
● Last opp de utpakkede filene til ønsket plass på
serveren
11. Endre filrettigheter
● Gjør følgende filer/mapper skrivbare:
– config.inc.php (optional -- if not writable you will be
prompted to manually overwrite this file during
installation)
– public
– cache
– cache/t_cache
– cache/t_config
– cache/t_compile
– cache/_db
12. Lag opplastingsmappe
● Lag en mappe for å lagre opplastede filer,
gjerne utenfor server-rota
● Gjør denne mappa skrivbar
13. Installasjon
● Via vevleser
– http://yourdomain.com/path/to/harvester2/
● Eller vi kommandolinja
– php tools/install.php
14.
15. Rediger fila config.inc.php
; Use URL parameters instead of CGI PATH_INFO. This is useful for
; broken server setups that don't support the PATH_INFO environment
; variable.
disable_path_info = Off
Endre siste linja til:
disable_path_info = On
16.
17.
18.
19.
20.
21. Problem
● «login»:
http://harvester.collib.info/index.php/login
● Viser bare forsiden
● Klikk på «HOME»:
http://harvester.collib.info/index.php?page=index
● Gå til URLen:
http://harvester.collib.info/index.php?page=login
22.
23.
24.
25.
26. Hvordan finne høstbare arkiver?
● «Registered Data Providers» fra OAI:
http://www.openarchives.org/Register/BrowseSites
31. Sets
● Document types
● Frequent occurrences of languages in the
database
● Documents where online fulltext-versions are
available
● Units at the university
35. Units at the university
● Humanities(2437)
● HumanitiesMedia and Communication(358)
● HumanitiesMedia and CommunicationMedia
studies(331)
● HumanitiesMedia and
CommunicationJournalism(23)
● HumanitiesArcheology, Conservation and
Historical Studies(459)
40. Nyttige «kommandoer»
● php harvest.php
– lister opp diverse opsjoner
● php harvest.php list
– liste over arkivene
● php harvest.php 1
– Høster metadata fra ett arkiv, tallet tilsvarer tallet i
lista over
● php harvest.php 1 verbose
– Som over, men med detaljerte meldinger om
fremdriften
41.
42. Flere nyttige «kommandoer»
● php harvest.php all
– Høster data fra alle arkivene
● php harvest.php all from=last
– Høster alle nye metadata siden sist innhøsting
– Kjør denne jevnlig ved hjelp av cron!
45. Tabell: entries
mysql> describe entries;
+--------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------+------+-----+---------+----------------+
| entry_id | int(11) | | PRI | NULL | auto_increment |
| record_id | int(11) | | MUL | 0 | |
| raw_field_id | int(11) | | MUL | 0 | |
| value | text | YES | | NULL | |
+--------------+---------+------+-----+---------+----------------+
46. Tabell: raw_fields
mysql> describe raw_fields;
+------------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+-------------+------+-----+---------+----------------+
| raw_field_id | int(11) | | PRI | NULL | auto_increment |
| name | varchar(60) | | MUL | | |
| schema_plugin_id | int(11) | | | 0 | |
+------------------+-------------+------+-----+---------+----------------+
47. Strukturen til en «record»
● Record
– Entry a
● raw_field_id = x
– raw_fields name = 'Title'
● value = 'Kasus før og nå'
– Entry b
● raw_field_id = y
– raw_fields name = 'Author'
● value = 'Hansen, Hans'
– Entry c
● raw_field_id = z
– raw_fields name = 'Publisher'
● value = 'Universitetet i Bodø'