json-ld 0.1.4.1 → 0.1.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4.1
1
+ 0.1.4.2
@@ -635,7 +635,7 @@ module JSON::LD
635
635
  when RDF::XSD.boolean, RDF::XSD.integer, RDF::XSD.double then value.datatype
636
636
  else value
637
637
  end
638
- when RDF::Term then value
638
+ when RDF::Term then value.class.name
639
639
  else value
640
640
  end
641
641
 
@@ -691,8 +691,8 @@ module JSON::LD
691
691
  res['@type'] = coerce(property)
692
692
  res
693
693
  end
694
- when RDF::URI, RDF::Node
695
- debug("URI || BNode")
694
+ when "RDF::URI", "RDF::Node"
695
+ debug("URI | BNode") { value.to_s }
696
696
  {'@id' => value.to_s}
697
697
  when RDF::Literal
698
698
  debug("Literal")
@@ -875,6 +875,12 @@ describe JSON::LD::EvaluationContext do
875
875
  subject.set_coerce("ex:boolean", RDF::XSD.boolean.to_s)
876
876
  end
877
877
 
878
+ %w(boolean integer string dateTime date time).each do |dt|
879
+ it "expands datatype xsd:#{dt}" do
880
+ subject.expand_value("foo", RDF::XSD[dt]).should produce({"@id" => "http://www.w3.org/2001/XMLSchema##{dt}"}, @debug)
881
+ end
882
+ end
883
+
878
884
  {
879
885
  "absolute IRI" => ["foaf:knows", "http://example.com/", {"@id" => "http://example.com/"}],
880
886
  "term" => ["foaf:knows", "ex", {"@id" => "http://example.org/"}],
@@ -324,6 +324,29 @@ describe JSON::LD::API do
324
324
  }], @debug)
325
325
  end
326
326
  end
327
+
328
+ context "problems" do
329
+ {
330
+ "xsd:boolean as value" => [
331
+ %(
332
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
333
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
334
+
335
+ <http://data.wikia.com/terms#playable> rdfs:range xsd:boolean .
336
+ ),
337
+ [{
338
+ "@id" => "http://data.wikia.com/terms#playable",
339
+ "http://www.w3.org/2000/01/rdf-schema#range" => [
340
+ { "@id" => "http://www.w3.org/2001/XMLSchema#boolean" }
341
+ ]
342
+ }]
343
+ ],
344
+ }.each do |t, (input, output)|
345
+ it "#{t}" do
346
+ serialize(input).should produce(output, @debug)
347
+ end
348
+ end
349
+ end
327
350
  end
328
351
 
329
352
  def parse(input, options = {})
metadata CHANGED
@@ -1,238 +1,232 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: json-ld
3
- version: !ruby/object:Gem::Version
4
- hash: 85
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.4.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 4
10
- - 1
11
- version: 0.1.4.1
12
6
  platform: ruby
13
- authors:
7
+ authors:
14
8
  - Gregg Kellogg
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2012-07-14 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-07-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rdf
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 25
30
- segments:
31
- - 0
32
- - 3
33
- - 5
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
34
21
  version: 0.3.5
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: json
39
23
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
41
25
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 5
46
- segments:
47
- - 1
48
- - 6
49
- - 5
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.3.5
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
50
37
  version: 1.6.5
51
38
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: equivalent-xml
55
39
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
57
41
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 7
62
- segments:
63
- - 0
64
- - 2
65
- - 8
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.6.5
46
+ - !ruby/object:Gem::Dependency
47
+ name: equivalent-xml
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
66
53
  version: 0.2.8
67
54
  type: :development
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: open-uri-cached
71
55
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.8
62
+ - !ruby/object:Gem::Dependency
63
+ name: open-uri-cached
64
+ requirement: !ruby/object:Gem::Requirement
73
65
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 21
78
- segments:
79
- - 0
80
- - 0
81
- - 5
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
82
69
  version: 0.0.5
83
70
  type: :development
84
- version_requirements: *id004
85
- - !ruby/object:Gem::Dependency
86
- name: yard
87
71
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 0.0.5
78
+ - !ruby/object:Gem::Dependency
79
+ name: yard
80
+ requirement: !ruby/object:Gem::Requirement
89
81
  none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 11
94
- segments:
95
- - 0
96
- - 7
97
- - 4
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
98
85
  version: 0.7.4
99
86
  type: :development
100
- version_requirements: *id005
101
- - !ruby/object:Gem::Dependency
102
- name: spira
103
87
  prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
105
89
  none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: 7
110
- segments:
111
- - 0
112
- - 0
113
- - 12
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 0.7.4
94
+ - !ruby/object:Gem::Dependency
95
+ name: spira
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
114
101
  version: 0.0.12
115
102
  type: :development
116
- version_requirements: *id006
117
- - !ruby/object:Gem::Dependency
118
- name: rspec
119
103
  prerelease: false
120
- requirement: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 0.0.12
110
+ - !ruby/object:Gem::Dependency
111
+ name: rspec
112
+ requirement: !ruby/object:Gem::Requirement
121
113
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 47
126
- segments:
127
- - 2
128
- - 8
129
- - 0
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
130
117
  version: 2.8.0
131
118
  type: :development
132
- version_requirements: *id007
133
- - !ruby/object:Gem::Dependency
134
- name: rdf-spec
135
119
  prerelease: false
136
- requirement: &id008 !ruby/object:Gem::Requirement
120
+ version_requirements: !ruby/object:Gem::Requirement
137
121
  none: false
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- hash: 25
142
- segments:
143
- - 0
144
- - 3
145
- - 5
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: 2.8.0
126
+ - !ruby/object:Gem::Dependency
127
+ name: rdf-spec
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
146
133
  version: 0.3.5
