locabulary 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ba56a663777314e577a9c49f8765f2e934c87ff4
4
+ data.tar.gz: e47ec0341f44ec3f473e94c0643a87d650102c0f
5
+ SHA512:
6
+ metadata.gz: 6bb015e20533cdc67c9b2c1ec0f1e6fca793229ed80d23e634199124f0c731f2f2b7926e5098dc1dfdf8ef2d2c5e9029352c02a93db41e775616f9cd65c97696
7
+ data.tar.gz: d2da67ae244f0a4be2b386839f09a47b29b0d426b72a0aa8723077094cb54c89d0d7306faf087ad99481ff03a2d286845262db64bc98c3bb5366e4bf383ed0ab
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
@@ -0,0 +1,14 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct.
10
+ Project maintainers who do not follow the Code of Conduct may be removed from the project team.
11
+
12
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
13
+
14
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vocabulary.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ ##########################################################################
2
+ # Copyright 2015 University of Notre Dame
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
data/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Locabulary
2
+
3
+ An extraction of limited localized vocabulary for Sipity and CurateND.
4
+ This controlled vocabulary has a limited shelf-life as we explore other more
5
+ robust options.
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rake/testtask'
4
+
5
+ Rake::TestTask.new do |t|
6
+ t.test_files = Dir.glob('test/**/*_test.rb')
7
+ end
8
+
9
+ task(default: :test)
@@ -0,0 +1,26 @@
1
+ [
2
+ {
3
+ "predicate_name": "award_category",
4
+ "term_label": "10000 Level Papers",
5
+ "term_uri": null,
6
+ "default_presentation_sequence": null,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "award_category",
12
+ "term_label": "2000–4000 Level Papers",
13
+ "term_uri": null,
14
+ "default_presentation_sequence": null,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "award_category",
20
+ "term_label": "Senior/Honors Thesis",
21
+ "term_uri": null,
22
+ "default_presentation_sequence": null,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ }
26
+ ]
@@ -0,0 +1,26 @@
1
+ [
2
+ {
3
+ "predicate_name": "citation_style",
4
+ "term_label": "American Psychological Association",
5
+ "term_uri": "APA",
6
+ "default_presentation_sequence": null,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "citation_style",
12
+ "term_label": "Chicago Manual of Style",
13
+ "term_uri": "Chicago",
14
+ "default_presentation_sequence": null,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "citation_style",
20
+ "term_label": "Modern Language Association",
21
+ "term_uri": "MLA",
22
+ "default_presentation_sequence": null,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ }
26
+ ]
@@ -0,0 +1,74 @@
1
+ [
2
+ {
3
+ "predicate_name": "copyright",
4
+ "term_label": "All rights reserved",
5
+ "term_uri": "All rights reserved",
6
+ "default_presentation_sequence": null,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "copyright",
12
+ "term_label": "Attribution 3.0 United States",
13
+ "term_uri": "http://creativecommons.org/licenses/by/3.0/us/",
14
+ "default_presentation_sequence": null,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "copyright",
20
+ "term_label": "Attribution-NoDerivs 3.0 United States",
21
+ "term_uri": "http://creativecommons.org/licenses/by-nd/3.0/us/",
22
+ "default_presentation_sequence": null,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ },
26
+ {
27
+ "predicate_name": "copyright",
28
+ "term_label": "Attribution-NonCommercial 3.0 United States",
29
+ "term_uri": "http://creativecommons.org/licenses/by-nc/3.0/us/",
30
+ "default_presentation_sequence": null,
31
+ "activated_on": "2015-01-01",
32
+ "deactivated_on": null
33
+ },
34
+ {
35
+ "predicate_name": "copyright",
36
+ "term_label": "Attribution-NonCommercial-NoDerivs 3.0 United States",
37
+ "term_uri": "http://creativecommons.org/licenses/by-nc-nd/3.0/us/",
38
+ "default_presentation_sequence": null,
39
+ "activated_on": "2015-01-01",
40
+ "deactivated_on": null
41
+ },
42
+ {
43
+ "predicate_name": "copyright",
44
+ "term_label": "Attribution-NonCommercial-ShareAlike 3.0 United States",
45
+ "term_uri": "http://creativecommons.org/licenses/by-nc-sa/3.0/us/",
46
+ "default_presentation_sequence": null,
47
+ "activated_on": "2015-01-01",
48
+ "deactivated_on": null
49
+ },
50
+ {
51
+ "predicate_name": "copyright",
52
+ "term_label": "Attribution-ShareAlike 3.0 United States",
53
+ "term_uri": "http://creativecommons.org/licenses/by-sa/3.0/us/",
54
+ "default_presentation_sequence": null,
55
+ "activated_on": "2015-01-01",
56
+ "deactivated_on": null
57
+ },
58
+ {
59
+ "predicate_name": "copyright",
60
+ "term_label": "CC0 1.0 Universal",
61
+ "term_uri": "http://creativecommons.org/publicdomain/zero/1.0/",
62
+ "default_presentation_sequence": null,
63
+ "activated_on": "2015-01-01",
64
+ "deactivated_on": null
65
+ },
66
+ {
67
+ "predicate_name": "copyright",
68
+ "term_label": "Public Domain Mark 1.0",
69
+ "term_uri": "http://creativecommons.org/publicdomain/mark/1.0/",
70
+ "default_presentation_sequence": null,
71
+ "activated_on": "2015-01-01",
72
+ "deactivated_on": null
73
+ }
74
+ ]
data/data/degree.json ADDED
@@ -0,0 +1,138 @@
1
+ [
2
+ {
3
+ "predicate_name": "degree",
4
+ "term_label": "Doctor of Musical Arts",
5
+ "term_uri": null,
6
+ "default_presentation_sequence": null,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "degree",
12
+ "term_label": "Doctor of Philosophy",
13
+ "term_uri": null,
14
+ "default_presentation_sequence": null,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "degree",
20
+ "term_label": "Master of Arts",
21
+ "term_uri": null,
22
+ "default_presentation_sequence": null,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ },
26
+ {
27
+ "predicate_name": "degree",
28
+ "term_label": "Master of Fine Arts",
29
+ "term_uri": null,
30
+ "default_presentation_sequence": null,
31
+ "activated_on": "2015-01-01",
32
+ "deactivated_on": null
33
+ },
34
+ {
35
+ "predicate_name": "degree",
36
+ "term_label": "Master of Medieval Studies",
37
+ "term_uri": null,
38
+ "default_presentation_sequence": null,
39
+ "activated_on": "2015-01-01",
40
+ "deactivated_on": null
41
+ },
42
+ {
43
+ "predicate_name": "degree",
44
+ "term_label": "Master of Science",
45
+ "term_uri": null,
46
+ "default_presentation_sequence": null,
47
+ "activated_on": "2015-01-01",
48
+ "deactivated_on": null
49
+ },
50
+ {
51
+ "predicate_name": "degree",
52
+ "term_label": "Master of Science in Aerospace Engineering",
53
+ "term_uri": null,
54
+ "default_presentation_sequence": null,
55
+ "activated_on": "2015-01-01",
56
+ "deactivated_on": null
57
+ },
58
+ {
59
+ "predicate_name": "degree",
60
+ "term_label": "Master of Science in Bioengineering",
61
+ "term_uri": null,
62
+ "default_presentation_sequence": null,
63
+ "activated_on": "2015-01-01",
64
+ "deactivated_on": null
65
+ },
66
+ {
67
+ "predicate_name": "degree",
68
+ "term_label": "Master of Science in Chemical Engineering",
69
+ "term_uri": null,
70
+ "default_presentation_sequence": null,
71
+ "activated_on": "2015-01-01",
72
+ "deactivated_on": null
73
+ },
74
+ {
75
+ "predicate_name": "degree",
76
+ "term_label": "Master of Science in Civil Engineering",
77
+ "term_uri": null,
78
+ "default_presentation_sequence": null,
79
+ "activated_on": "2015-01-01",
80
+ "deactivated_on": null
81
+ },
82
+ {
83
+ "predicate_name": "degree",
84
+ "term_label": "Master of Science in Computer Science and Engineering",
85
+ "term_uri": null,
86
+ "default_presentation_sequence": null,
87
+ "activated_on": "2015-01-01",
88
+ "deactivated_on": null
89
+ },
90
+ {
91
+ "predicate_name": "degree",
92
+ "term_label": "Master of Science in Earth Sciences",
93
+ "term_uri": null,
94
+ "default_presentation_sequence": null,
95
+ "activated_on": "2015-01-01",
96
+ "deactivated_on": null
97
+ },
98
+ {
99
+ "predicate_name": "degree",
100
+ "term_label": "Master of Science in Electrical Engineering",
101
+ "term_uri": null,
102
+ "default_presentation_sequence": null,
103
+ "activated_on": "2015-01-01",
104
+ "deactivated_on": null
105
+ },
106
+ {
107
+ "predicate_name": "degree",
108
+ "term_label": "Master of Science in Environmental Engineering",
109
+ "term_uri": null,
110
+ "default_presentation_sequence": null,
111
+ "activated_on": "2015-01-01",
112
+ "deactivated_on": null
113
+ },
114
+ {
115
+ "predicate_name": "degree",
116
+ "term_label": "Master of Science in Geological Sciences",
117
+ "term_uri": null,
118
+ "default_presentation_sequence": null,
119
+ "activated_on": "2015-01-01",
120
+ "deactivated_on": null
121
+ },
122
+ {
123
+ "predicate_name": "degree",
124
+ "term_label": "Master of Science in Interdisciplinary Mathematics",
125
+ "term_uri": null,
126
+ "default_presentation_sequence": null,
127
+ "activated_on": "2015-01-01",
128
+ "deactivated_on": null
129
+ },
130
+ {
131
+ "predicate_name": "degree",
132
+ "term_label": "Master of Science in Mechanical Engineering",
133
+ "term_uri": null,
134
+ "default_presentation_sequence": null,
135
+ "activated_on": "2015-01-01",
136
+ "deactivated_on": null
137
+ }
138
+ ]
@@ -0,0 +1,258 @@
1
+ [
2
+ {
3
+ "predicate_name": "program_name",
4
+ "term_label": "Aerospace and Mechanical Engineering",
5
+ "term_uri": null,
6
+ "default_presentation_sequence": null,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "program_name",
12
+ "term_label": "Anthropology",
13
+ "term_uri": null,
14
+ "default_presentation_sequence": null,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "program_name",
20
+ "term_label": "Applied and Computational Mathematics and Statistics",
21
+ "term_uri": null,
22
+ "default_presentation_sequence": null,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ },
26
+ {
27
+ "predicate_name": "program_name",
28
+ "term_label": "Art, Art History, and Design",
29
+ "term_uri": null,
30
+ "default_presentation_sequence": null,
31
+ "activated_on": "2015-01-01",
32
+ "deactivated_on": null
33
+ },
34
+ {
35
+ "predicate_name": "program_name",
36
+ "term_label": "Bioengineering",
37
+ "term_uri": null,
38
+ "default_presentation_sequence": null,
39
+ "activated_on": "2015-01-01",
40
+ "deactivated_on": null
41
+ },
42
+ {
43
+ "predicate_name": "program_name",
44
+ "term_label": "Biological Sciences",
45
+ "term_uri": null,
46
+ "default_presentation_sequence": null,
47
+ "activated_on": "2015-01-01",
48
+ "deactivated_on": null
49
+ },
50
+ {
51
+ "predicate_name": "program_name",
52
+ "term_label": "Chemical and Biomolecular Engineering",
53
+ "term_uri": null,
54
+ "default_presentation_sequence": null,
55
+ "activated_on": "2015-01-01",
56
+ "deactivated_on": null
57
+ },
58
+ {
59
+ "predicate_name": "program_name",
60
+ "term_label": "Chemistry",
61
+ "term_uri": null,
62
+ "default_presentation_sequence": null,
63
+ "activated_on": "2015-01-01",
64
+ "deactivated_on": null
65
+ },
66
+ {
67
+ "predicate_name": "program_name",
68
+ "term_label": "Civil and Environmental Engineering and Earth Sciences",
69
+ "term_uri": null,
70
+ "default_presentation_sequence": null,
71
+ "activated_on": "2015-01-01",
72
+ "deactivated_on": null
73
+ },
74
+ {
75
+ "predicate_name": "program_name",
76
+ "term_label": "Classics",
77
+ "term_uri": null,
78
+ "default_presentation_sequence": null,
79
+ "activated_on": "2015-01-01",
80
+ "deactivated_on": null
81
+ },
82
+ {
83
+ "predicate_name": "program_name",
84
+ "term_label": "Computer Science and Engineering",
85
+ "term_uri": null,
86
+ "default_presentation_sequence": null,
87
+ "activated_on": "2015-01-01",
88
+ "deactivated_on": null
89
+ },
90
+ {
91
+ "predicate_name": "program_name",
92
+ "term_label": "Creative Writing",
93
+ "term_uri": null,
94
+ "default_presentation_sequence": null,
95
+ "activated_on": "2015-01-01",
96
+ "deactivated_on": null
97
+ },
98
+ {
99
+ "predicate_name": "program_name",
100
+ "term_label": "Early Christian Studies",
101
+ "term_uri": null,
102
+ "default_presentation_sequence": null,
103
+ "activated_on": "2015-01-01",
104
+ "deactivated_on": null
105
+ },
106
+ {
107
+ "predicate_name": "program_name",
108
+ "term_label": "Economics",
109
+ "term_uri": null,
110
+ "default_presentation_sequence": null,
111
+ "activated_on": "2015-01-01",
112
+ "deactivated_on": null
113
+ },
114
+ {
115
+ "predicate_name": "program_name",
116
+ "term_label": "Electrical Engineering",
117
+ "term_uri": null,
118
+ "default_presentation_sequence": null,
119
+ "activated_on": "2015-01-01",
120
+ "deactivated_on": null
121
+ },
122
+ {
123
+ "predicate_name": "program_name",
124
+ "term_label": "English",
125
+ "term_uri": null,
126
+ "default_presentation_sequence": null,
127
+ "activated_on": "2015-01-01",
128
+ "deactivated_on": null
129
+ },
130
+ {
131
+ "predicate_name": "program_name",
132
+ "term_label": "History",
133
+ "term_uri": null,
134
+ "default_presentation_sequence": null,
135
+ "activated_on": "2015-01-01",
136
+ "deactivated_on": null
137
+ },
138
+ {
139
+ "predicate_name": "program_name",
140
+ "term_label": "History and Philosophy of Science",
141
+ "term_uri": null,
142
+ "default_presentation_sequence": null,
143
+ "activated_on": "2015-01-01",
144
+ "deactivated_on": null
145
+ },
146
+ {
147
+ "predicate_name": "program_name",
148
+ "term_label": "Integrated Biomedical Sciences",
149
+ "term_uri": null,
150
+ "default_presentation_sequence": null,
151
+ "activated_on": "2015-01-01",
152
+ "deactivated_on": null
153
+ },
154
+ {
155
+ "predicate_name": "program_name",
156
+ "term_label": "Law",
157
+ "term_uri": null,
158
+ "default_presentation_sequence": null,
159
+ "activated_on": "2015-01-01",
160
+ "deactivated_on": null
161
+ },
162
+ {
163
+ "predicate_name": "program_name",
164
+ "term_label": "Literature",
165
+ "term_uri": null,
166
+ "default_presentation_sequence": null,
167
+ "activated_on": "2015-01-01",
168
+ "deactivated_on": null
169
+ },
170
+ {
171
+ "predicate_name": "program_name",
172
+ "term_label": "Mathematics",
173
+ "term_uri": null,
174
+ "default_presentation_sequence": null,
175
+ "activated_on": "2015-01-01",
176
+ "deactivated_on": null
177
+ },
178
+ {
179
+ "predicate_name": "program_name",
180
+ "term_label": "Medieval Studies",
181
+ "term_uri": null,
182
+ "default_presentation_sequence": null,
183
+ "activated_on": "2015-01-01",
184
+ "deactivated_on": null
185
+ },
186
+ {
187
+ "predicate_name": "program_name",
188
+ "term_label": "Peace Studies",
189
+ "term_uri": null,
190
+ "default_presentation_sequence": null,
191
+ "activated_on": "2015-01-01",
192
+ "deactivated_on": null
193
+ },
194
+ {
195
+ "predicate_name": "program_name",
196
+ "term_label": "Philosophy",
197
+ "term_uri": null,
198
+ "default_presentation_sequence": null,
199
+ "activated_on": "2015-01-01",
200
+ "deactivated_on": null
201
+ },
202
+ {
203
+ "predicate_name": "program_name",
204
+ "term_label": "Physics",
205
+ "term_uri": null,
206
+ "default_presentation_sequence": null,
207
+ "activated_on": "2015-01-01",
208
+ "deactivated_on": null
209
+ },
210
+ {
211
+ "predicate_name": "program_name",
212
+ "term_label": "Political Science",
213
+ "term_uri": null,
214
+ "default_presentation_sequence": null,
215
+ "activated_on": "2015-01-01",
216
+ "deactivated_on": null
217
+ },
218
+ {
219
+ "predicate_name": "program_name",
220
+ "term_label": "Psychology",
221
+ "term_uri": null,
222
+ "default_presentation_sequence": null,
223
+ "activated_on": "2015-01-01",
224
+ "deactivated_on": null
225
+ },
226
+ {
227
+ "predicate_name": "program_name",
228
+ "term_label": "Romance Languages and Literatures",
229
+ "term_uri": null,
230
+ "default_presentation_sequence": null,
231
+ "activated_on": "2015-01-01",
232
+ "deactivated_on": null
233
+ },
234
+ {
235
+ "predicate_name": "program_name",
236
+ "term_label": "Sacred Music",
237
+ "term_uri": null,
238
+ "default_presentation_sequence": null,
239
+ "activated_on": "2015-01-01",
240
+ "deactivated_on": null
241
+ },
242
+ {
243
+ "predicate_name": "program_name",
244
+ "term_label": "Sociology",
245
+ "term_uri": null,
246
+ "default_presentation_sequence": null,
247
+ "activated_on": "2015-01-01",
248
+ "deactivated_on": null
249
+ },
250
+ {
251
+ "predicate_name": "program_name",
252
+ "term_label": "Theology",
253
+ "term_uri": null,
254
+ "default_presentation_sequence": null,
255
+ "activated_on": "2015-01-01",
256
+ "deactivated_on": null
257
+ }
258
+ ]
@@ -0,0 +1,50 @@
1
+ [
2
+ {
3
+ "predicate_name": "resource_consulted",
4
+ "term_label": "Consultation with a librarian",
5
+ "term_uri": "Consultation with a librarian",
6
+ "default_presentation_sequence": null,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "resource_consulted",
12
+ "term_label": "Databases accessed via Hesburgh Libraries",
13
+ "term_uri": "Databases accessed via Hesburgh Libraries",
14
+ "default_presentation_sequence": null,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "resource_consulted",
20
+ "term_label": "Electronic journals",
21
+ "term_uri": "Electronic journals",
22
+ "default_presentation_sequence": null,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ },
26
+ {
27
+ "predicate_name": "resource_consulted",
28
+ "term_label": "Hesburgh Libraries Rare Books and Special Collections and/or Archives",
29
+ "term_uri": "Hesburgh Libraries Rare Books and Special Collections and/or Archives",
30
+ "default_presentation_sequence": null,
31
+ "activated_on": "2015-01-01",
32
+ "deactivated_on": null
33
+ },
34
+ {
35
+ "predicate_name": "resource_consulted",
36
+ "term_label": "Print sources",
37
+ "term_uri": "Print sources",
38
+ "default_presentation_sequence": null,
39
+ "activated_on": "2015-01-01",
40
+ "deactivated_on": null
41
+ },
42
+ {
43
+ "predicate_name": "resource_consulted",
44
+ "term_label": "Web sites or other internet research sources",
45
+ "term_uri": "Web sites or other internet research sources",
46
+ "default_presentation_sequence": null,
47
+ "activated_on": "2015-01-01",
48
+ "deactivated_on": null
49
+ }
50
+ ]
@@ -0,0 +1,34 @@
1
+ [
2
+ {
3
+ "predicate_name": "work_patent_strategy",
4
+ "term_label": "going_to_patent",
5
+ "term_uri": null,
6
+ "default_presentation_sequence": 1,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "work_patent_strategy",
12
+ "term_label": "will_not_patent",
13
+ "term_uri": null,
14
+ "default_presentation_sequence": 2,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "work_patent_strategy",
20
+ "term_label": "already_patented",
21
+ "term_uri": null,
22
+ "default_presentation_sequence": 3,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ },
26
+ {
27
+ "predicate_name": "work_patent_strategy",
28
+ "term_label": "do_not_know",
29
+ "term_uri": null,
30
+ "default_presentation_sequence": 4,
31
+ "activated_on": "2015-01-01",
32
+ "deactivated_on": null
33
+ }
34
+ ]
@@ -0,0 +1,34 @@
1
+ [
2
+ {
3
+ "predicate_name": "work_publication_strategy",
4
+ "term_label": "going_to_publish",
5
+ "term_uri": null,
6
+ "default_presentation_sequence": 1,
7
+ "activated_on": "2015-01-01",
8
+ "deactivated_on": null
9
+ },
10
+ {
11
+ "predicate_name": "work_publication_strategy",
12
+ "term_label": "will_not_publish",
13
+ "term_uri": null,
14
+ "default_presentation_sequence": 2,
15
+ "activated_on": "2015-01-01",
16
+ "deactivated_on": null
17
+ },
18
+ {
19
+ "predicate_name": "work_publication_strategy",
20
+ "term_label": "already_published",
21
+ "term_uri": null,
22
+ "default_presentation_sequence": 3,
23
+ "activated_on": "2015-01-01",
24
+ "deactivated_on": null
25
+ },
26
+ {
27
+ "predicate_name": "work_publication_strategy",
28
+ "term_label": "do_not_know",
29
+ "term_uri": null,
30
+ "default_presentation_sequence": 4,
31
+ "activated_on": "2015-01-01",
32
+ "deactivated_on": null
33
+ }
34
+ ]
data/lib/locabulary.rb ADDED
@@ -0,0 +1,94 @@
1
+ require 'date'
2
+ require 'json'
3
+
4
+ # @since 0.1.0
5
+ module Locabulary
6
+ VERSION='0.1.0'.freeze
7
+ DATA_DIRECTORY = File.expand_path("../../data/", __FILE__).freeze
8
+
9
+ class RuntimeError < ::RuntimeError
10
+ end
11
+
12
+ class Item
13
+ include Comparable
14
+ ATTRIBUTE_NAMES = [:predicate_name, :term_label, :term_uri, :default_presentation_sequence, :activated_on, :deactivated_on].freeze
15
+
16
+ attr_reader *ATTRIBUTE_NAMES
17
+
18
+ def initialize(attributes = {})
19
+ ATTRIBUTE_NAMES.each do |key|
20
+ value = attributes.fetch(key) { attributes.fetch(key.to_s, nil) }
21
+ send("#{key}=", value)
22
+ end
23
+ end
24
+
25
+ def <=>(other)
26
+ value = default_presentation_sequence <=> other.default_presentation_sequence
27
+ return value unless value == 0
28
+ term_label <=> other.term_label
29
+ end
30
+
31
+ private
32
+
33
+ attr_writer *ATTRIBUTE_NAMES
34
+ end
35
+
36
+ module_function
37
+
38
+ # @api public
39
+ # @since 0.1.0
40
+ #
41
+ # @note A concession about the as_of; This is not a live query. The data has a
42
+ # low churn rate. And while the date is important, I'm not as concerned
43
+ # about the local controlled vocabulary exposing a date that has expired.
44
+ # When we next deploy the server changes, the deactivated will go away.
45
+ def active_items_for(predicate_name:, as_of: Date.today)
46
+ active_cache[predicate_name] ||= begin
47
+ filename = filename_for_predicate_name(predicate_name: predicate_name)
48
+ JSON.parse(File.read(filename)).each_with_object([]) do |item_values, mem|
49
+ activated_on = Date.parse(item_values.fetch('activated_on'))
50
+ next unless activated_on < as_of
51
+ deactivated_on_value = item_values.fetch('deactivated_on')
52
+ if deactivated_on_value.nil?
53
+ mem << Item.new(item_values)
54
+ else
55
+ deactivated_on = Date.parse(deactivated_on_value)
56
+ next unless deactivated_on >= as_of
57
+ mem << Item.new(item_values)
58
+ end
59
+ mem
60
+ end.sort
61
+ end
62
+ end
63
+
64
+ # @api public
65
+ # @since 0.1.0
66
+ def active_label_for_uri(predicate_name:, term_uri:)
67
+ object = active_items_for(predicate_name: predicate_name).detect { |obj| obj.term_uri == term_uri }
68
+ return object.term_label if object
69
+ term_uri
70
+ end
71
+
72
+ # @api public
73
+ # @since 0.1.0
74
+ def active_labels_for(predicate_name:)
75
+ active_items_for(predicate_name: predicate_name).map(&:term_label)
76
+ end
77
+
78
+ # @api private
79
+ def filename_for_predicate_name(predicate_name:)
80
+ filename = File.join(DATA_DIRECTORY, "#{File.basename(predicate_name)}.json")
81
+ return filename if File.exist?(filename)
82
+ raise Locabulary::RuntimeError, "Unable to find predicate_name: #{predicate_name}"
83
+ end
84
+
85
+ # @api private
86
+ def active_cache
87
+ @active_cache ||= {}
88
+ end
89
+
90
+ # @api private
91
+ def reset_active_cache!
92
+ @active_cache = nil
93
+ end
94
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'locabulary'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "locabulary"
8
+ spec.version = Locabulary::VERSION
9
+ spec.authors = ["Jeremy Friesen"]
10
+ spec.email = ["jeremy.n.friesen@gmail.com"]
11
+
12
+ spec.summary = %q{An extraction of limited localized vocabulary for Sipity and CurateND.}
13
+ spec.description = %q{An extraction of limited localized vocabulary for Sipity and CurateND.}
14
+ spec.homepage = "https://github.com/ndlib/locabulary"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.9"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_dependency "json", "~> 1.8"
24
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: locabulary
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jeremy Friesen
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.8'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.8'
55
+ description: An extraction of limited localized vocabulary for Sipity and CurateND.
56
+ email:
57
+ - jeremy.n.friesen@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - LICENSE
67
+ - README.md
68
+ - Rakefile
69
+ - data/award_category.json
70
+ - data/citation_style.json
71
+ - data/copyright.json
72
+ - data/degree.json
73
+ - data/program_name.json
74
+ - data/resource_consulted.json
75
+ - data/work_patent_strategy.json
76
+ - data/work_publication_strategy.json
77
+ - lib/locabulary.rb
78
+ - locabulary.gemspec
79
+ homepage: https://github.com/ndlib/locabulary
80
+ licenses: []
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.4.6
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: An extraction of limited localized vocabulary for Sipity and CurateND.
102
+ test_files: []
103
+ has_rdoc: