1
- = ruby-oai
2
-
3
- == DESCRIPTION
4
-
5
- ruby-oai is a Open Archives Protocol for Metadata Harvesting (OAI-PMH[http://openarchives.org])
6
- library for Ruby. If you're not familiar with OAI-PMH[http://openarchives.org] it is the most used
7
- protocol for sharing metadata between digital library repositories.
8
-
9
- The OAI-PMH[http://openarchives.org] spec defines six verbs (Identify, ListIdentifiers, ListRecords,
1
+ ``` _ _
2
+ _ __ _ _| |__ _ _ ___ __ _(_)
3
+ | '__| | | | '_ \| | | |_____ / _ \ / _` | |
4
+ | | | |_| | |_) | |_| |_____| (_) | (_| | |
5
+ |_| \__,_|_.__/ \__, | \___/ \__,_|_|
6
+ |___/
7
+ ```
8
+
9
+ ruby-oai is a Open Archives Protocol for Metadata Harvesting (OAI-PMH)
10
+ library for Ruby. OAI-PMH[ http://openarchives.org ] it is a somewhat
11
+ archaic protocol for sharing metadata between digital library repositories.
12
+ If you are looking to share metadata on the web you are probably better off
13
+ using a feed format like RSS or Atom. If have to work with a backwards
14
+ digital repository that only offers OAI-PMH access then ruby-oai is your
15
+ friend.
16
+
17
+ The [ OAI-PMH] ( http://openarchives.org ) spec defines six verbs (Identify, ListIdentifiers, ListRecords,
10
18
GetRecords, ListSets, ListMetadataFormat) used for discovery and sharing of
11
19
metadata.
12
20
13
21
The ruby-oai gem includes a client library, a server/provider library and
14
22
a interactive harvesting shell.
15
23
16
- === client
24
+ Client
25
+ ------
17
26
18
27
The OAI client library is used for harvesting metadata from repositories.
19
28
For example to initiate a ListRecords request to pubmed you can:
20
29
30
+ ``` ruby
21
31
require ' oai'
22
32
client = OAI ::Client .new ' http://www.pubmedcentral.gov/oai/oai.cgi'
23
33
for record in client.list_records
24
34
puts record.metadata
25
35
end
36
+ ```
26
37
27
38
See OAI::Client for more details
28
39
29
- === provider
40
+ Server
41
+ ------
30
42
31
- The OAI provider library handles serving local content to other clients.
32
-
33
- Setting up a simple provider:
43
+ The OAI provider library handles serving local content to other clients. Here's how to set up a simple provider:
34
44
45
+ ``` ruby
35
46
class MyProvider < Oai ::Provider
36
47
repository_name ' My little OAI provider'
37
48
repository_url ' http://localhost/provider'
38
49
record_prefix ' oai:localhost'
39
50
admin_email ' root@localhost' # String or Array
40
51
source_model MyModel .new # Subclass of OAI::Provider::Model
41
52
end
53
+ ```
42
54
43
55
See OAI::Provider for more details
44
56
45
- === interactive harvester
57
+ Interactive Harvester
58
+ ---------------------
46
59
47
60
The OAI-PMH[ http://openarchives.org ] client shell allows OAI Harvesting to be configured in
48
61
an interactive manner. Typing 'oai' on the command line starts the
@@ -53,7 +66,8 @@ operations.
53
66
54
67
See OAI::Harvester::Shell for more details
55
68
56
- == INSTALLATION
69
+ Installation
70
+ ------------
57
71
58
72
Normally the best way to install oai is from rubyforge using the gem
59
73
command line tool:
@@ -68,14 +82,15 @@ So you'll need to:
68
82
69
83
Where x.y.z is the version of the gem that was generated.
70
84
71
- == TODO
85
+ License
86
+ -------
87
+
88
+ [ Public Domain] ( http://creativecommons.org/publicdomain/zero/1.0/ )
72
89
73
- * consolidate response classes used by provider and client
74
- * automatic validation of metadata schemas
75
- * email the authors with your suggestions
90
+ Authors
91
+ -------
76
92
77
- == AUTHORS
93
+
94
+ * William Groppe <
[email protected] >
95
+
78
96
79
-
80
- - William Groppe <
[email protected] >
81
-
0 commit comments