147
134
  type: :development
148
- version_requirements: *id008
149
- - !ruby/object:Gem::Dependency
150
- name: rdf-turtle
151
135
  prerelease: false
152
- requirement: &id009 !ruby/object:Gem::Requirement
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: 0.3.5
142
+ - !ruby/object:Gem::Dependency
143
+ name: rdf-turtle
144
+ requirement: !ruby/object:Gem::Requirement
153
145
  none: false
154
- requirements:
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- hash: 25
158
- segments:
159
- - 0
160
- - 1
161
- - 1
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
162
149
  version: 0.1.1
163
150
  type: :development
164
- version_requirements: *id009
165
- - !ruby/object:Gem::Dependency
166
- name: rdf-trig
167
151
  prerelease: false
168
- requirement: &id010 !ruby/object:Gem::Requirement
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: 0.1.1
158
+ - !ruby/object:Gem::Dependency
159
+ name: rdf-trig
160
+ requirement: !ruby/object:Gem::Requirement
169
161
  none: false
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- hash: 25
174
- segments:
175
- - 0
176
- - 1
177
- - 1
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
178
165
  version: 0.1.1
179
166
  type: :development
180
- version_requirements: *id010
181
- - !ruby/object:Gem::Dependency
182
- name: rdf-isomorphic
183
167
  prerelease: false
184
- requirement: &id011 !ruby/object:Gem::Requirement
168
+ version_requirements: !ruby/object:Gem::Requirement
185
169
  none: false
186
- requirements:
187
- - - ">="
188
- - !ruby/object:Gem::Version
189
- hash: 27
190
- segments:
191
- - 0
192
- - 3
193
- - 4
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: 0.1.1
174
+ - !ruby/object:Gem::Dependency
175
+ name: rdf-isomorphic
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
194
181
  version: 0.3.4
195
182
  type: :development
196
- version_requirements: *id011
197
- - !ruby/object:Gem::Dependency
198
- name: rdf-xsd
199
183
  prerelease: false
200
- requirement: &id012 !ruby/object:Gem::Requirement
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: 0.3.4
190
+ - !ruby/object:Gem::Dependency
191
+ name: rdf-xsd
192
+ requirement: !ruby/object:Gem::Requirement
201
193
  none: false
202
- requirements:
203
- - - ">="
204
- - !ruby/object:Gem::Version
205
- hash: 29
206
- segments:
207
- - 0
208
- - 3
209
- - 7
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
210
197
  version: 0.3.7
211
198
  type: :development
212
- version_requirements: *id012
213
- - !ruby/object:Gem::Dependency
214
- name: backports
215
199
  prerelease: false
216
- requirement: &id013 !ruby/object:Gem::Requirement
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: 0.3.7
206
+ - !ruby/object:Gem::Dependency
207
+ name: backports
208
+ requirement: !ruby/object:Gem::Requirement
217
209
  none: false
218
- requirements:
219
- - - ">="
220
- - !ruby/object:Gem::Version
221
- hash: 3
222
- segments:
223
- - 0
224
- version: "0"
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
225
214
  type: :runtime
226
- version_requirements: *id013
227
- description: JSON::LD parses and serializes JSON-LD into RDF and implements expansion, compaction and framing API interfaces.
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ description: JSON::LD parses and serializes JSON-LD into RDF and implements expansion,
223
+ compaction and framing API interfaces.
228
224
  email: public-linked-json@w3.org
229
- executables:
225
+ executables:
230
226
  - jsonld
231
227
  extensions: []
232
-
233
228
  extra_rdoc_files: []
234
-
235
- files:
229
+ files:
236
230
  - AUTHORS
237
231
  - README.markdown
238
232
  - History.markdown
@@ -325,41 +319,31 @@ files:
325
319
  - spec/test-files/test-9-input.json
326
320
  - bin/jsonld
327
321
  homepage: http://github.com/gkellogg/json-ld
328
- licenses:
322
+ licenses:
329
323
  - Public Domain
330
324
  post_install_message:
331
325
  rdoc_options: []
332
-
333
- require_paths:
326
+ require_paths:
334
327
  - lib
335
- required_ruby_version: !ruby/object:Gem::Requirement
328
+ required_ruby_version: !ruby/object:Gem::Requirement
336
329
  none: false
337
- requirements:
338
- - - ">="
339
- - !ruby/object:Gem::Version
340
- hash: 53
341
- segments:
342
- - 1
343
- - 8
344
- - 1
330
+ requirements:
331
+ - - ! '>='
332
+ - !ruby/object:Gem::Version
345
333
  version: 1.8.1
346
- required_rubygems_version: !ruby/object:Gem::Requirement
334
+ required_rubygems_version: !ruby/object:Gem::Requirement
347
335
  none: false
348
- requirements:
349
- - - ">="
350
- - !ruby/object:Gem::Version
351
- hash: 3
352
- segments:
353
- - 0
354
- version: "0"
336
+ requirements:
337
+ - - ! '>='
338
+ - !ruby/object:Gem::Version
339
+ version: '0'
355
340
  requirements: []
356
-
357
341
  rubyforge_project: json-ld
358
- rubygems_version: 1.8.17
342
+ rubygems_version: 1.8.24
359
343
  signing_key:
360
344
  specification_version: 3
361
345
  summary: JSON-LD reader/writer for Ruby.
362
- test_files:
346
+ test_files:
363
347
  - spec/api_spec.rb
364
348
  - spec/compact_spec.rb
365
349
  - spec/evaluation_context_spec.rb