json-ld 3.2.0 → 3.2.3

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -7
  3. data/VERSION +1 -1
  4. data/lib/json/ld/api.rb +55 -16
  5. data/lib/json/ld/context.rb +7 -7
  6. data/lib/json/ld/expand.rb +2 -2
  7. data/lib/json/ld/format.rb +83 -116
  8. data/lib/json/ld/reader.rb +2 -2
  9. data/lib/json/ld/streaming_reader.rb +2 -1
  10. data/lib/json/ld/to_rdf.rb +9 -8
  11. data/lib/json/ld/writer.rb +9 -10
  12. data/lib/json/ld.rb +3 -0
  13. data/spec/api_spec.rb +67 -19
  14. data/spec/format_spec.rb +7 -3
  15. data/spec/frame_spec.rb +25 -1
  16. data/spec/reader_spec.rb +14 -14
  17. data/spec/suite_helper.rb +1 -0
  18. data/spec/test-files/{test-1-compacted.json → test-1-compacted.jsonld} +0 -0
  19. data/spec/test-files/{test-1-context.json → test-1-context.jsonld} +0 -0
  20. data/spec/test-files/{test-1-expanded.json → test-1-expanded.jsonld} +0 -0
  21. data/spec/test-files/{test-1-input.json → test-1-input.jsonld} +0 -0
  22. data/spec/test-files/{test-2-compacted.json → test-2-compacted.jsonld} +0 -0
  23. data/spec/test-files/{test-2-context.json → test-2-context.jsonld} +0 -0
  24. data/spec/test-files/{test-2-expanded.json → test-2-expanded.jsonld} +0 -0
  25. data/spec/test-files/{test-2-input.json → test-2-input.jsonld} +0 -0
  26. data/spec/test-files/{test-3-compacted.json → test-3-compacted.jsonld} +0 -0
  27. data/spec/test-files/{test-3-context.json → test-3-context.jsonld} +0 -0
  28. data/spec/test-files/{test-3-expanded.json → test-3-expanded.jsonld} +0 -0
  29. data/spec/test-files/{test-3-input.json → test-3-input.jsonld} +0 -0
  30. data/spec/test-files/{test-4-compacted.json → test-4-compacted.jsonld} +0 -0
  31. data/spec/test-files/{test-4-context.json → test-4-context.jsonld} +0 -0
  32. data/spec/test-files/{test-4-expanded.json → test-4-expanded.jsonld} +0 -0
  33. data/spec/test-files/{test-4-input.json → test-4-input.jsonld} +0 -0
  34. data/spec/test-files/{test-5-compacted.json → test-5-compacted.jsonld} +0 -0
  35. data/spec/test-files/{test-5-context.json → test-5-context.jsonld} +0 -0
  36. data/spec/test-files/{test-5-expanded.json → test-5-expanded.jsonld} +0 -0
  37. data/spec/test-files/{test-5-input.json → test-5-input.jsonld} +0 -0
  38. data/spec/test-files/{test-6-compacted.json → test-6-compacted.jsonld} +0 -0
  39. data/spec/test-files/{test-6-context.json → test-6-context.jsonld} +0 -0
  40. data/spec/test-files/{test-6-expanded.json → test-6-expanded.jsonld} +0 -0
  41. data/spec/test-files/{test-6-input.json → test-6-input.jsonld} +0 -0
  42. data/spec/test-files/{test-7-compacted.json → test-7-compacted.jsonld} +0 -0
  43. data/spec/test-files/{test-7-context.json → test-7-context.jsonld} +0 -0
  44. data/spec/test-files/{test-7-expanded.json → test-7-expanded.jsonld} +0 -0
  45. data/spec/test-files/{test-7-input.json → test-7-input.jsonld} +0 -0
  46. data/spec/test-files/{test-8-compacted.json → test-8-compacted.jsonld} +0 -0
  47. data/spec/test-files/{test-8-context.json → test-8-context.jsonld} +0 -0
  48. data/spec/test-files/{test-8-expanded.json → test-8-expanded.jsonld} +0 -0
  49. data/spec/test-files/{test-8-frame.json → test-8-frame.jsonld} +0 -0
  50. data/spec/test-files/{test-8-framed.json → test-8-framed.jsonld} +0 -0
  51. data/spec/test-files/{test-8-input.json → test-8-input.jsonld} +0 -0
  52. data/spec/test-files/{test-9-compacted.json → test-9-compacted.jsonld} +0 -0
  53. data/spec/test-files/{test-9-context.json → test-9-context.jsonld} +0 -0
  54. data/spec/test-files/{test-9-expanded.json → test-9-expanded.jsonld} +0 -0
  55. data/spec/test-files/{test-9-input.json → test-9-input.jsonld} +0 -0
  56. metadata +94 -89
  57. data/spec/test-files/test-1-normalized.json +0 -8
  58. data/spec/test-files/test-2-normalized.json +0 -32
  59. data/spec/test-files/test-3-normalized.json +0 -13
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: 3.2.0
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-12 00:00:00.000000000 Z
11
+ date: 2022-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.2.9
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.2.9
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: multi_json
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +112,14 @@ dependencies:
106
112
  requirements:
