eader 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +0 -1
- data/README.md +21 -7
- data/lib/eader/document.rb +25 -5
- data/lib/eader/version.rb +1 -1
- data/spec/eader_spec.rb +3 -7
- data/spec/nested_levels_spec.rb +20 -0
- data/spec/support/nested_levels.xml +197 -0
- metadata +6 -2
data/.rspec
CHANGED
data/README.md
CHANGED
@@ -1,24 +1,38 @@
|
|
1
1
|
# Eader
|
2
2
|
|
3
|
-
|
3
|
+
Parse EAD xml easily
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
|
9
|
+
```ruby
|
10
|
+
gem 'eader', '~> 0.0.3'
|
11
|
+
```
|
10
12
|
|
11
13
|
And then execute:
|
12
14
|
|
13
|
-
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
14
18
|
|
15
|
-
|
19
|
+
## Usage
|
16
20
|
|
17
|
-
|
21
|
+
```ruby
|
22
|
+
doc = Eader::Document.new('/path/or/url/to/file.xml')
|
23
|
+
doc.dsc_levels #=> [#<Nokogiri::XML::Element ...>, ...]
|
24
|
+
doc.items #=> [#<Eader::Item ...>, ...]
|
18
25
|
|
19
|
-
## Usage
|
20
26
|
|
21
|
-
|
27
|
+
item = doc.items.first
|
28
|
+
|
29
|
+
item.unitid #=> 'MR-0002'
|
30
|
+
item.origination #=> 'N/A'
|
31
|
+
item.langmaterial #=> 'English'
|
32
|
+
item.unittitle #=> '5 empty loose CD jewel cases [sound recording]'
|
33
|
+
item.unitdate #=> 'Jan 15, 2001'
|
34
|
+
item.unitdate_type #=> 'inclusive'
|
35
|
+
```
|
22
36
|
|
23
37
|
## Contributing
|
24
38
|
|
data/lib/eader/document.rb
CHANGED
@@ -9,14 +9,34 @@ module Eader
|
|
9
9
|
@doc = xml_doc_class.parse(file)
|
10
10
|
end
|
11
11
|
|
12
|
+
def series
|
13
|
+
doc.css('dsc c01').map do |c|
|
14
|
+
if c['level'] == 'series'
|
15
|
+
Item.new(c.css('did'))
|
16
|
+
end
|
17
|
+
end.compact
|
18
|
+
end
|
19
|
+
|
20
|
+
def subseries
|
21
|
+
doc.css('dsc c02').map do |c|
|
22
|
+
if c['level'] == 'subseries'
|
23
|
+
Item.new(c.css('did'))
|
24
|
+
end
|
25
|
+
end.compact
|
26
|
+
end
|
27
|
+
|
12
28
|
def items
|
13
|
-
|
14
|
-
|
29
|
+
@items ||= []
|
30
|
+
|
31
|
+
(1..3).each do |n|
|
32
|
+
doc.css("dsc c0#{n}").map do |c|
|
33
|
+
if c['level'] == 'item'
|
34
|
+
@items << Item.new(c.css('did'))
|
35
|
+
end
|
36
|
+
end
|
15
37
|
end
|
16
|
-
end
|
17
38
|
|
18
|
-
|
19
|
-
doc.css('dsc c01')
|
39
|
+
@items.compact
|
20
40
|
end
|
21
41
|
|
22
42
|
private
|
data/lib/eader/version.rb
CHANGED
data/spec/eader_spec.rb
CHANGED
@@ -5,15 +5,11 @@ describe Eader do
|
|
5
5
|
let(:i) { Eader::Document.new(ENV['REMOTE_URL']) }
|
6
6
|
let(:item) { e.items.first }
|
7
7
|
|
8
|
-
it "returns
|
9
|
-
e.should have(1).
|
8
|
+
it "returns items" do
|
9
|
+
e.should have(1).items
|
10
10
|
|
11
11
|
# checking that remote url works
|
12
|
-
i.should have(4434).
|
13
|
-
end
|
14
|
-
|
15
|
-
it "returns the items" do
|
16
|
-
e.should have(1).items
|
12
|
+
i.should have(4434).items
|
17
13
|
end
|
18
14
|
|
19
15
|
it "returns item unitids" do
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "EAD XML with nested levels" do
|
4
|
+
let(:doc) { Eader::Document.new('./spec/support/nested_levels.xml') }
|
5
|
+
|
6
|
+
it "returns the nested items" do
|
7
|
+
doc.should have(1).items
|
8
|
+
|
9
|
+
i = doc.items.first
|
10
|
+
i.unitid.should == '1_ESS'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "returns the series" do
|
14
|
+
doc.should have(1).series
|
15
|
+
end
|
16
|
+
|
17
|
+
it "returns the subseries" do
|
18
|
+
doc.should have(1).subseries
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<?xml-stylesheet type="text/xsl" href="/assets/eadcbs2.xsl"?>
|
3
|
+
<!DOCTYPE ead PUBLIC "+//ISBN 1-931666-00-8//DTD ead.dtd Encoded Archival Description (EAD) Version 2002//EN" "/assets/ead.dtd">
|
4
|
+
<ead>
|
5
|
+
<eadheader langencoding="iso639-2b" relatedencoding="MARC21" audience="external"
|
6
|
+
countryencoding="iso3166-1" dateencoding="iso8601" repositoryencoding="iso15511"
|
7
|
+
scriptencoding="iso15924">
|
8
|
+
<eadid countrycode="us" mainagencycode="IlChEss" publicid="users/ESS/Documents/ESS_Catalog"> </eadid>
|
9
|
+
<filedesc>
|
10
|
+
<titlestmt>
|
11
|
+
<titleproper encodinganalog="245$a">The Experimental Sound Studio Collection, sound
|
12
|
+
recordings and other material, <date type="incluisve" normal="1986/2007"
|
13
|
+
>1986-2007</date></titleproper>
|
14
|
+
<author encodinganalog="245$c">Experimental Sound Studio</author>
|
15
|
+
</titlestmt>
|
16
|
+
<publicationstmt>
|
17
|
+
<publisher encodinganalog="260$b">Creative Audio Archive (CAA)</publisher>
|
18
|
+
<address>
|
19
|
+
<addressline>5925 N Ravenswood
|
20
|
+
Chicago, IL 60660 </addressline>
|
21
|
+
</address>
|
22
|
+
<date normal="2007" encodinganalog="260$c">2007</date>
|
23
|
+
</publicationstmt>
|
24
|
+
</filedesc>
|
25
|
+
<profiledesc>
|
26
|
+
<creation encodinganalog="500">Finding aid encoded by Farris Wahbeh<date>Date of
|
27
|
+
Encoding</date></creation>
|
28
|
+
<langusage>Finding aid written in<language scriptcode="Zzzz" langcode="eng"
|
29
|
+
encodinganalog="546">English.</language></langusage>
|
30
|
+
</profiledesc>
|
31
|
+
</eadheader>
|
32
|
+
<archdesc relatedencoding="MARC21" level="collection" type="inventory">
|
33
|
+
<did>
|
34
|
+
<head> Collection Summary</head>
|
35
|
+
<repository label="Repository:" encodinganalog="852$a">
|
36
|
+
<corpname>Creative Audio Archive</corpname>
|
37
|
+
<address>
|
38
|
+
<addressline>5925 N. Ravenswood</addressline>
|
39
|
+
<addressline>Chicago, IL 60660</addressline>
|
40
|
+
</address>
|
41
|
+
</repository>
|
42
|
+
<origination label="Creator:" encodinganalog="110">
|
43
|
+
<corpname>Experimental Sound Studio</corpname>
|
44
|
+
</origination>
|
45
|
+
<unittitle label="Title:" encodinganalog="245">Experimental Sound Studio Archive</unittitle>
|
46
|
+
<unitdate normal="1986/2007" type="inclusive" label="Dates:" encodinganalog="245$f"
|
47
|
+
>1986-2007</unitdate>
|
48
|
+
<physdesc label="Quantity:" encodinganalog="300$a">
|
49
|
+
<extent/>
|
50
|
+
</physdesc>
|
51
|
+
<abstract label="Abstract:" encodinganalog="520$a"> </abstract>
|
52
|
+
<unitid label="Identification:" encodinganalog="099" repositorycode="IlChEss"
|
53
|
+
countrycode="us"> </unitid>
|
54
|
+
<langmaterial encodinganalog="546$a">Records primarily in<lang>English</lang></langmaterial>
|
55
|
+
<materialspec label="physical presentation data">
|
56
|
+
<materialspec label="Carrier">Digital and Analog</materialspec>
|
57
|
+
<note>
|
58
|
+
<p>All the sound recordings were transferred from original source material in
|
59
|
+
digital and analog formats. Original master recordings were transferred as
|
60
|
+
48 KHZ/24-bit flat, unprocessed WAV files. Listening copies are available in
|
61
|
+
MP3 format derived from the transferred WAV files.</p>
|
62
|
+
</note>
|
63
|
+
</materialspec>
|
64
|
+
</did>
|
65
|
+
<bioghist encodinganalog="545">
|
66
|
+
<head>Administrative History</head>
|
67
|
+
<p>Experimental Sound Studio (ESS) is a non-profit organization founded in 1986 for the
|
68
|
+
production, promotion, presentation, and preservation of diverse and innovative
|
69
|
+
approaches to the sonic arts, and for the integration of these art forms into the
|
70
|
+
community at large.</p>
|
71
|
+
<p>ESS engages in organizational collaborations and support services for artists’,
|
72
|
+
educational, and community projects. These take the form of workshops with community
|
73
|
+
organizations, collaborations with media arts organizations, radio broadcasts of
|
74
|
+
artists’ projects, exhibitions of sound installations, and audio art projects in
|
75
|
+
schools. Throughout the years, these collaborations have included Chicago
|
76
|
+
Filmmakers, Chicago Arts Partnerships in Education, Forum Alternative High School,
|
77
|
+
Rock For Kids, and many others.</p>
|
78
|
+
</bioghist>
|
79
|
+
<scopecontent encodinganalog="520">
|
80
|
+
<head>Scope and Contents</head>
|
81
|
+
<p> The ESS collection contains material that are related to artistic, educational, and
|
82
|
+
public programming that the organization initiated and developed. The collection
|
83
|
+
does not include works created by clients or members who used ESS facilities. Sound
|
84
|
+
recordings that comprise the collection were recorded and collected by staff since
|
85
|
+
the inception of the organization in 1986. As an organizational archive, the
|
86
|
+
collection will continue to grow as new programs are effectuated.</p>
|
87
|
+
</scopecontent>
|
88
|
+
<arrangement encodinganalog="351">
|
89
|
+
<head>Arrangement of the Sound Recordings</head>
|
90
|
+
<p>The collection is arranged chronologically by project. All accession numbers are
|
91
|
+
temporary and subject to change as the processing and transferring of the collection
|
92
|
+
continues.</p>
|
93
|
+
</arrangement>
|
94
|
+
<accessrestrict encodinganalog="506">
|
95
|
+
<head>Restrictions on Access</head>
|
96
|
+
<p>Material is available to interested researchers by appointment.</p>
|
97
|
+
</accessrestrict>
|
98
|
+
<userestrict encodinganalog="540">
|
99
|
+
<head>Restrictions on Use</head>
|
100
|
+
<p>All material is copyright restricted to the individual artists that appear in the
|
101
|
+
recordings. </p>
|
102
|
+
</userestrict>
|
103
|
+
<controlaccess>
|
104
|
+
<head> Index Terms</head>
|
105
|
+
<p/>
|
106
|
+
<controlaccess>
|
107
|
+
<head>Organizations:</head>
|
108
|
+
<corpname encodinganalog="710">Experimental Sound Studio</corpname>
|
109
|
+
</controlaccess>
|
110
|
+
<controlaccess>
|
111
|
+
<head>Subjects:</head>
|
112
|
+
<subject source="lcsh" encodinganalog="650">Avant-garde (Music)</subject>
|
113
|
+
<subject source="lcsh" encodinganalog="650">Improvisation (Music)</subject>
|
114
|
+
<subject source="lcsh" encodinganalog="650">Art and Music</subject>
|
115
|
+
<subject source="lcsh" encodinganalog="650">Soundscapes (Music)</subject>
|
116
|
+
</controlaccess>
|
117
|
+
<controlaccess>
|
118
|
+
<head>Places:</head>
|
119
|
+
<geogname source="lcnaf" encodinganalog="651">Chicago</geogname>
|
120
|
+
</controlaccess>
|
121
|
+
<controlaccess>
|
122
|
+
<head> Document Types:</head>
|
123
|
+
<genreform source="aat" encodinganalog="655"> </genreform>
|
124
|
+
</controlaccess>
|
125
|
+
</controlaccess>
|
126
|
+
<phystech>
|
127
|
+
<head>Physical Characteristics and Technical Requirements</head>
|
128
|
+
<p/>
|
129
|
+
</phystech>
|
130
|
+
<processinfo encodinganalog="583">
|
131
|
+
<head>Processing Information</head>
|
132
|
+
<p/>
|
133
|
+
</processinfo>
|
134
|
+
<accruals encodinganalog="584">
|
135
|
+
<head>Accruals</head>
|
136
|
+
<p>New material, including events, performances, and workshops, related directly to the
|
137
|
+
Experimental Sound Studio will be accessioned after approvel of Executive Director
|
138
|
+
and Archive Manager. These will be added to the finding aid using the same
|
139
|
+
organizational system.</p>
|
140
|
+
</accruals>
|
141
|
+
<appraisal>
|
142
|
+
<p>Given the extensive nature of the ESS collection, only original materials, including
|
143
|
+
source material used for final versions of an event, will be retained. Any duplicate
|
144
|
+
copies or extraneous material will be excised from the collection. The Executive
|
145
|
+
Director in consultation with the Archive Manager will carry out appraisal
|
146
|
+
decisions.</p>
|
147
|
+
</appraisal>
|
148
|
+
<dsc type="combined">
|
149
|
+
<head>Detailed Description of the Collection</head>
|
150
|
+
<p/>
|
151
|
+
<c01 level="series">
|
152
|
+
<did>
|
153
|
+
<unittitle>Audio Recordings,1986-1999</unittitle>
|
154
|
+
<unitdate type="inclusive" encodinganalog="260">1986-1999</unitdate>
|
155
|
+
</did>
|
156
|
+
<c02 level="subseries">
|
157
|
+
<did>
|
158
|
+
<head>
|
159
|
+
<unittitle>Performance</unittitle>
|
160
|
+
</head>
|
161
|
+
</did>
|
162
|
+
<c03 level="item">
|
163
|
+
<did>
|
164
|
+
<unitid countrycode="iso3166-1" repositorycode="iso15511">1_ESS</unitid>
|
165
|
+
<origination>ESS</origination>
|
166
|
+
<langmaterial>English</langmaterial>
|
167
|
+
<unittitle>The Sound Show</unittitle>
|
168
|
+
<unitdate type="inclusive" normal="19860614/19860718"
|
169
|
+
>1986.06.14-1986.07.18</unitdate>
|
170
|
+
<physdesc/>
|
171
|
+
<physdesc/>
|
172
|
+
<physdesc/>
|
173
|
+
</did>
|
174
|
+
<scopecontent>
|
175
|
+
<persname role="creator" encodinganalog="100">Nancy Bechtol, Gene
|
176
|
+
Coleman, Kevin Huotari, Eric Leonardson, Maria Lovullo, Larry
|
177
|
+
Lundy/Susanne Suffredin, Don Meckley, Lou Mallozzi, Dan Richardson,
|
178
|
+
Marc Siemer, Jack Urban, Perry Venson</persname>
|
179
|
+
<p>Randolph Street Gallery</p>
|
180
|
+
<p>[Insert performance information]</p>
|
181
|
+
</scopecontent>
|
182
|
+
<note>
|
183
|
+
<p>The Sound Show is the first exhibition in a new program at Randolph
|
184
|
+
Street Gallery devoted to sound art and new music. This program is
|
185
|
+
producd in colloboration with the Experimental Sound Studio, a
|
186
|
+
recently formed group dedicated to producing and promoting sound
|
187
|
+
art. Randolph Street Gallery celebrates this important new
|
188
|
+
collobration with this exhibit and a concurrent five=week long
|
189
|
+
schedule of new music performances. [Performance documentation] </p>
|
190
|
+
</note>
|
191
|
+
<userestrict>Material is copyright of respective artists.</userestrict>
|
192
|
+
</c03>
|
193
|
+
</c02>
|
194
|
+
</c01>
|
195
|
+
</dsc>
|
196
|
+
</archdesc>
|
197
|
+
</ead>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -47,7 +47,9 @@ files:
|
|
47
47
|
- lib/eader/item.rb
|
48
48
|
- lib/eader/version.rb
|
49
49
|
- spec/eader_spec.rb
|
50
|
+
- spec/nested_levels_spec.rb
|
50
51
|
- spec/spec_helper.rb
|
52
|
+
- spec/support/nested_levels.xml
|
51
53
|
- spec/support/test.xml
|
52
54
|
homepage: ''
|
53
55
|
licenses: []
|
@@ -75,5 +77,7 @@ specification_version: 3
|
|
75
77
|
summary: Parse ead documents
|
76
78
|
test_files:
|
77
79
|
- spec/eader_spec.rb
|
80
|
+
- spec/nested_levels_spec.rb
|
78
81
|
- spec/spec_helper.rb
|
82
|
+
- spec/support/nested_levels.xml
|
79
83
|
- spec/support/test.xml
|