dbd_onto 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.txt +5 -0
- data/context.md +10 -0
- data/lib/dbd_onto/context.rb +12 -0
- data/lib/dbd_onto/meta.rb +2 -0
- data/lib/dbd_onto/version.rb +1 -1
- data/meta.md +9 -0
- data/spec/lib/dbd_onto/context_spec.rb +130 -27
- data/spec/lib/dbd_onto/meta_spec.rb +23 -5
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ede8f11775a32d58e3a1a21731a715c423e4f0be
|
4
|
+
data.tar.gz: 3ee5d735707945eae18fc78fa433d7429413d36e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d05a53b8788f30c0b284e5968dde06ed049e7581f85b09bbeb4ec029c3d865fdc73772911d39a9cd4271e46be4b11916a8bb088f1c736a8df9330ed29ab0b680
|
7
|
+
data.tar.gz: a796474f8bbcd6da099bd6c2a4f4f832cf5acb51a5d481be9a306b1c960a4dead2dc6e7f071bbada5e1a411abd4ed1dfd0abbf2f0a2608855a72f9eae451481c
|
data/HISTORY.txt
CHANGED
data/context.md
ADDED
data/lib/dbd_onto/context.rb
CHANGED
@@ -17,16 +17,28 @@ module DbdOnto
|
|
17
17
|
<<EOS
|
18
18
|
"2013-09-04 20:06:29.398680722 UTC","49a95413-64b6-4f86-ad44-caa7b03931f6","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","03e72b0c-041f-4afd-aab4-520db49b1fb1","meta:defines_predicate","context:visibility"
|
19
19
|
"2013-09-04 20:06:29.398711938 UTC","1614f36e-5b64-43ef-9228-ef391dc2902a","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","03e72b0c-041f-4afd-aab4-520db49b1fb1","rdfs:label","Visibility"
|
20
|
+
"2013-09-04 20:06:29.398712938 UTC","1614f36e-5b64-43ef-9228-ef391dc2902b","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","03e72b0c-041f-4afd-aab4-520db49b1fb1","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/context.md"
|
21
|
+
"2013-09-04 20:06:29.398713938 UTC","1614f36e-5b64-43ef-9228-ef391dc2902c","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","03e72b0c-041f-4afd-aab4-520db49b1fb1","rdfs:comment","E.g. public, private, professional, ..."
|
20
22
|
"2013-09-04 20:06:29.398728011 UTC","886738b0-fcf8-455e-a5a1-3f192b3cbbc1","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","735ae2a2-ed1f-405a-808a-07117cd6888c","meta:defines_predicate","context:encryption"
|
21
23
|
"2013-09-04 20:06:29.398743950 UTC","b85ea90d-01ea-4fc6-81b1-24cdabe9a968","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","735ae2a2-ed1f-405a-808a-07117cd6888c","rdfs:label","Encryption"
|
24
|
+
"2013-09-04 20:06:29.398744950 UTC","b85ea90d-01ea-4fc6-81b1-24cdabe9a969","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","735ae2a2-ed1f-405a-808a-07117cd6888c","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/context.md"
|
25
|
+
"2013-09-04 20:06:29.398745950 UTC","b85ea90d-01ea-4fc6-81b1-24cdabe9a96a","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","735ae2a2-ed1f-405a-808a-07117cd6888c","rdfs:comment","E.g. clear, encrypted, AES-256, my_very_secret_key"
|
22
26
|
"2013-09-04 20:06:29.398758526 UTC","6d9b18f7-ed98-488e-8d67-bd830c51efbd","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","5b2c73e5-490c-47e0-a014-592d8665ba58","meta:defines_predicate","context:license"
|
23
27
|
"2013-09-04 20:06:29.398775364 UTC","cd7d3d4a-d9c4-46e5-ba12-bc41938e50d4","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","5b2c73e5-490c-47e0-a014-592d8665ba58","rdfs:label","License"
|
28
|
+
"2013-09-04 20:06:29.398776364 UTC","cd7d3d4a-d9c4-46e5-ba12-bc41938e50d5","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","5b2c73e5-490c-47e0-a014-592d8665ba58","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/context.md"
|
29
|
+
"2013-09-04 20:06:29.398777364 UTC","cd7d3d4a-d9c4-46e5-ba12-bc41938e50d6","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","5b2c73e5-490c-47e0-a014-592d8665ba58","rdfs:comment","E.g. Copyright 2013 Peter Vandenabeele (http://vandenabeele.com), licensed under MIT"
|
24
30
|
"2013-09-04 20:06:29.411179884 UTC","a95a1e01-5701-41fa-ae57-5a93fc4e530e","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","ffc41d9c-ba51-4121-ae01-c2b04234b5f0","meta:defines_predicate","dc:source"
|
25
31
|
"2013-09-04 20:06:29.411232005 UTC","f063bd74-f767-47ed-a561-842eba382b79","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","ffc41d9c-ba51-4121-ae01-c2b04234b5f0","rdfs:label","Source"
|
32
|
+
"2013-09-04 20:06:29.411233005 UTC","f063bd74-f767-47ed-a561-842eba382b7a","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","ffc41d9c-ba51-4121-ae01-c2b04234b5f0","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/context.md"
|
33
|
+
"2013-09-04 20:06:29.411234005 UTC","f063bd74-f767-47ed-a561-842eba382b7b","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","ffc41d9c-ba51-4121-ae01-c2b04234b5f0","rdfs:comment","E.g. Entered manually by @peter_v (also see Dublin Core)"
|
26
34
|
"2013-09-04 20:06:29.411249613 UTC","8ebc54af-bfd9-47ad-8e19-c04282720743","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","2b5008b0-e12d-4aa2-8bb1-f9c20c36f8ef","meta:defines_predicate","dc:creator"
|
27
35
|
"2013-09-04 20:06:29.411264605 UTC","6d726d47-31cb-43a9-9e6d-b44401149500","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","2b5008b0-e12d-4aa2-8bb1-f9c20c36f8ef","rdfs:label","Creator"
|
36
|
+
"2013-09-04 20:06:29.411265605 UTC","6d726d47-31cb-43a9-9e6d-b44401149501","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","2b5008b0-e12d-4aa2-8bb1-f9c20c36f8ef","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/context.md"
|
37
|
+
"2013-09-04 20:06:29.411266605 UTC","6d726d47-31cb-43a9-9e6d-b44401149502","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","2b5008b0-e12d-4aa2-8bb1-f9c20c36f8ef","rdfs:comment","E.g. @peter_v (also see Dublin Core)"
|
28
38
|
"2013-09-04 20:06:29.414653441 UTC","90b35dd7-baa3-49b7-a224-d67d3ccadb7a","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","4aba46de-f35a-4754-913d-bdc4c926fc73","meta:defines_predicate","dcterms:created"
|
29
39
|
"2013-09-04 20:06:29.414677275 UTC","1ed030cf-260d-4380-bbbf-84f7c7e9d753","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","4aba46de-f35a-4754-913d-bdc4c926fc73","rdfs:label","Created"
|
40
|
+
"2013-09-04 20:06:29.414678275 UTC","1ed030cf-260d-4380-bbbf-84f7c7e9d753","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","4aba46de-f35a-4754-913d-bdc4c926fc73","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/context.md"
|
41
|
+
"2013-09-04 20:06:29.414679275 UTC","1ed030cf-260d-4380-bbbf-84f7c7e9d753","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","4aba46de-f35a-4754-913d-bdc4c926fc73","rdfs:comment","E.g. 2013-10-20 (also see Dublin Core Terms)"
|
30
42
|
EOS
|
31
43
|
end
|
32
44
|
end
|
data/lib/dbd_onto/meta.rb
CHANGED
@@ -17,6 +17,8 @@ module DbdOnto
|
|
17
17
|
<<EOS
|
18
18
|
"2013-09-03 21:41:36.627034414 UTC","1e84b23b-edf0-49f5-8ad3-76182dcfa124","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","619e69d4-6dad-4b14-bfce-8fd67d8e126c","meta:defines_predicate","meta:defines_predicate"
|
19
19
|
"2013-09-03 21:41:36.627066056 UTC","96d595be-205d-4c3a-8724-35b46457f9ed","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","619e69d4-6dad-4b14-bfce-8fd67d8e126c","rdfs:label","Defines predicate"
|
20
|
+
"2013-09-03 21:41:36.627067056 UTC","96d595be-205d-4c3a-8724-35b46457f9ee","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","619e69d4-6dad-4b14-bfce-8fd67d8e126c","rdf:uri","https://github.com/petervandenabeele/dbd_onto/blob/master/meta.md"
|
21
|
+
"2013-09-03 21:41:36.627068056 UTC","96d595be-205d-4c3a-8724-35b46457f9ef","36c0b50f-834e-45f5-a911-e3f2b47fe4b9","619e69d4-6dad-4b14-bfce-8fd67d8e126c","rdfs:comment","Needed to bootstrap ontology definitions"
|
20
22
|
EOS
|
21
23
|
end
|
22
24
|
|
data/lib/dbd_onto/version.rb
CHANGED
data/meta.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Meta ontology
|
2
|
+
|
3
|
+
A first meta ontology is constructed with 1 resource as a bootstrap to start defining the rest.
|
4
|
+
|
5
|
+
As a bootstrap, this ontology defines itself (the predicate is equal to the object).
|
6
|
+
|
7
|
+
It defines this predicate:
|
8
|
+
|
9
|
+
* meta:defines_predicate
|
@@ -10,8 +10,10 @@ describe DbdOnto::Context do
|
|
10
10
|
|
11
11
|
it 'all facts in the context ontology have the meta context as context' do
|
12
12
|
subject.all? do |fact|
|
13
|
-
|
13
|
+
begin
|
14
|
+
fact.is_a?(Dbd::ContextFact) ||
|
14
15
|
check_context?(subject.by_subject(fact.context_subject))
|
16
|
+
end
|
15
17
|
end.should be_true
|
16
18
|
end
|
17
19
|
|
@@ -19,22 +21,57 @@ describe DbdOnto::Context do
|
|
19
21
|
|
20
22
|
let(:visibility_subject) do
|
21
23
|
subject.detect do |fact|
|
22
|
-
|
23
|
-
|
24
|
+
begin
|
25
|
+
fact.predicate == 'meta:defines_predicate' &&
|
26
|
+
fact.object == 'context:visibility'
|
27
|
+
end
|
24
28
|
end.subject
|
25
29
|
end
|
26
30
|
|
27
31
|
let(:encryption_subject) do
|
28
32
|
subject.detect do |fact|
|
29
|
-
|
30
|
-
|
33
|
+
begin
|
34
|
+
fact.predicate == 'meta:defines_predicate' &&
|
35
|
+
fact.object == 'context:encryption'
|
36
|
+
end
|
31
37
|
end.subject
|
32
38
|
end
|
33
39
|
|
34
40
|
let(:source_subject) do
|
35
41
|
subject.detect do |fact|
|
36
|
-
|
37
|
-
|
42
|
+
begin
|
43
|
+
fact.predicate == 'meta:defines_predicate' &&
|
44
|
+
fact.object == 'dc:source'
|
45
|
+
end
|
46
|
+
end.subject
|
47
|
+
end
|
48
|
+
|
49
|
+
let(:creator_subject) do
|
50
|
+
subject.detect do |fact|
|
51
|
+
begin
|
52
|
+
fact.predicate == 'meta:defines_predicate' &&
|
53
|
+
fact.object == 'dc:creator'
|
54
|
+
end
|
55
|
+
end.subject
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
let(:created_subject) do
|
60
|
+
subject.detect do |fact|
|
61
|
+
begin
|
62
|
+
fact.predicate == 'meta:defines_predicate' &&
|
63
|
+
fact.object == 'dcterms:created'
|
64
|
+
end
|
65
|
+
end.subject
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
let(:license_subject) do
|
70
|
+
subject.detect do |fact|
|
71
|
+
begin
|
72
|
+
fact.predicate == 'meta:defines_predicate' &&
|
73
|
+
fact.object == 'context:license'
|
74
|
+
end
|
38
75
|
end.subject
|
39
76
|
end
|
40
77
|
|
@@ -44,6 +81,25 @@ describe DbdOnto::Context do
|
|
44
81
|
end
|
45
82
|
end
|
46
83
|
|
84
|
+
def assert_label_present(resource)
|
85
|
+
resource.detect do |fact|
|
86
|
+
fact.predicate == 'rdfs:label'
|
87
|
+
end.should_not be_nil
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
def assert_uri_present(resource)
|
92
|
+
resource.detect do |fact|
|
93
|
+
fact.predicate == 'rdf:uri'
|
94
|
+
end.should_not be_nil
|
95
|
+
end
|
96
|
+
|
97
|
+
def assert_comment_present(resource)
|
98
|
+
resource.detect do |fact|
|
99
|
+
fact.predicate == 'rdfs:comment'
|
100
|
+
end.should_not be_nil
|
101
|
+
end
|
102
|
+
|
47
103
|
describe 'context:visibility' do
|
48
104
|
|
49
105
|
let(:visibility_facts) { subject.by_subject(visibility_subject) }
|
@@ -54,10 +110,20 @@ describe DbdOnto::Context do
|
|
54
110
|
|
55
111
|
it 'has label Context' do
|
56
112
|
visibility_facts.detect do |fact|
|
57
|
-
|
58
|
-
|
113
|
+
begin
|
114
|
+
fact.predicate == 'rdfs:label' &&
|
115
|
+
fact.object == 'Visibility'
|
116
|
+
end
|
59
117
|
end.should_not be_nil
|
60
118
|
end
|
119
|
+
|
120
|
+
it 'has a uri' do
|
121
|
+
assert_uri_present(visibility_facts)
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'has a Comment' do
|
125
|
+
assert_comment_present(visibility_facts)
|
126
|
+
end
|
61
127
|
end
|
62
128
|
|
63
129
|
describe 'context:encryption' do
|
@@ -70,10 +136,20 @@ describe DbdOnto::Context do
|
|
70
136
|
|
71
137
|
it 'has label Encryption' do
|
72
138
|
encryption_facts.detect do |fact|
|
73
|
-
|
74
|
-
|
139
|
+
begin
|
140
|
+
fact.predicate == 'rdfs:label' &&
|
141
|
+
fact.object == 'Encryption'
|
142
|
+
end
|
75
143
|
end.should_not be_nil
|
76
144
|
end
|
145
|
+
|
146
|
+
it 'has a uri' do
|
147
|
+
assert_uri_present(encryption_facts)
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'has a Comment' do
|
151
|
+
assert_comment_present(encryption_facts)
|
152
|
+
end
|
77
153
|
end
|
78
154
|
|
79
155
|
describe 'dc:source' do
|
@@ -86,36 +162,63 @@ describe DbdOnto::Context do
|
|
86
162
|
|
87
163
|
it 'has label Source' do
|
88
164
|
source_facts.detect do |fact|
|
89
|
-
|
90
|
-
|
165
|
+
begin
|
166
|
+
fact.predicate == 'rdfs:label' &&
|
167
|
+
fact.object == 'Source'
|
168
|
+
end
|
91
169
|
end.should_not be_nil
|
92
170
|
end
|
171
|
+
|
172
|
+
it 'has a uri' do
|
173
|
+
assert_uri_present(source_facts)
|
174
|
+
end
|
175
|
+
|
176
|
+
it 'has a Comment' do
|
177
|
+
assert_comment_present(source_facts)
|
178
|
+
end
|
179
|
+
|
93
180
|
end
|
94
181
|
|
95
182
|
describe 'dc:creator' do
|
183
|
+
|
184
|
+
let(:creator_facts) { subject.by_subject(creator_subject) }
|
185
|
+
|
96
186
|
it 'defines the predicate' do
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
187
|
+
creator_subject.should_not be_nil
|
188
|
+
end
|
189
|
+
|
190
|
+
it 'has a uri' do
|
191
|
+
assert_uri_present(creator_facts)
|
192
|
+
end
|
193
|
+
|
194
|
+
it 'has a Comment' do
|
195
|
+
assert_comment_present(creator_facts)
|
101
196
|
end
|
102
197
|
end
|
103
198
|
|
104
199
|
describe 'dcterms:created' do
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
200
|
+
|
201
|
+
let(:created_facts) { subject.by_subject(created_subject) }
|
202
|
+
|
203
|
+
it 'has a uri' do
|
204
|
+
assert_uri_present(created_facts)
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'has a Comment' do
|
208
|
+
assert_comment_present(created_facts)
|
110
209
|
end
|
111
210
|
end
|
112
211
|
|
113
212
|
describe 'context:license' do
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
213
|
+
|
214
|
+
let(:license_facts) { subject.by_subject(license_subject) }
|
215
|
+
|
216
|
+
it 'has a uri' do
|
217
|
+
assert_uri_present(license_facts)
|
218
|
+
end
|
219
|
+
|
220
|
+
it 'has a Comment' do
|
221
|
+
assert_comment_present(license_facts)
|
119
222
|
end
|
120
223
|
end
|
121
224
|
end
|
@@ -10,8 +10,10 @@ describe DbdOnto::Meta do
|
|
10
10
|
|
11
11
|
it 'all facts in the meta ontology have the meta_context' do
|
12
12
|
subject.all? do |fact|
|
13
|
-
|
13
|
+
begin
|
14
|
+
fact.is_a?(Dbd::ContextFact) ||
|
14
15
|
check_context?(subject.by_subject(fact.context_subject))
|
16
|
+
end
|
15
17
|
end.should be_true
|
16
18
|
end
|
17
19
|
|
@@ -19,8 +21,10 @@ describe DbdOnto::Meta do
|
|
19
21
|
|
20
22
|
let(:meta_defines_predicate_subject) do
|
21
23
|
subject.detect do |fact|
|
22
|
-
|
23
|
-
|
24
|
+
begin
|
25
|
+
fact.predicate == 'meta:defines_predicate' &&
|
26
|
+
fact.object == 'meta:defines_predicate'
|
27
|
+
end
|
24
28
|
end.subject
|
25
29
|
end
|
26
30
|
|
@@ -34,8 +38,22 @@ describe DbdOnto::Meta do
|
|
34
38
|
|
35
39
|
it 'has label "Defines predicate"' do
|
36
40
|
defines_predicate_facts.detect do |fact|
|
37
|
-
|
38
|
-
|
41
|
+
begin
|
42
|
+
fact.predicate == 'rdfs:label' &&
|
43
|
+
fact.object == 'Defines predicate'
|
44
|
+
end
|
45
|
+
end.should_not be_nil
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'has a URI' do
|
49
|
+
defines_predicate_facts.detect do |fact|
|
50
|
+
fact.predicate == 'rdf:uri'
|
51
|
+
end.should_not be_nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'has a comment' do
|
55
|
+
defines_predicate_facts.detect do |fact|
|
56
|
+
fact.predicate == 'rdfs:comment'
|
39
57
|
end.should_not be_nil
|
40
58
|
end
|
41
59
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbd_onto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Vandenabeele
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- LICENSE.txt
|
168
168
|
- README.md
|
169
169
|
- Rakefile
|
170
|
+
- context.md
|
170
171
|
- data/schema_data.csv
|
171
172
|
- dbd_onto.gemspec
|
172
173
|
- lib/dbd_onto.rb
|
@@ -176,6 +177,7 @@ files:
|
|
176
177
|
- lib/dbd_onto/meta_context.rb
|
177
178
|
- lib/dbd_onto/schema.rb
|
178
179
|
- lib/dbd_onto/version.rb
|
180
|
+
- meta.md
|
179
181
|
- spec/lib/dbd_onto/base_spec.rb
|
180
182
|
- spec/lib/dbd_onto/context_spec.rb
|
181
183
|
- spec/lib/dbd_onto/meta_context_spec.rb
|