107
113
  - - "~>"
108
114
  - !ruby/object:Gem::Version
109
- version: '3.1'
115
+ version: '3.2'
110
116
  type: :development
111
117
  prerelease: false
112
118
  version_requirements: !ruby/object:Gem::Requirement
113
119
  requirements:
114
120
  - - "~>"
115
121
  - !ruby/object:Gem::Version
116
- version: '3.1'
122
+ version: '3.2'
117
123
  - !ruby/object:Gem::Dependency
118
124
  name: jsonlint
119
125
  requirement: !ruby/object:Gem::Requirement
@@ -260,14 +266,14 @@ dependencies:
260
266
  requirements:
261
267
  - - "~>"
262
268
  - !ruby/object:Gem::Version
263
- version: '3.10'
269
+ version: '3.11'
264
270
  type: :development
265
271
  prerelease: false
266
272
  version_requirements: !ruby/object:Gem::Requirement
267
273
  requirements:
268
274
  - - "~>"
269
275
  - !ruby/object:Gem::Version
270
- version: '3.10'
276
+ version: '3.11'
271
277
  - !ruby/object:Gem::Dependency
272
278
  name: rspec-its
273
279
  requirement: !ruby/object:Gem::Requirement
@@ -357,61 +363,63 @@ files:
357
363
  - spec/suite_remote_doc_spec.rb
358
364
  - spec/suite_to_rdf_spec.rb
359
365
  - spec/support/extensions.rb
360
- - spec/test-files/test-1-compacted.json
361
- - spec/test-files/test-1-context.json
362
- - spec/test-files/test-1-expanded.json
363
- - spec/test-files/test-1-input.json
364
- - spec/test-files/test-1-normalized.json
366
+ - spec/test-files/test-1-compacted.jsonld
367
+ - spec/test-files/test-1-context.jsonld
368
+ - spec/test-files/test-1-expanded.jsonld
369
+ - spec/test-files/test-1-input.jsonld
365
370
  - spec/test-files/test-1-rdf.ttl
366
- - spec/test-files/test-2-compacted.json
367
- - spec/test-files/test-2-context.json
368
- - spec/test-files/test-2-expanded.json
369
- - spec/test-files/test-2-input.json
370
- - spec/test-files/test-2-normalized.json
371
+ - spec/test-files/test-2-compacted.jsonld
372
+ - spec/test-files/test-2-context.jsonld
373
+ - spec/test-files/test-2-expanded.jsonld
374
+ - spec/test-files/test-2-input.jsonld
371
375
  - spec/test-files/test-2-rdf.ttl
