locabulary 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/administrative_units.json +1311 -486
- data/data/affiliation.json +1 -5
- data/data/award_category.json +1 -5
- data/data/citation_style.json +1 -3
- data/data/collaborator.json +1 -100
- data/data/college.json +1 -6
- data/data/copyright.json +1 -9
- data/data/degree.json +1 -17
- data/data/organization.json +1 -32
- data/data/program_name.json +1 -31
- data/data/resource_consulted.json +137 -12
- data/data/underclass_level.json +5 -4
- data/data/work_patent_strategy.json +1 -6
- data/data/work_publication_strategy.json +1 -4
- data/lib/locabulary/schema.rb +5 -1
- data/lib/locabulary.rb +15 -5
- data/script/json_creator.rb +27 -13
- metadata +2 -2
data/data/organization.json
CHANGED
|
@@ -1,130 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
+
"predicate_name": "organization",
|
|
2
3
|
"values": [{
|
|
3
|
-
"predicate_name": "organization",
|
|
4
4
|
"term_label": "Aerospace and Mechanical Engineering",
|
|
5
5
|
"activated_on": "2015-01-01"
|
|
6
6
|
},{
|
|
7
|
-
"predicate_name": "organization",
|
|
8
7
|
"term_label": "Anthropology",
|
|
9
8
|
"activated_on": "2015-01-01"
|
|
10
9
|
},{
|
|
11
|
-
"predicate_name": "organization",
|
|
12
10
|
"term_label": "Applied and Computational Mathematics and Statistics",
|
|
13
11
|
"activated_on": "2015-01-01"
|
|
14
12
|
},{
|
|
15
|
-
"predicate_name": "organization",
|
|
16
13
|
"term_label": "Art, Art History, and Design",
|
|
17
14
|
"activated_on": "2015-01-01"
|
|
18
15
|
},{
|
|
19
|
-
"predicate_name": "organization",
|
|
20
16
|
"term_label": "Bioengineering",
|
|
21
17
|
"activated_on": "2015-01-01"
|
|
22
18
|
},{
|
|
23
|
-
"predicate_name": "organization",
|
|
24
19
|
"term_label": "Biological Sciences",
|
|
25
20
|
"activated_on": "2015-01-01"
|
|
26
21
|
},{
|
|
27
|
-
"predicate_name": "organization",
|
|
28
22
|
"term_label": "Chemical and Biomolecular Engineering",
|
|
29
23
|
"activated_on": "2015-01-01"
|
|
30
24
|
},{
|
|
31
|
-
"predicate_name": "organization",
|
|
32
25
|
"term_label": "Chemistry and Biochemistry",
|
|
33
26
|
"activated_on": "2015-01-01"
|
|
34
27
|
},{
|
|
35
|
-
"predicate_name": "organization",
|
|
36
28
|
"term_label": "Civil and Environmental Engineering and Earth Sciences",
|
|
37
29
|
"activated_on": "2015-01-01"
|
|
38
30
|
},{
|
|
39
|
-
"predicate_name": "organization",
|
|
40
31
|
"term_label": "Classics",
|
|
41
32
|
"activated_on": "2015-01-01"
|
|
42
33
|
},{
|
|
43
|
-
"predicate_name": "organization",
|
|
44
34
|
"term_label": "Computer Science and Engineering",
|
|
45
35
|
"activated_on": "2015-01-01"
|
|
46
36
|
},{
|
|
47
|
-
"predicate_name": "organization",
|
|
48
37
|
"term_label": "Creative Writing",
|
|
49
38
|
"activated_on": "2015-01-01"
|
|
50
39
|
},{
|
|
51
|
-
"predicate_name": "organization",
|
|
52
40
|
"term_label": "Early Christian Studies",
|
|
53
41
|
"activated_on": "2015-01-01"
|
|
54
42
|
},{
|
|
55
|
-
"predicate_name": "organization",
|
|
56
43
|
"term_label": "Economics",
|
|
57
44
|
"activated_on": "2015-01-01"
|
|
58
45
|
},{
|
|
59
|
-
"predicate_name": "organization",
|
|
60
46
|
"term_label": "Electrical Engineering",
|
|
61
47
|
"activated_on": "2015-01-01"
|
|
62
48
|
},{
|
|
63
|
-
"predicate_name": "organization",
|
|
64
49
|
"term_label": "English",
|
|
65
50
|
"activated_on": "2015-01-01"
|
|
66
51
|
},{
|
|
67
|
-
"predicate_name": "organization",
|
|
68
52
|
"term_label": "History",
|
|
69
53
|
"activated_on": "2015-01-01"
|
|
70
54
|
},{
|
|
71
|
-
"predicate_name": "organization",
|
|
72
55
|
"term_label": "History and Philosophy of Science",
|
|
73
56
|
"activated_on": "2015-01-01"
|
|
74
57
|
},{
|
|
75
|
-
"predicate_name": "organization",
|
|
76
58
|
"term_label": "Integrated Biomedical Sciences",
|
|
77
59
|
"activated_on": "2015-01-01"
|
|
78
60
|
},{
|
|
79
|
-
"predicate_name": "organization",
|
|
80
61
|
"term_label": "Law",
|
|
81
62
|
"activated_on": "2015-01-01"
|
|
82
63
|
},{
|
|
83
|
-
"predicate_name": "organization",
|
|
84
64
|
"term_label": "Literature",
|
|
85
65
|
"activated_on": "2015-01-01"
|
|
86
66
|
},{
|
|
87
|
-
"predicate_name": "organization",
|
|
88
67
|
"term_label": "Mathematics",
|
|
89
68
|
"activated_on": "2015-01-01"
|
|
90
69
|
},{
|
|
91
|
-
"predicate_name": "organization",
|
|
92
70
|
"term_label": "Medieval Studies",
|
|
93
71
|
"activated_on": "2015-01-01"
|
|
94
72
|
},{
|
|
95
|
-
"predicate_name": "organization",
|
|
96
73
|
"term_label": "Peace Studies",
|
|
97
74
|
"activated_on": "2015-01-01"
|
|
98
75
|
},{
|
|
99
|
-
"predicate_name": "organization",
|
|
100
76
|
"term_label": "Philosophy",
|
|
101
77
|
"activated_on": "2015-01-01"
|
|
102
78
|
},{
|
|
103
|
-
"predicate_name": "organization",
|
|
104
79
|
"term_label": "Physics",
|
|
105
80
|
"activated_on": "2015-01-01"
|
|
106
81
|
},{
|
|
107
|
-
"predicate_name": "organization",
|
|
108
82
|
"term_label": "Political Science",
|
|
109
83
|
"activated_on": "2015-01-01"
|
|
110
84
|
},{
|
|
111
|
-
"predicate_name": "organization",
|
|
112
85
|
"term_label": "Psychology",
|
|
113
86
|
"activated_on": "2015-01-01"
|
|
114
87
|
},{
|
|
115
|
-
"predicate_name": "organization",
|
|
116
88
|
"term_label": "Romance Languages and Literatures",
|
|
117
89
|
"activated_on": "2015-01-01"
|
|
118
90
|
},{
|
|
119
|
-
"predicate_name": "organization",
|
|
120
91
|
"term_label": "Sacred Music",
|
|
121
92
|
"activated_on": "2015-01-01"
|
|
122
93
|
},{
|
|
123
|
-
"predicate_name": "organization",
|
|
124
94
|
"term_label": "Sociology",
|
|
125
95
|
"activated_on": "2015-01-01"
|
|
126
96
|
},{
|
|
127
|
-
"predicate_name": "organization",
|
|
128
97
|
"term_label": "Theology",
|
|
129
98
|
"activated_on": "2015-01-01"
|
|
130
99
|
}]
|
data/data/program_name.json
CHANGED
|
@@ -1,126 +1,96 @@
|
|
|
1
1
|
{
|
|
2
|
+
"predicate_name": "program_name",
|
|
2
3
|
"values": [{
|
|
3
|
-
"predicate_name": "program_name",
|
|
4
4
|
"term_label": "Aerospace and Mechanical Engineering",
|
|
5
5
|
"activated_on": "2015-01-01"
|
|
6
6
|
},{
|
|
7
|
-
"predicate_name": "program_name",
|
|
8
7
|
"term_label": "Anthropology",
|
|
9
8
|
"activated_on": "2015-01-01"
|
|
10
9
|
},{
|
|
11
|
-
"predicate_name": "program_name",
|
|
12
10
|
"term_label": "Applied and Computational Mathematics and Statistics",
|
|
13
11
|
"activated_on": "2015-01-01"
|
|
14
12
|
},{
|
|
15
|
-
"predicate_name": "program_name",
|
|
16
13
|
"term_label": "Art, Art History, and Design",
|
|
17
14
|
"activated_on": "2015-01-01"
|
|
18
15
|
},{
|
|
19
|
-
"predicate_name": "program_name",
|
|
20
16
|
"term_label": "Bioengineering",
|
|
21
17
|
"activated_on": "2015-01-01"
|
|
22
18
|
},{
|
|
23
|
-
"predicate_name": "program_name",
|
|
24
19
|
"term_label": "Biological Sciences",
|
|
25
20
|
"activated_on": "2015-01-01"
|
|
26
21
|
},{
|
|
27
|
-
"predicate_name": "program_name",
|
|
28
22
|
"term_label": "Chemical and Biomolecular Engineering",
|
|
29
23
|
"activated_on": "2015-01-01"
|
|
30
24
|
},{
|
|
31
|
-
"predicate_name": "program_name",
|
|
32
25
|
"term_label": "Chemistry and Biochemistry",
|
|
33
26
|
"activated_on": "2015-01-01"
|
|
34
27
|
},{
|
|
35
|
-
"predicate_name": "program_name",
|
|
36
28
|
"term_label": "Civil and Environmental Engineering and Earth Sciences",
|
|
37
29
|
"activated_on": "2015-01-01"
|
|
38
30
|
},{
|
|
39
|
-
"predicate_name": "program_name",
|
|
40
31
|
"term_label": "Classics",
|
|
41
32
|
"activated_on": "2015-01-01"
|
|
42
33
|
},{
|
|
43
|
-
"predicate_name": "program_name",
|
|
44
34
|
"term_label": "Computer Science and Engineering",
|
|
45
35
|
"activated_on": "2015-01-01"
|
|
46
36
|
},{
|
|
47
|
-
"predicate_name": "program_name",
|
|
48
37
|
"term_label": "Creative Writing",
|
|
49
38
|
"activated_on": "2015-01-01"
|
|
50
39
|
},{
|
|
51
|
-
"predicate_name": "program_name",
|
|
52
40
|
"term_label": "Early Christian Studies",
|
|
53
41
|
"activated_on": "2015-01-01"
|
|
54
42
|
},{
|
|
55
|
-
"predicate_name": "program_name",
|
|
56
43
|
"term_label": "Economics",
|
|
57
44
|
"activated_on": "2015-01-01"
|
|
58
45
|
},{
|
|
59
|
-
"predicate_name": "program_name",
|
|
60
46
|
"term_label": "Electrical Engineering",
|
|
61
47
|
"activated_on": "2015-01-01"
|
|
62
48
|
},{
|
|
63
|
-
"predicate_name": "program_name",
|
|
64
49
|
"term_label": "English",
|
|
65
50
|
"activated_on": "2015-01-01"
|
|
66
51
|
},{
|
|
67
|
-
"predicate_name": "program_name",
|
|
68
52
|
"term_label": "History",
|
|
69
53
|
"activated_on": "2015-01-01"
|
|
70
54
|
},{
|
|
71
|
-
"predicate_name": "program_name",
|
|
72
55
|
"term_label": "History and Philosophy of Science",
|
|
73
56
|
"activated_on": "2015-01-01"
|
|
74
57
|
},{
|
|
75
|
-
"predicate_name": "program_name",
|
|
76
58
|
"term_label": "Integrated Biomedical Sciences",
|
|
77
59
|
"activated_on": "2015-01-01"
|
|
78
60
|
},{
|
|
79
|
-
"predicate_name": "program_name",
|
|
80
61
|
"term_label": "Literature",
|
|
81
62
|
"activated_on": "2015-01-01"
|
|
82
63
|
},{
|
|
83
|
-
"predicate_name": "program_name",
|
|
84
64
|
"term_label": "Mathematics",
|
|
85
65
|
"activated_on": "2015-01-01"
|
|
86
66
|
},{
|
|
87
|
-
"predicate_name": "program_name",
|
|
88
67
|
"term_label": "Medieval Studies",
|
|
89
68
|
"activated_on": "2015-01-01"
|
|
90
69
|
},{
|
|
91
|
-
"predicate_name": "program_name",
|
|
92
70
|
"term_label": "Peace Studies",
|
|
93
71
|
"activated_on": "2015-01-01"
|
|
94
72
|
},{
|
|
95
|
-
"predicate_name": "program_name",
|
|
96
73
|
"term_label": "Philosophy",
|
|
97
74
|
"activated_on": "2015-01-01"
|
|
98
75
|
},{
|
|
99
|
-
"predicate_name": "program_name",
|
|
100
76
|
"term_label": "Physics",
|
|
101
77
|
"activated_on": "2015-01-01"
|
|
102
78
|
},{
|
|
103
|
-
"predicate_name": "program_name",
|
|
104
79
|
"term_label": "Political Science",
|
|
105
80
|
"activated_on": "2015-01-01"
|
|
106
81
|
},{
|
|
107
|
-
"predicate_name": "program_name",
|
|
108
82
|
"term_label": "Psychology",
|
|
109
83
|
"activated_on": "2015-01-01"
|
|
110
84
|
},{
|
|
111
|
-
"predicate_name": "program_name",
|
|
112
85
|
"term_label": "Romance Languages and Literatures",
|
|
113
86
|
"activated_on": "2015-01-01"
|
|
114
87
|
},{
|
|
115
|
-
"predicate_name": "program_name",
|
|
116
88
|
"term_label": "Sacred Music",
|
|
117
89
|
"activated_on": "2015-01-01"
|
|
118
90
|
},{
|
|
119
|
-
"predicate_name": "program_name",
|
|
120
91
|
"term_label": "Sociology",
|
|
121
92
|
"activated_on": "2015-01-01"
|
|
122
93
|
},{
|
|
123
|
-
"predicate_name": "program_name",
|
|
124
94
|
"term_label": "Theology",
|
|
125
95
|
"activated_on": "2015-01-01"
|
|
126
96
|
}]
|
|
@@ -1,33 +1,158 @@
|
|
|
1
1
|
{
|
|
2
|
+
"predicate_name": "resource_consulted",
|
|
2
3
|
"values": [{
|
|
3
|
-
"
|
|
4
|
+
"term_label": "People::Consultation with a subject librarian",
|
|
5
|
+
"default_presentation_sequence": 100,
|
|
6
|
+
"activated_on": "2016-01-01"
|
|
7
|
+
}, {
|
|
8
|
+
"term_label": "People::LINk Program librarian",
|
|
9
|
+
"default_presentation_sequence": 100,
|
|
10
|
+
"activated_on": "2016-01-01"
|
|
11
|
+
}, {
|
|
12
|
+
"term_label": "People::Research Help Desk services (in person, on phone, via email)",
|
|
13
|
+
"default_presentation_sequence": 100,
|
|
14
|
+
"activated_on": "2016-01-01"
|
|
15
|
+
}, {
|
|
16
|
+
"term_label": "Places::Archives",
|
|
17
|
+
"default_presentation_sequence": 200,
|
|
18
|
+
"activated_on": "2016-01-01"
|
|
19
|
+
}, {
|
|
20
|
+
"term_label": "Places::Center for Digital Scholarship",
|
|
21
|
+
"default_presentation_sequence": 200,
|
|
22
|
+
"activated_on": "2016-01-01"
|
|
23
|
+
}, {
|
|
24
|
+
"term_label": "Places::Branch Libraries",
|
|
25
|
+
"default_presentation_sequence": 200,
|
|
26
|
+
"activated_on": "2016-01-01"
|
|
27
|
+
}, {
|
|
28
|
+
"term_label": "Places::Multimedia spaces",
|
|
29
|
+
"default_presentation_sequence": 200,
|
|
30
|
+
"activated_on": "2016-01-01"
|
|
31
|
+
}, {
|
|
32
|
+
"term_label": "Places::Medieval Institute",
|
|
33
|
+
"default_presentation_sequence": 200,
|
|
34
|
+
"activated_on": "2016-01-01"
|
|
35
|
+
}, {
|
|
36
|
+
"term_label": "Places::Music & Media Services Unit",
|
|
37
|
+
"default_presentation_sequence": 200,
|
|
38
|
+
"activated_on": "2016-01-01"
|
|
39
|
+
}, {
|
|
40
|
+
"term_label": "Places::Rare Books and Special Collections",
|
|
41
|
+
"default_presentation_sequence": 200,
|
|
42
|
+
"activated_on": "2016-01-01"
|
|
43
|
+
}, {
|
|
44
|
+
"term_label": "Online Resources::CurateND",
|
|
45
|
+
"default_presentation_sequence": 300,
|
|
46
|
+
"activated_on": "2016-01-01"
|
|
47
|
+
}, {
|
|
48
|
+
"term_label": "Online Resources::Databases accessed via Hesburgh Libraries web site",
|
|
49
|
+
"default_presentation_sequence": 300,
|
|
50
|
+
"activated_on": "2016-01-01"
|
|
51
|
+
}, {
|
|
52
|
+
"term_label": "Online Resources::Data sets accessed via Hesburgh Libraries web site",
|
|
53
|
+
"default_presentation_sequence": 300,
|
|
54
|
+
"activated_on": "2016-01-01"
|
|
55
|
+
}, {
|
|
56
|
+
"term_label": "Online Resources::LibGuide online research guides",
|
|
57
|
+
"default_presentation_sequence": 300,
|
|
58
|
+
"activated_on": "2016-01-01"
|
|
59
|
+
}, {
|
|
60
|
+
"term_label": "Online Resources::Online chat via Hesburgh Libraries web site",
|
|
61
|
+
"default_presentation_sequence": 300,
|
|
62
|
+
"activated_on": "2016-01-01"
|
|
63
|
+
}, {
|
|
64
|
+
"term_label": "Online Resources::Remix",
|
|
65
|
+
"default_presentation_sequence": 300,
|
|
66
|
+
"activated_on": "2016-01-01"
|
|
67
|
+
}, {
|
|
68
|
+
"term_label": "Other Library Resources::Digitization and images resources",
|
|
69
|
+
"default_presentation_sequence": 400,
|
|
70
|
+
"activated_on": "2016-01-01"
|
|
71
|
+
}, {
|
|
72
|
+
"term_label": "Other Library Resources::Government information/statistics",
|
|
73
|
+
"default_presentation_sequence": 400,
|
|
74
|
+
"activated_on": "2016-01-01"
|
|
75
|
+
}, {
|
|
76
|
+
"term_label": "Other Library Resources::Inter-Library Loan services",
|
|
77
|
+
"default_presentation_sequence": 400,
|
|
78
|
+
"activated_on": "2016-01-01"
|
|
79
|
+
}, {
|
|
80
|
+
"term_label": "Other Library Resources::Workshop(s)/camps",
|
|
81
|
+
"default_presentation_sequence": 400,
|
|
82
|
+
"activated_on": "2016-01-01"
|
|
83
|
+
}, {
|
|
84
|
+
"term_label": "External Resources::Archives - domestic",
|
|
85
|
+
"default_presentation_sequence": 500,
|
|
86
|
+
"activated_on": "2016-01-01"
|
|
87
|
+
}, {
|
|
88
|
+
"term_label": "External Resources::Archives - international",
|
|
89
|
+
"default_presentation_sequence": 500,
|
|
90
|
+
"activated_on": "2016-01-01"
|
|
91
|
+
}, {
|
|
92
|
+
"term_label": "External Resources::Archives - digital",
|
|
93
|
+
"default_presentation_sequence": 500,
|
|
94
|
+
"activated_on": "2016-01-01"
|
|
95
|
+
}, {
|
|
96
|
+
"term_label": "External Resources::Consultation with a librarian - domestic",
|
|
97
|
+
"default_presentation_sequence": 500,
|
|
98
|
+
"activated_on": "2016-01-01"
|
|
99
|
+
}, {
|
|
100
|
+
"term_label": "External Resources::Consultation with a librarian - international",
|
|
101
|
+
"default_presentation_sequence": 500,
|
|
102
|
+
"activated_on": "2016-01-01"
|
|
103
|
+
}, {
|
|
104
|
+
"term_label": "External Resources::Consultation with a librarian - digital",
|
|
105
|
+
"default_presentation_sequence": 500,
|
|
106
|
+
"activated_on": "2016-01-01"
|
|
107
|
+
}, {
|
|
108
|
+
"term_label": "External Resources::Library - domestic",
|
|
109
|
+
"default_presentation_sequence": 500,
|
|
110
|
+
"activated_on": "2016-01-01"
|
|
111
|
+
}, {
|
|
112
|
+
"term_label": "External Resources::Library - international",
|
|
113
|
+
"default_presentation_sequence": 500,
|
|
114
|
+
"activated_on": "2016-01-01"
|
|
115
|
+
}, {
|
|
116
|
+
"term_label": "External Resources::Library - digital",
|
|
117
|
+
"default_presentation_sequence": 500,
|
|
118
|
+
"activated_on": "2016-01-01"
|
|
119
|
+
}, {
|
|
120
|
+
"term_label": "External Resources::Web sites or other internet research sources",
|
|
121
|
+
"default_presentation_sequence": 500,
|
|
122
|
+
"activated_on": "2016-01-01"
|
|
123
|
+
}, {
|
|
124
|
+
"term_label": "External Resources::Workshops",
|
|
125
|
+
"default_presentation_sequence": 500,
|
|
126
|
+
"activated_on": "2016-01-01"
|
|
127
|
+
}, {
|
|
4
128
|
"term_label": "Consultation with a librarian",
|
|
5
129
|
"term_uri": "Consultation with a librarian",
|
|
6
|
-
"activated_on": "2015-01-01"
|
|
130
|
+
"activated_on": "2015-01-01",
|
|
131
|
+
"deactivated_on": "2015-12-31"
|
|
7
132
|
},{
|
|
8
|
-
"predicate_name": "resource_consulted",
|
|
9
133
|
"term_label": "Databases accessed via Hesburgh Libraries",
|
|
10
134
|
"term_uri": "Databases accessed via Hesburgh Libraries",
|
|
11
|
-
"activated_on": "2015-01-01"
|
|
135
|
+
"activated_on": "2015-01-01",
|
|
136
|
+
"deactivated_on": "2015-12-31"
|
|
12
137
|
},{
|
|
13
|
-
"predicate_name": "resource_consulted",
|
|
14
138
|
"term_label": "Electronic journals",
|
|
15
139
|
"term_uri": "Electronic journals",
|
|
16
|
-
"activated_on": "2015-01-01"
|
|
140
|
+
"activated_on": "2015-01-01",
|
|
141
|
+
"deactivated_on": "2015-12-31"
|
|
17
142
|
},{
|
|
18
|
-
"predicate_name": "resource_consulted",
|
|
19
143
|
"term_label": "Hesburgh Libraries Rare Books and Special Collections and/or Archives",
|
|
20
144
|
"term_uri": "Hesburgh Libraries Rare Books and Special Collections and/or Archives",
|
|
21
|
-
"activated_on": "2015-01-01"
|
|
145
|
+
"activated_on": "2015-01-01",
|
|
146
|
+
"deactivated_on": "2015-12-31"
|
|
22
147
|
},{
|
|
23
|
-
"predicate_name": "resource_consulted",
|
|
24
148
|
"term_label": "Print sources",
|
|
25
149
|
"term_uri": "Print sources",
|
|
26
|
-
"activated_on": "2015-01-01"
|
|
150
|
+
"activated_on": "2015-01-01",
|
|
151
|
+
"deactivated_on": "2015-12-31"
|
|
27
152
|
},{
|
|
28
|
-
"predicate_name": "resource_consulted",
|
|
29
153
|
"term_label": "Web sites or other internet research sources",
|
|
30
154
|
"term_uri": "Web sites or other internet research sources",
|
|
31
|
-
"activated_on": "2015-01-01"
|
|
155
|
+
"activated_on": "2015-01-01",
|
|
156
|
+
"deactivated_on": "2015-12-31"
|
|
32
157
|
}]
|
|
33
158
|
}
|
data/data/underclass_level.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
+
"predicate_name": "underclass_level",
|
|
2
3
|
"values": [{
|
|
3
|
-
"predicate_name": "underclass_level",
|
|
4
4
|
"term_label": "First Year",
|
|
5
5
|
"default_presentation_sequence": 1,
|
|
6
6
|
"activated_on": "2015-01-01"
|
|
7
7
|
},{
|
|
8
|
-
"predicate_name": "underclass_level",
|
|
9
8
|
"term_label": "Sophomore",
|
|
10
9
|
"default_presentation_sequence": 2,
|
|
11
10
|
"activated_on": "2015-01-01"
|
|
12
11
|
},{
|
|
13
|
-
"predicate_name": "underclass_level",
|
|
14
12
|
"term_label": "Junior",
|
|
15
13
|
"default_presentation_sequence": 3,
|
|
16
14
|
"activated_on": "2015-01-01"
|
|
17
15
|
},{
|
|
18
|
-
"
|
|
16
|
+
"term_label": "Junior",
|
|
17
|
+
"default_presentation_sequence": 4,
|
|
18
|
+
"activated_on": "2015-01-01"
|
|
19
|
+
},{
|
|
19
20
|
"term_label": "5th Year",
|
|
20
21
|
"default_presentation_sequence": 5,
|
|
21
22
|
"activated_on": "2015-01-01"
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
+
"predicate_name": "work_patent_strategy",
|
|
2
3
|
"values": [{
|
|
3
|
-
"predicate_name": "work_patent_strategy",
|
|
4
4
|
"term_label": "going_to_patent",
|
|
5
5
|
"default_presentation_sequence": 1,
|
|
6
6
|
"activated_on": "2015-01-01"
|
|
7
7
|
},{
|
|
8
|
-
"predicate_name": "work_patent_strategy",
|
|
9
8
|
"term_label": "will_not_patent",
|
|
10
9
|
"default_presentation_sequence": 2,
|
|
11
10
|
"activated_on": "2015-01-01"
|
|
12
11
|
},{
|
|
13
|
-
"predicate_name": "work_patent_strategy",
|
|
14
12
|
"term_label": "already_patented",
|
|
15
13
|
"default_presentation_sequence": 3,
|
|
16
14
|
"activated_on": "2015-01-01",
|
|
17
15
|
"deactivated_on": "2015-07-06"
|
|
18
16
|
},{
|
|
19
|
-
"predicate_name": "work_patent_strategy",
|
|
20
17
|
"term_label": "do_not_know",
|
|
21
18
|
"default_presentation_sequence": 4,
|
|
22
19
|
"activated_on": "2015-01-01",
|
|
23
20
|
"deactivated_on": "2015-07-06"
|
|
24
21
|
},{
|
|
25
|
-
"predicate_name": "work_patent_strategy",
|
|
26
22
|
"term_label": "non_provisional_patent_filed",
|
|
27
23
|
"default_presentation_sequence": 5,
|
|
28
24
|
"activated_on": "2015-07-06"
|
|
29
25
|
},{
|
|
30
|
-
"predicate_name": "work_patent_strategy",
|
|
31
26
|
"term_label": "material_already_published",
|
|
32
27
|
"default_presentation_sequence": 6,
|
|
33
28
|
"activated_on": "2015-07-06"
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
+
"predicate_name": "work_publication_strategy",
|
|
2
3
|
"values": [{
|
|
3
|
-
"predicate_name": "work_publication_strategy",
|
|
4
4
|
"term_label": "going_to_publish",
|
|
5
5
|
"default_presentation_sequence": 1,
|
|
6
6
|
"activated_on": "2015-01-01"
|
|
7
7
|
},{
|
|
8
|
-
"predicate_name": "work_publication_strategy",
|
|
9
8
|
"term_label": "will_not_publish",
|
|
10
9
|
"default_presentation_sequence": 2,
|
|
11
10
|
"activated_on": "2015-01-01"
|
|
12
11
|
},{
|
|
13
|
-
"predicate_name": "work_publication_strategy",
|
|
14
12
|
"term_label": "already_published",
|
|
15
13
|
"default_presentation_sequence": 3,
|
|
16
14
|
"activated_on": "2015-01-01"
|
|
17
15
|
},{
|
|
18
|
-
"predicate_name": "work_publication_strategy",
|
|
19
16
|
"term_label": "do_not_know",
|
|
20
17
|
"default_presentation_sequence": 4,
|
|
21
18
|
"activated_on": "2015-01-01"
|
data/lib/locabulary/schema.rb
CHANGED
|
@@ -3,13 +3,17 @@ require 'dry/validation/schema'
|
|
|
3
3
|
|
|
4
4
|
module Locabulary
|
|
5
5
|
class Schema < Dry::Validation::Schema
|
|
6
|
+
key(:predicate_name) { |predicate_name| predicate_name.format?(/\A[a-z_]+\Z/) & predicate_name.filled? }
|
|
6
7
|
key(:values) do |values|
|
|
7
8
|
values.array? do
|
|
8
9
|
values.each do |value|
|
|
9
10
|
value.hash? do
|
|
10
|
-
value.key(:predicate_name) { |predicate_name| predicate_name.format?(/\A[a-z_]+\Z/) & predicate_name.filled? }
|
|
11
11
|
value.key(:term_label) { |term_label| term_label.filled? }
|
|
12
12
|
value.optional(:term_uri) { |term_label| term_label.none? | term_label.str? }
|
|
13
|
+
value.optional(:deposit_label) { |deposit_label| deposit_label.none? | deposit_label.str? }
|
|
14
|
+
value.optional(:description) { |description| description.none? | description.str? }
|
|
15
|
+
value.optional(:grouping) { |grouping| grouping.none? | grouping.str? }
|
|
16
|
+
value.optional(:affiliation) { |affiliation| affiliation.none? | affiliation.str? }
|
|
13
17
|
value.optional(:default_presentation_sequence) do |default_presentation_sequence|
|
|
14
18
|
default_presentation_sequence.none? | default_presentation_sequence.int?
|
|
15
19
|
end
|
data/lib/locabulary.rb
CHANGED
|
@@ -3,7 +3,7 @@ require 'json'
|
|
|
3
3
|
|
|
4
4
|
# @since 0.1.0
|
|
5
5
|
module Locabulary
|
|
6
|
-
VERSION='0.
|
|
6
|
+
VERSION='0.2.0'.freeze
|
|
7
7
|
DATA_DIRECTORY = File.expand_path("../../data/", __FILE__).freeze
|
|
8
8
|
|
|
9
9
|
class RuntimeError < ::RuntimeError
|
|
@@ -11,11 +11,11 @@ module Locabulary
|
|
|
11
11
|
|
|
12
12
|
class Item
|
|
13
13
|
include Comparable
|
|
14
|
-
ATTRIBUTE_NAMES = [:predicate_name, :term_label, :term_uri, :default_presentation_sequence, :activated_on, :deactivated_on].freeze
|
|
14
|
+
ATTRIBUTE_NAMES = [:predicate_name, :term_label, :term_uri, :deposit_label, :description, :grouping, :affiliation, :default_presentation_sequence, :activated_on, :deactivated_on].freeze
|
|
15
15
|
|
|
16
16
|
attr_reader(*ATTRIBUTE_NAMES)
|
|
17
17
|
|
|
18
|
-
def initialize(attributes
|
|
18
|
+
def initialize(attributes={})
|
|
19
19
|
ATTRIBUTE_NAMES.each do |key|
|
|
20
20
|
value = attributes.fetch(key) { attributes.fetch(key.to_s, nil) }
|
|
21
21
|
send("#{key}=", value)
|
|
@@ -53,16 +53,17 @@ module Locabulary
|
|
|
53
53
|
active_cache[predicate_name] ||= begin
|
|
54
54
|
filename = filename_for_predicate_name(predicate_name: predicate_name)
|
|
55
55
|
json = JSON.parse(File.read(filename))
|
|
56
|
+
predicate_name = json.fetch('predicate_name')
|
|
56
57
|
json.fetch('values').each_with_object([]) do |item_values, mem|
|
|
57
58
|
activated_on = Date.parse(item_values.fetch('activated_on'))
|
|
58
59
|
next unless activated_on < as_of
|
|
59
60
|
deactivated_on_value = item_values.fetch('deactivated_on', nil)
|
|
60
61
|
if deactivated_on_value.nil?
|
|
61
|
-
mem << Item.new(item_values)
|
|
62
|
+
mem << Item.new(item_values.merge('predicate_name' => predicate_name))
|
|
62
63
|
else
|
|
63
64
|
deactivated_on = Date.parse(deactivated_on_value)
|
|
64
65
|
next unless deactivated_on >= as_of
|
|
65
|
-
mem << Item.new(item_values)
|
|
66
|
+
mem << Item.new(item_values.merge('predicate_name' => predicate_name))
|
|
66
67
|
end
|
|
67
68
|
mem
|
|
68
69
|
end.sort
|
|
@@ -92,6 +93,15 @@ module Locabulary
|
|
|
92
93
|
format_active_items_for(active_labels_for(options))
|
|
93
94
|
end
|
|
94
95
|
|
|
96
|
+
# @api public
|
|
97
|
+
def properties_for_uri(options = {})
|
|
98
|
+
predicate_name = options.fetch(:predicate_name)
|
|
99
|
+
term_uri = options.fetch(:term_uri)
|
|
100
|
+
object = active_items_for(predicate_name: predicate_name).detect { |obj| obj.term_uri == term_uri }
|
|
101
|
+
return object. if object
|
|
102
|
+
term_uri
|
|
103
|
+
end
|
|
104
|
+
|
|
95
105
|
# @api private
|
|
96
106
|
def filename_for_predicate_name(options = {})
|
|
97
107
|
predicate_name = options.fetch(:predicate_name)
|
data/script/json_creator.rb
CHANGED
|
@@ -5,6 +5,10 @@ require 'json'
|
|
|
5
5
|
|
|
6
6
|
class JsonCreator
|
|
7
7
|
|
|
8
|
+
ATTRIBUTE_NAMES = [:term_label, :term_uri, :deposit_label, :description, :grouping, :affiliation, :presentation_sequence, :activated_on, :deactivated_on].freeze
|
|
9
|
+
|
|
10
|
+
attr_reader(*ATTRIBUTE_NAMES)
|
|
11
|
+
|
|
8
12
|
def initialize(document_key, vocabulary, data_fetcher = default_data_fetcher)
|
|
9
13
|
@document_key = document_key
|
|
10
14
|
@vocabulary = vocabulary
|
|
@@ -22,6 +26,8 @@ class JsonCreator
|
|
|
22
26
|
"Institute" => 400
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
|
|
30
|
+
|
|
25
31
|
def create_or_update
|
|
26
32
|
@spreadsheet_data = data_fetcher.call(document_key)
|
|
27
33
|
convert_to_json(get_required_data_from_spreadsheet)
|
|
@@ -35,6 +41,8 @@ class JsonCreator
|
|
|
35
41
|
|
|
36
42
|
private
|
|
37
43
|
|
|
44
|
+
attr_writer(*ATTRIBUTE_NAMES)
|
|
45
|
+
|
|
38
46
|
def default_data_fetcher
|
|
39
47
|
->(document_key) { GoogleSpreadsheet.new(document_key).read_spreadsheet }
|
|
40
48
|
end
|
|
@@ -84,32 +92,38 @@ class JsonCreator
|
|
|
84
92
|
end
|
|
85
93
|
|
|
86
94
|
def get_required_data_from_spreadsheet
|
|
87
|
-
|
|
95
|
+
formatted_data =[]
|
|
88
96
|
line = []
|
|
89
97
|
spreadsheet_data.shift
|
|
90
98
|
spreadsheet_data.each do |row|
|
|
99
|
+
final = {}
|
|
91
100
|
line << row[0]
|
|
92
101
|
line << row[1] if row[1] && !row[1].empty?
|
|
93
102
|
line << row[2] if row[2] && !row[2].empty?
|
|
94
|
-
final[ line.join('::')
|
|
103
|
+
final[ "term_label" ] = line.join('::')
|
|
104
|
+
final[ "presentation_sequence" ] = ORDER[row[3]]
|
|
105
|
+
final[ "term_uri" ] = row[4]
|
|
106
|
+
final[ "deposit_label" ] = row[5]
|
|
107
|
+
final[ "description" ] = row[6]
|
|
108
|
+
final[ "grouping" ] = row[7]
|
|
109
|
+
final[ "affiliation" ] = row[8]
|
|
110
|
+
final[ "activated_on" ] = "2015-07-22"
|
|
111
|
+
final[ "deactivated_on" ] = nil
|
|
112
|
+
formatted_data << final
|
|
95
113
|
line = []
|
|
96
114
|
end
|
|
97
|
-
|
|
115
|
+
formatted_data
|
|
98
116
|
end
|
|
99
117
|
|
|
100
118
|
def convert_to_json(data)
|
|
101
119
|
json_array = []
|
|
102
|
-
data.each do |
|
|
103
|
-
data_map = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"default_presentation_sequence" => ORDER[value],
|
|
108
|
-
"activated_on" => "2015-07-22",
|
|
109
|
-
"deactivated_on" => nil
|
|
110
|
-
}
|
|
120
|
+
data.each do |row|
|
|
121
|
+
data_map = {"predicate_name"=>vocabulary}
|
|
122
|
+
ATTRIBUTE_NAMES.each do |key|
|
|
123
|
+
data_map[ key ] = row.fetch(key) { row.fetch(key.to_s, nil) }
|
|
124
|
+
end
|
|
111
125
|
json_array << data_map
|
|
112
126
|
end
|
|
113
|
-
@json_data = JSON.pretty_generate(json_array)
|
|
127
|
+
@json_data = JSON.pretty_generate({"predicate_name"=>vocabulary, "values"=> json_array})
|
|
114
128
|
end
|
|
115
129
|
end
|