json-ld 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/json/ld.rb +1 -1
- data/lib/json/ld/api.rb +49 -44
- data/lib/json/ld/compact.rb +4 -4
- data/lib/json/ld/context.rb +20 -8
- data/lib/json/ld/expand.rb +73 -26
- data/lib/json/ld/flatten.rb +31 -2
- data/lib/json/ld/format.rb +4 -4
- data/lib/json/ld/frame.rb +182 -64
- data/lib/json/ld/streaming_writer.rb +1 -1
- data/lib/json/ld/to_rdf.rb +1 -1
- data/lib/json/ld/utils.rb +10 -1
- data/spec/context_spec.rb +20 -7
- data/spec/expand_spec.rb +19 -0
- data/spec/format_spec.rb +6 -6
- data/spec/frame_spec.rb +1250 -501
- data/spec/suite_helper.rb +1 -1
- metadata +27 -27
- data/spec/test-files/test-1-automatic.json +0 -10
- data/spec/test-files/test-2-automatic.json +0 -27
- data/spec/test-files/test-4-automatic.json +0 -10
- data/spec/test-files/test-5-automatic.json +0 -13
- data/spec/test-files/test-6-automatic.json +0 -10
- data/spec/test-files/test-7-automatic.json +0 -20
- data/spec/test-files/test-8-automatic.json +0 -1
data/spec/suite_helper.rb
CHANGED
@@ -42,7 +42,7 @@ module Fixtures
|
|
42
42
|
def options
|
43
43
|
@options ||= begin
|
44
44
|
opts = {documentLoader: Fixtures::SuiteTest.method(:documentLoader)}
|
45
|
-
{'processingMode' => "json-ld-1.
|
45
|
+
{'processingMode' => "json-ld-1.1"}.merge(property('option') || {}).each do |k, v|
|
46
46
|
opts[k.to_sym] = v
|
47
47
|
end
|
48
48
|
opts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-ld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -30,42 +30,56 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.12'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: linkeddata
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: jsonlint
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
61
|
+
version: '0.2'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
68
|
+
version: '0.2'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: oj
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
75
|
+
version: '2.17'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
82
|
+
version: '2.17'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: yajl-ruby
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,28 +226,28 @@ dependencies:
|
|
212
226
|
requirements:
|
213
227
|
- - "~>"
|
214
228
|
- !ruby/object:Gem::Version
|
215
|
-
version: '3.
|
229
|
+
version: '3.5'
|
216
230
|
type: :development
|
217
231
|
prerelease: false
|
218
232
|
version_requirements: !ruby/object:Gem::Requirement
|
219
233
|
requirements:
|
220
234
|
- - "~>"
|
221
235
|
- !ruby/object:Gem::Version
|
222
|
-
version: '3.
|
236
|
+
version: '3.5'
|
223
237
|
- !ruby/object:Gem::Dependency
|
224
238
|
name: rspec-its
|
225
239
|
requirement: !ruby/object:Gem::Requirement
|
226
240
|
requirements:
|
227
241
|
- - "~>"
|
228
242
|
- !ruby/object:Gem::Version
|
229
|
-
version: '1.
|
243
|
+
version: '1.2'
|
230
244
|
type: :development
|
231
245
|
prerelease: false
|
232
246
|
version_requirements: !ruby/object:Gem::Requirement
|
233
247
|
requirements:
|
234
248
|
- - "~>"
|
235
249
|
- !ruby/object:Gem::Version
|
236
|
-
version: '1.
|
250
|
+
version: '1.2'
|
237
251
|
- !ruby/object:Gem::Dependency
|
238
252
|
name: yard
|
239
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,14 +314,12 @@ files:
|
|
300
314
|
- spec/suite_remote_doc_spec.rb
|
301
315
|
- spec/suite_to_rdf_spec.rb
|
302
316
|
- spec/support/extensions.rb
|
303
|
-
- spec/test-files/test-1-automatic.json
|
304
317
|
- spec/test-files/test-1-compacted.json
|
305
318
|
- spec/test-files/test-1-context.json
|
306
319
|
- spec/test-files/test-1-expanded.json
|
307
320
|
- spec/test-files/test-1-input.json
|
308
321
|
- spec/test-files/test-1-normalized.json
|
309
322
|
- spec/test-files/test-1-rdf.ttl
|
310
|
-
- spec/test-files/test-2-automatic.json
|
311
323
|
- spec/test-files/test-2-compacted.json
|
312
324
|
- spec/test-files/test-2-context.json
|
313
325
|
- spec/test-files/test-2-expanded.json
|
@@ -320,31 +332,26 @@ files:
|
|
320
332
|
- spec/test-files/test-3-input.json
|
321
333
|
- spec/test-files/test-3-normalized.json
|
322
334
|
- spec/test-files/test-3-rdf.ttl
|
323
|
-
- spec/test-files/test-4-automatic.json
|
324
335
|
- spec/test-files/test-4-compacted.json
|
325
336
|
- spec/test-files/test-4-context.json
|
326
337
|
- spec/test-files/test-4-expanded.json
|
327
338
|
- spec/test-files/test-4-input.json
|
328
339
|
- spec/test-files/test-4-rdf.ttl
|
329
|
-
- spec/test-files/test-5-automatic.json
|
330
340
|
- spec/test-files/test-5-compacted.json
|
331
341
|
- spec/test-files/test-5-context.json
|
332
342
|
- spec/test-files/test-5-expanded.json
|
333
343
|
- spec/test-files/test-5-input.json
|
334
344
|
- spec/test-files/test-5-rdf.ttl
|
335
|
-
- spec/test-files/test-6-automatic.json
|
336
345
|
- spec/test-files/test-6-compacted.json
|
337
346
|
- spec/test-files/test-6-context.json
|
338
347
|
- spec/test-files/test-6-expanded.json
|
339
348
|
- spec/test-files/test-6-input.json
|
340
349
|
- spec/test-files/test-6-rdf.ttl
|
341
|
-
- spec/test-files/test-7-automatic.json
|
342
350
|
- spec/test-files/test-7-compacted.json
|
343
351
|
- spec/test-files/test-7-context.json
|
344
352
|
- spec/test-files/test-7-expanded.json
|
345
353
|
- spec/test-files/test-7-input.json
|
346
354
|
- spec/test-files/test-7-rdf.ttl
|
347
|
-
- spec/test-files/test-8-automatic.json
|
348
355
|
- spec/test-files/test-8-compacted.json
|
349
356
|
- spec/test-files/test-8-context.json
|
350
357
|
- spec/test-files/test-8-expanded.json
|
@@ -378,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
378
385
|
version: '0'
|
379
386
|
requirements: []
|
380
387
|
rubyforge_project: json-ld
|
381
|
-
rubygems_version: 2.
|
388
|
+
rubygems_version: 2.6.8
|
382
389
|
signing_key:
|
383
390
|
specification_version: 4
|
384
391
|
summary: JSON-LD reader/writer for Ruby.
|
@@ -407,14 +414,12 @@ test_files:
|
|
407
414
|
- spec/support/extensions.rb
|
408
415
|
- spec/to_rdf_spec.rb
|
409
416
|
- spec/writer_spec.rb
|
410
|
-
- spec/test-files/test-1-automatic.json
|
411
417
|
- spec/test-files/test-1-compacted.json
|
412
418
|
- spec/test-files/test-1-context.json
|
413
419
|
- spec/test-files/test-1-expanded.json
|
414
420
|
- spec/test-files/test-1-input.json
|
415
421
|
- spec/test-files/test-1-normalized.json
|
416
422
|
- spec/test-files/test-1-rdf.ttl
|
417
|
-
- spec/test-files/test-2-automatic.json
|
418
423
|
- spec/test-files/test-2-compacted.json
|
419
424
|
- spec/test-files/test-2-context.json
|
420
425
|
- spec/test-files/test-2-expanded.json
|
@@ -427,31 +432,26 @@ test_files:
|
|
427
432
|
- spec/test-files/test-3-input.json
|
428
433
|
- spec/test-files/test-3-normalized.json
|
429
434
|
- spec/test-files/test-3-rdf.ttl
|
430
|
-
- spec/test-files/test-4-automatic.json
|
431
435
|
- spec/test-files/test-4-compacted.json
|
432
436
|
- spec/test-files/test-4-context.json
|
433
437
|
- spec/test-files/test-4-expanded.json
|
434
438
|
- spec/test-files/test-4-input.json
|
435
439
|
- spec/test-files/test-4-rdf.ttl
|
436
|
-
- spec/test-files/test-5-automatic.json
|
437
440
|
- spec/test-files/test-5-compacted.json
|
438
441
|
- spec/test-files/test-5-context.json
|
439
442
|
- spec/test-files/test-5-expanded.json
|
440
443
|
- spec/test-files/test-5-input.json
|
441
444
|
- spec/test-files/test-5-rdf.ttl
|
442
|
-
- spec/test-files/test-6-automatic.json
|
443
445
|
- spec/test-files/test-6-compacted.json
|
444
446
|
- spec/test-files/test-6-context.json
|
445
447
|
- spec/test-files/test-6-expanded.json
|
446
448
|
- spec/test-files/test-6-input.json
|
447
449
|
- spec/test-files/test-6-rdf.ttl
|
448
|
-
- spec/test-files/test-7-automatic.json
|
449
450
|
- spec/test-files/test-7-compacted.json
|
450
451
|
- spec/test-files/test-7-context.json
|
451
452
|
- spec/test-files/test-7-expanded.json
|
452
453
|
- spec/test-files/test-7-input.json
|
453
454
|
- spec/test-files/test-7-rdf.ttl
|
454
|
-
- spec/test-files/test-8-automatic.json
|
455
455
|
- spec/test-files/test-8-compacted.json
|
456
456
|
- spec/test-files/test-8-context.json
|
457
457
|
- spec/test-files/test-8-expanded.json
|
@@ -1,10 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": {
|
3
|
-
"avatar": "http://xmlns.com/foaf/0.1/avatar",
|
4
|
-
"homepage": "http://xmlns.com/foaf/0.1/homepage",
|
5
|
-
"name": "http://xmlns.com/foaf/0.1/name"
|
6
|
-
},
|
7
|
-
"avatar": "http://twitter.com/account/profile_image/manusporny",
|
8
|
-
"homepage": "http://manu.sporny.org/",
|
9
|
-
"name": "Manu Sporny"
|
10
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": [
|
3
|
-
{
|
4
|
-
"dc": "http://purl.org/dc/elements/1.1/",
|
5
|
-
"ex": "http://example.org/vocab#"
|
6
|
-
},
|
7
|
-
{
|
8
|
-
"ex:contains": {
|
9
|
-
"@coerce": "@id"
|
10
|
-
}
|
11
|
-
}
|
12
|
-
],
|
13
|
-
"@id": "http://example.org/library",
|
14
|
-
"@type": "ex:Library",
|
15
|
-
"ex:contains": {
|
16
|
-
"@id": "http://example.org/library/the-republic",
|
17
|
-
"@type": "ex:Book",
|
18
|
-
"dc:creator": "Plato",
|
19
|
-
"dc:title": "The Republic",
|
20
|
-
"ex:contains": {
|
21
|
-
"@id": "http://example.org/library/the-republic#introduction",
|
22
|
-
"@type": "ex:Chapter",
|
23
|
-
"dc:description": "An introductory chapter on The Republic.",
|
24
|
-
"dc:title": "The Introduction"
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": [
|
3
|
-
{ "foaf": "http://xmlns.com/foaf/0.1/" },
|
4
|
-
{ "foaf:knows": { "@coerce": "@id" } }
|
5
|
-
],
|
6
|
-
"@id": "http://manu.sporny.org/#me",
|
7
|
-
"@type": "foaf:Person",
|
8
|
-
"foaf:name": "Manu Sporny",
|
9
|
-
"foaf:knows": {
|
10
|
-
"@type": "foaf:Person",
|
11
|
-
"foaf:name": "Gregg Kellogg"
|
12
|
-
}
|
13
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": [
|
3
|
-
{ "foaf": "http://xmlns.com/foaf/0.1/" },
|
4
|
-
{ "foaf:nick": { "@coerce": "@id", "@list": true } }
|
5
|
-
],
|
6
|
-
"@id": "http://example.org/people#joebob",
|
7
|
-
"@type": "foaf:Person",
|
8
|
-
"foaf:name": "Joe Bob",
|
9
|
-
"foaf:nick": [ "joe", "bob", "jaybe" ]
|
10
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": { "foaf": "http://xmlns.com/foaf/0.1/" },
|
3
|
-
"@id": [
|
4
|
-
{
|
5
|
-
"@type": "foaf:Person",
|
6
|
-
"foaf:homepage": "http://example.com/bob/",
|
7
|
-
"foaf:name": "Bob"
|
8
|
-
},
|
9
|
-
{
|
10
|
-
"@type": "foaf:Person",
|
11
|
-
"foaf:homepage": "http://example.com/eve/",
|
12
|
-
"foaf:name": "Eve"
|
13
|
-
},
|
14
|
-
{
|
15
|
-
"@type": "foaf:Person",
|
16
|
-
"foaf:homepage": "http://example.com/manu/",
|
17
|
-
"foaf:name": "Manu"
|
18
|
-
}
|
19
|
-
]
|
20
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{}
|