372
- - spec/test-files/test-3-compacted.json
373
- - spec/test-files/test-3-context.json
374
- - spec/test-files/test-3-expanded.json
375
- - spec/test-files/test-3-input.json
376
- - spec/test-files/test-3-normalized.json
376
+ - spec/test-files/test-3-compacted.jsonld
377
+ - spec/test-files/test-3-context.jsonld
378
+ - spec/test-files/test-3-expanded.jsonld
379
+ - spec/test-files/test-3-input.jsonld
377
380
  - spec/test-files/test-3-rdf.ttl
378
- - spec/test-files/test-4-compacted.json
379
- - spec/test-files/test-4-context.json
380
- - spec/test-files/test-4-expanded.json
381
- - spec/test-files/test-4-input.json
381
+ - spec/test-files/test-4-compacted.jsonld
382
+ - spec/test-files/test-4-context.jsonld
383
+ - spec/test-files/test-4-expanded.jsonld
384
+ - spec/test-files/test-4-input.jsonld
382
385
  - spec/test-files/test-4-rdf.ttl
383
- - spec/test-files/test-5-compacted.json
384
- - spec/test-files/test-5-context.json
385
- - spec/test-files/test-5-expanded.json
386
- - spec/test-files/test-5-input.json
386
+ - spec/test-files/test-5-compacted.jsonld
387
+ - spec/test-files/test-5-context.jsonld
388
+ - spec/test-files/test-5-expanded.jsonld
389
+ - spec/test-files/test-5-input.jsonld
387
390
  - spec/test-files/test-5-rdf.ttl
388
- - spec/test-files/test-6-compacted.json
389
- - spec/test-files/test-6-context.json
390
- - spec/test-files/test-6-expanded.json
391
- - spec/test-files/test-6-input.json
391
+ - spec/test-files/test-6-compacted.jsonld
392
+ - spec/test-files/test-6-context.jsonld
393
+ - spec/test-files/test-6-expanded.jsonld
394
+ - spec/test-files/test-6-input.jsonld
392
395
  - spec/test-files/test-6-rdf.ttl
393
- - spec/test-files/test-7-compacted.json
394
- - spec/test-files/test-7-context.json
395
- - spec/test-files/test-7-expanded.json
396
- - spec/test-files/test-7-input.json
396
+ - spec/test-files/test-7-compacted.jsonld
397
+ - spec/test-files/test-7-context.jsonld
398
+ - spec/test-files/test-7-expanded.jsonld
399
+ - spec/test-files/test-7-input.jsonld
397
400
  - spec/test-files/test-7-rdf.ttl
398
- - spec/test-files/test-8-compacted.json
399
- - spec/test-files/test-8-context.json
400
- - spec/test-files/test-8-expanded.json
401
- - spec/test-files/test-8-frame.json
402
- - spec/test-files/test-8-framed.json
403
- - spec/test-files/test-8-input.json
401
+ - spec/test-files/test-8-compacted.jsonld
402
+ - spec/test-files/test-8-context.jsonld
403
+ - spec/test-files/test-8-expanded.jsonld
404
+ - spec/test-files/test-8-frame.jsonld
405
+ - spec/test-files/test-8-framed.jsonld
406
+ - spec/test-files/test-8-input.jsonld
404
407
  - spec/test-files/test-8-rdf.ttl
405
- - spec/test-files/test-9-compacted.json
406
- - spec/test-files/test-9-context.json
407
- - spec/test-files/test-9-expanded.json
408
- - spec/test-files/test-9-input.json
408
+ - spec/test-files/test-9-compacted.jsonld
409
+ - spec/test-files/test-9-context.jsonld
410
+ - spec/test-files/test-9-expanded.jsonld
411
+ - spec/test-files/test-9-input.jsonld
409
412
  - spec/to_rdf_spec.rb
410
413
  - spec/writer_spec.rb
411
414
  homepage: https://github.com/ruby-rdf/json-ld
412
415
  licenses:
413
416
  - Unlicense
414
- metadata: {}
417
+ metadata:
418
+ documentation_uri: https://ruby-rdf.github.io/json-ld
419
+ bug_tracker_uri: https://github.com/ruby-rdf/json-ld/issues
420
+ homepage_uri: https://github.com/ruby-rdf/json-ld
421
+ mailing_list_uri: https://lists.w3.org/Archives/Public/public-rdf-ruby/
422
+ source_code_uri: https://github.com/ruby-rdf/json-ld
415
423
  post_install_message:
416
424
  rdoc_options: []
417
425
  require_paths:
@@ -461,52 +469,49 @@ test_files:
461
469
  - spec/support/extensions.rb
462
470
  - spec/to_rdf_spec.rb
463
471
  - spec/writer_spec.rb
464
- - spec/test-files/test-1-compacted.json
465
- - spec/test-files/test-1-context.json
466
- - spec/test-files/test-1-expanded.json
467
- - spec/test-files/test-1-input.json
468
- - spec/test-files/test-1-normalized.json
472
+ - spec/test-files/test-1-compacted.jsonld
473
+ - spec/test-files/test-1-context.jsonld
474
+ - spec/test-files/test-1-expanded.jsonld
475
+ - spec/test-files/test-1-input.jsonld
469
476
  - spec/test-files/test-1-rdf.ttl
470
- - spec/test-files/test-2-compacted.json
471
- - spec/test-files/test-2-context.json
472
- - spec/test-files/test-2-expanded.json
473
- - spec/test-files/test-2-input.json
474
- - spec/test-files/test-2-normalized.json
477
+ - spec/test-files/test-2-compacted.jsonld
478
+ - spec/test-files/test-2-context.jsonld
479
+ - spec/test-files/test-2-expanded.jsonld
480
+ - spec/test-files/test-2-input.jsonld
475
481
  - spec/test-files/test-2-rdf.ttl
476
- - spec/test-files/test-3-compacted.json
477
- - spec/test-files/test-3-context.json
478
- - spec/test-files/test-3-expanded.json
479
- - spec/test-files/test-3-input.json
480
- - spec/test-files/test-3-normalized.json
482
+ - spec/test-files/test-3-compacted.jsonld
483
+ - spec/test-files/test-3-context.jsonld
484
+ - spec/test-files/test-3-expanded.jsonld
485
+ - spec/test-files/test-3-input.jsonld
481
486
  - spec/test-files/test-3-rdf.ttl
482
- - spec/test-files/test-4-compacted.json
483
- - spec/test-files/test-4-context.json
484
- - spec/test-files/test-4-expanded.json
485
- - spec/test-files/test-4-input.json
487
+ - spec/test-files/test-4-compacted.jsonld
488
+ - spec/test-files/test-4-context.jsonld
489
+ - spec/test-files/test-4-expanded.jsonld
490
+ - spec/test-files/test-4-input.jsonld
486
491
  - spec/test-files/test-4-rdf.ttl
487
- - spec/test-files/test-5-compacted.json
488
- - spec/test-files/test-5-context.json
489
- - spec/test-files/test-5-expanded.json
490
- - spec/test-files/test-5-input.json
492
+ - spec/test-files/test-5-compacted.jsonld
493
+ - spec/test-files/test-5-context.jsonld
494
+ - spec/test-files/test-5-expanded.jsonld
495
+ - spec/test-files/test-5-input.jsonld
491
496
  - spec/test-files/test-5-rdf.ttl
492
- - spec/test-files/test-6-compacted.json
493
- - spec/test-files/test-6-context.json
494
- - spec/test-files/test-6-expanded.json
495
- - spec/test-files/test-6-input.json
497
+ - spec/test-files/test-6-compacted.jsonld
498
+ - spec/test-files/test-6-context.jsonld
499
+ - spec/test-files/test-6-expanded.jsonld
500
+ - spec/test-files/test-6-input.jsonld
496
501
  - spec/test-files/test-6-rdf.ttl
497
- - spec/test-files/test-7-compacted.json
498
- - spec/test-files/test-7-context.json
499
- - spec/test-files/test-7-expanded.json
500
- - spec/test-files/test-7-input.json
502
+ - spec/test-files/test-7-compacted.jsonld
503
+ - spec/test-files/test-7-context.jsonld
504
+ - spec/test-files/test-7-expanded.jsonld
505
+ - spec/test-files/test-7-input.jsonld
501
506
  - spec/test-files/test-7-rdf.ttl
502
- - spec/test-files/test-8-compacted.json
503
- - spec/test-files/test-8-context.json
504
- - spec/test-files/test-8-expanded.json
505
- - spec/test-files/test-8-frame.json
506
- - spec/test-files/test-8-framed.json
507
- - spec/test-files/test-8-input.json
507
+ - spec/test-files/test-8-compacted.jsonld
508
+ - spec/test-files/test-8-context.jsonld
509
+ - spec/test-files/test-8-expanded.jsonld
510
+ - spec/test-files/test-8-frame.jsonld
511
+ - spec/test-files/test-8-framed.jsonld
512
+ - spec/test-files/test-8-input.jsonld
508
513
  - spec/test-files/test-8-rdf.ttl
509
- - spec/test-files/test-9-compacted.json
510
- - spec/test-files/test-9-context.json
511
- - spec/test-files/test-9-expanded.json
512
- - spec/test-files/test-9-input.json
514
+ - spec/test-files/test-9-compacted.jsonld
515
+ - spec/test-files/test-9-context.jsonld
516
+ - spec/test-files/test-9-expanded.jsonld
517
+ - spec/test-files/test-9-input.jsonld
@@ -1,8 +0,0 @@
1
- [{
2
- "@id": {
3
- "@id": "_:c14n0"
4
- },
5
- "http://xmlns.com/foaf/0.1/avatar": "http://twitter.com/account/profile_image/manusporny",
6
- "http://xmlns.com/foaf/0.1/homepage": "http://manu.sporny.org/",
7
- "http://xmlns.com/foaf/0.1/name": "Manu Sporny"
8
- }]
@@ -1,32 +0,0 @@
1
- [{
2
- "@id": {
3
- "@id": "http://example.org/library"
4
- },
5
- "http://example.org/vocab#contains": {
6
- "@id": "http://example.org/library/the-republic"
7
- },
8
- "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {
9
- "@id": "http://example.org/vocab#Library"
10
- }
11
- }, {
12
- "@id": {
13
- "@id": "http://example.org/library/the-republic"
14
- },
15
- "http://example.org/vocab#contains": {
16
- "@id": "http://example.org/library/the-republic#introduction"
17
- },
18
- "http://purl.org/dc/elements/1.1/creator": "Plato",
19
- "http://purl.org/dc/elements/1.1/title": "The Republic",
20
- "@type": {
21
- "@id": "http://example.org/vocab#Book"
22
- }
23
- }, {
24
- "@id": {
25
- "@id": "http://example.org/library/the-republic#introduction"
26
- },
27
- "http://purl.org/dc/elements/1.1/description": "An introductory chapter on The Republic.",
28
- "http://purl.org/dc/elements/1.1/title": "The Introduction",
29
- "@type": {
30
- "@id": "http://example.org/vocab#Chapter"
31
- }
32
- }]
@@ -1,13 +0,0 @@
1
- [{
2
- "@id": {
3
- "@id": "_:c14n0"
4
- },
5
- "http://xmlns.com/foaf/0.1/age": {
6
- "@type": "http://www.w3.org/2001/XMLSchema#integer",
7
- "@value": "41"
8
- },
9
- "http://xmlns.com/foaf/0.1/homepage": {
10
- "@id": "http://manu.sporny.org/"
11
- },
12
- "http://xmlns.com/foaf/0.1/name": "Manu Sporny"
13
- }]