json-ld 1.1.11.1 → 1.99.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd55ca6afb50d8df16c307011aacd50c1dae37cc
4
- data.tar.gz: 041d5825d4255760e34221bfbf33a39267fdb45f
3
+ metadata.gz: dbd10c33d33b7cd63273e8f7a1f2aca15bd0c2fd
4
+ data.tar.gz: b4bcaa6cb6e5afb3ec20e3b9376e73b0a1666ac5
5
5
  SHA512:
6
- metadata.gz: 2047ad0b3058d488092bcf308e88f7d62222ae832715fa0115a5251d7712f29320a29806dc75f2848279093fddc65f3a5bf471215a93afb34208d419ea6f72ca
7
- data.tar.gz: 6a360df33f061bc220f11747567a26a4261db14db11f29e60f92e2283f66a188243f742a65112269287ec3acc733b9cecc426e99a1947f140a5d8e3a4a17ebf0
6
+ metadata.gz: f4fbfa5093a7396c09c04f611a9cf3071e8f68787cef16e389fecec055d1c2022bcbf605f209c66a476db0bf7922e52b8924f296a14f58cf1434c87b74a7be8b
7
+ data.tar.gz: b508589a20147522523e8d8e327a3dd0d2acb9b83d95b29604d825c5d6cb299026bd3aaa3ea830048b419384bd938cee4e04b55795b84e375ca99d572e2b800d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.11.1
1
+ 1.99.0
data/lib/json/ld/api.rb CHANGED
@@ -421,7 +421,7 @@ module JSON::LD
421
421
  # Start generating statements
422
422
  graphs.each do |graph_name, graph|
423
423
  context = as_resource(graph_name) unless graph_name == '@default'
424
- debug(".toRdf") {"context: #{context ? context.to_ntriples : 'null'}"}
424
+ debug(".toRdf") {"graph_name: #{context ? context.to_ntriples : 'null'}"}
425
425
  # Drop results for graphs which are named with relative IRIs
426
426
  if graph_name.is_a?(RDF::URI) && !graph_name.absolute
427
427
  debug(".toRdf") {"drop relative graph_name: #{statement.to_ntriples}"}
@@ -445,7 +445,7 @@ module JSON::LD
445
445
  next
446
446
  end
447
447
 
448
- statement.context = context if context
448
+ statement.graph_name = context if context
449
449
  if block_given?
450
450
  yield statement
451
451
  else
@@ -196,7 +196,9 @@ module JSON::LD
196
196
  def base=(value)
197
197
  if value
198
198
  raise JsonLdError::InvalidBaseIRI, "@base must be a string: #{value.inspect}" unless value.is_a?(String) || value.is_a?(RDF::URI)
199
- @base = @base ? @base.join(value) : RDF::URI(value).dup
199
+ value = RDF::URI(value).dup
200
+ value = @base.join(value) if @base && value.relative?
201
+ @base = value
200
202
  @base.canonicalize! if @options[:canonicalize]
201
203
  raise JsonLdError::InvalidBaseIRI, "@base must be an absolute IRI: #{value.inspect}" unless @base.absolute? || !@options[:validate]
202
204
  @base
data/lib/json/ld/frame.rb CHANGED
@@ -157,7 +157,7 @@ module JSON::LD
157
157
  # If, after replacement, an array contains only the value null remove the value, leaving an empty array.
158
158
  input.map {|o| cleanup_preserve(o)}.compact
159
159
  when Hash
160
- output = Hash.new(input.size)
160
+ output = Hash.new
161
161
  input.each do |key, value|
162
162
  if key == '@preserve'
163
163
  # replace all key-value pairs where the key is @preserve with the value from the key-pair
@@ -24,7 +24,7 @@ module JSON::LD
24
24
  input.each do |statement|
25
25
  debug("statement") { statement.to_nquads.chomp}
26
26
 
27
- name = statement.context ? ec.expand_iri(statement.context).to_s : '@default'
27
+ name = statement.graph_name ? ec.expand_iri(statement.graph_name).to_s : '@default'
28
28
 
29
29
  # Create a graph entry as needed
30
30
  node_map = graph_map[name] ||= {}
@@ -38,9 +38,9 @@ module JSON::LD
38
38
  # @return [void] `self`
39
39
  def stream_statement(statement)
40
40
  debug("ss") {"state: #{@state.inspect}, stmt: #{statement}"}
41
- if @current_graph != statement.context
41
+ if @current_graph != statement.graph_name
42
42
  end_graph
43
- start_graph(statement.context)
43
+ start_graph(statement.graph_name)
44
44
  end
45
45
 
46
46
  # If we're writing a list
data/spec/api_spec.rb CHANGED
@@ -95,7 +95,7 @@ describe JSON::LD::API do
95
95
  end if File.exist?(framed) && File.exist?(frame)
96
96
 
97
97
  it "toRdf" do
98
- expect(RDF::Repository.load(filename, adapter: adapter, debug: @debug)).to be_equivalent_graph(RDF::Repository.load(ttl), trace: @debug)
98
+ expect(RDF::Repository.load(filename, format: :jsonld, adapter: adapter, debug: @debug)).to be_equivalent_graph(RDF::Repository.load(ttl), trace: @debug)
99
99
  end if File.exist?(ttl)
100
100
  end
101
101
  end
data/spec/context_spec.rb CHANGED
@@ -65,7 +65,7 @@ describe JSON::LD::Context do
65
65
  end
66
66
 
67
67
  it "notes non-existing @context" do
68
- expect {subject.parse(StringIO.new("{}"))}.to raise_error
68
+ expect {subject.parse(StringIO.new("{}"))}.to raise_error(JSON::LD::JsonLdError::InvalidRemoteContext)
69
69
  end
70
70
 
71
71
  it "parses a referenced context at a relative URI" do
@@ -262,7 +262,7 @@ describe JSON::LD::Context do
262
262
  "@type as object" => {"foo" => {"@type" => {}}},
263
263
  "@type as array" => {"foo" => {"@type" => []}},
264
264
  "@type as @list" => {"foo" => {"@type" => "@list"}},
265
- "@type as @list" => {"foo" => {"@type" => "@set"}},
265
+ "@type as @set" => {"foo" => {"@type" => "@set"}},
266
266
  "@container as object" => {"foo" => {"@container" => {}}},
267
267
  "@container as array" => {"foo" => {"@container" => []}},
268
268
  "@container as string" => {"foo" => {"@container" => "true"}},
@@ -364,49 +364,49 @@ describe JSON::LD::Context do
364
364
  it "@type with dependent prefixes in a single context" do
365
365
  expect(subject.parse({
366
366
  'xsd' => "http://www.w3.org/2001/XMLSchema#",
367
- 'homepage' => {'@id' => RDF::FOAF.homepage.to_s, '@type' => '@id'}
367
+ 'homepage' => {'@id' => RDF::Vocab::FOAF.homepage.to_s, '@type' => '@id'}
368
368
  }).
369
369
  send(:clear_provided_context).
370
370
  serialize).to produce({
371
371
  "@context" => {
372
372
  "xsd" => RDF::XSD.to_uri.to_s,
373
- "homepage" => {"@id" => RDF::FOAF.homepage.to_s, "@type" => "@id"}
373
+ "homepage" => {"@id" => RDF::Vocab::FOAF.homepage.to_s, "@type" => "@id"}
374
374
  }
375
375
  }, @debug)
376
376
  end
377
377
 
378
378
  it "@list with @id definition in a single context" do
379
379
  expect(subject.parse({
380
- 'knows' => {'@id' => RDF::FOAF.knows.to_s, '@container' => '@list'}
380
+ 'knows' => {'@id' => RDF::Vocab::FOAF.knows.to_s, '@container' => '@list'}
381
381
  }).
382
382
  send(:clear_provided_context).
383
383
  serialize).to produce({
384
384
  "@context" => {
385
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@list"}
385
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@list"}
386
386
  }
387
387
  }, @debug)
388
388
  end
389
389
 
390
390
  it "@set with @id definition in a single context" do
391
391
  expect(subject.parse({
392
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@set"}
392
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@set"}
393
393
  }).
394
394
  send(:clear_provided_context).
395
395
  serialize).to produce({
396
396
  "@context" => {
397
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@set"}
397
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@set"}
398
398
  }
399
399
  }, @debug)
400
400
  end
401
401
 
402
402
  it "@language with @id definition in a single context" do
403
403
  expect(subject.parse({
404
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => "en"}
404
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => "en"}
405
405
  }).
406
406
  send(:clear_provided_context).
407
407
  serialize).to produce({
408
408
  "@context" => {
409
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => "en"}
409
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => "en"}
410
410
  }
411
411
  }, @debug)
412
412
  end
@@ -414,13 +414,13 @@ describe JSON::LD::Context do
414
414
  it "@language with @id definition in a single context and equivalent default" do
415
415
  expect(subject.parse({
416
416
  "@language" => 'en',
417
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => 'en'}
417
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => 'en'}
418
418
  }).
419
419
  send(:clear_provided_context).
420
420
  serialize).to produce({
421
421
  "@context" => {
422
422
  "@language" => 'en',
423
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => 'en'}
423
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => 'en'}
424
424
  }
425
425
  }, @debug)
426
426
  end
@@ -428,13 +428,13 @@ describe JSON::LD::Context do
428
428
  it "@language with @id definition in a single context and different default" do
429
429
  expect(subject.parse({
430
430
  "@language" => 'en',
431
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => "de"}
431
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => "de"}
432
432
  }).
433
433
  send(:clear_provided_context).
434
434
  serialize).to produce({
435
435
  "@context" => {
436
436
  "@language" => 'en',
437
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => "de"}
437
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => "de"}
438
438
  }
439
439
  }, @debug)
440
440
  end
@@ -442,44 +442,44 @@ describe JSON::LD::Context do
442
442
  it "null @language with @id definition in a single context and default" do
443
443
  expect(subject.parse({
444
444
  "@language" => 'en',
445
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => nil}
445
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => nil}
446
446
  }).
447
447
  send(:clear_provided_context).
448
448
  serialize).to produce({
449
449
  "@context" => {
450
450
  "@language" => 'en',
451
- "name" => {"@id" => RDF::FOAF.name.to_s, "@language" => nil}
451
+ "name" => {"@id" => RDF::Vocab::FOAF.name.to_s, "@language" => nil}
452
452
  }
453
453
  }, @debug)
454
454
  end
455
455
 
456
456
  it "prefix with @type and @list" do
457
457
  expect(subject.parse({
458
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@type" => "@id", "@container" => "@list"}
458
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@type" => "@id", "@container" => "@list"}
459
459
  }).
460
460
  send(:clear_provided_context).
461
461
  serialize).to produce({
462
462
  "@context" => {
463
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@type" => "@id", "@container" => "@list"}
463
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@type" => "@id", "@container" => "@list"}
464
464
  }
465
465
  }, @debug)
466
466
  end
467
467
 
468
468
  it "prefix with @type and @set" do
469
469
  expect(subject.parse({
470
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@type" => "@id", "@container" => "@set"}
470
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@type" => "@id", "@container" => "@set"}
471
471
  }).
472
472
  send(:clear_provided_context).
473
473
  serialize).to produce({
474
474
  "@context" => {
475
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@type" => "@id", "@container" => "@set"}
475
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@type" => "@id", "@container" => "@set"}
476
476
  }
477
477
  }, @debug)
478
478
  end
479
479
 
480
480
  it "CURIE with @type" do
481
481
  expect(subject.parse({
482
- "foaf" => RDF::FOAF.to_uri.to_s,
482
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
483
483
  "foaf:knows" => {
484
484
  "@container" => "@list"
485
485
  }
@@ -487,7 +487,7 @@ describe JSON::LD::Context do
487
487
  send(:clear_provided_context).
488
488
  serialize).to produce({
489
489
  "@context" => {
490
- "foaf" => RDF::FOAF.to_uri.to_s,
490
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
491
491
  "foaf:knows" => {
492
492
  "@container" => "@list"
493
493
  }
@@ -498,20 +498,20 @@ describe JSON::LD::Context do
498
498
  it "does not use aliased @id in key position" do
499
499
  expect(subject.parse({
500
500
  "id" => "@id",
501
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@list"}
501
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@list"}
502
502
  }).
503
503
  send(:clear_provided_context).
504
504
  serialize).to produce({
505
505
  "@context" => {
506
506
  "id" => "@id",
507
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@list"}
507
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@list"}
508
508
  }
509
509
  }, @debug)
510
510
  end
511
511
 
512
512
  it "does not use aliased @id in value position" do
513
513
  expect(subject.parse({
514
- "foaf" => RDF::FOAF.to_uri.to_s,
514
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
515
515
  "id" => "@id",
516
516
  "foaf:homepage" => {
517
517
  "@type" => "@id"
@@ -520,7 +520,7 @@ describe JSON::LD::Context do
520
520
  send(:clear_provided_context).
521
521
  serialize).to produce({
522
522
  "@context" => {
523
- "foaf" => RDF::FOAF.to_uri.to_s,
523
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
524
524
  "id" => "@id",
525
525
  "foaf:homepage" => {
526
526
  "@type" => "@id"
@@ -531,14 +531,14 @@ describe JSON::LD::Context do
531
531
 
532
532
  it "does not use aliased @type" do
533
533
  expect(subject.parse({
534
- "foaf" => RDF::FOAF.to_uri.to_s,
534
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
535
535
  "type" => "@type",
536
536
  "foaf:homepage" => {"@type" => "@id"}
537
537
  }).
538
538
  send(:clear_provided_context).
539
539
  serialize).to produce({
540
540
  "@context" => {
541
- "foaf" => RDF::FOAF.to_uri.to_s,
541
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
542
542
  "type" => "@type",
543
543
  "foaf:homepage" => {"@type" => "@id"}
544
544
  }
@@ -548,13 +548,13 @@ describe JSON::LD::Context do
548
548
  it "does not use aliased @container" do
549
549
  expect(subject.parse({
550
550
  "container" => "@container",
551
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@list"}
551
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@list"}
552
552
  }).
553
553
  send(:clear_provided_context).
554
554
  serialize).to produce({
555
555
  "@context" => {
556
556
  "container" => "@container",
557
- "knows" => {"@id" => RDF::FOAF.knows.to_s, "@container" => "@list"}
557
+ "knows" => {"@id" => RDF::Vocab::FOAF.knows.to_s, "@container" => "@list"}
558
558
  }
559
559
  }, @debug)
560
560
  end
@@ -881,7 +881,6 @@ describe JSON::LD::Context do
881
881
  "unmapped" => ["foo", "foo"],
882
882
  "bnode" => ["_:a", RDF::Node("a")],
883
883
  "relative" => ["foo/bar", "http://base/foo/bar"],
884
- "odd CURIE" => ["exp:s", "http://example.org/perts"],
885
884
  "odd CURIE" => ["ex:perts", "http://example.org/perts"]
886
885
  }.each do |title, (result, input)|
887
886
  it title do
@@ -1044,9 +1043,9 @@ describe JSON::LD::Context do
1044
1043
  describe "#expand_value" do
1045
1044
  subject {
1046
1045
  ctx = context.parse({
1047
- "dc" => RDF::DC.to_uri.to_s,
1046
+ "dc" => RDF::Vocab::DC.to_uri.to_s,
1048
1047
  "ex" => "http://example.org/",
1049
- "foaf" => RDF::FOAF.to_uri.to_s,
1048
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
1050
1049
  "xsd" => "http://www.w3.org/2001/XMLSchema#",
1051
1050
  "foaf:age" => {"@type" => "xsd:integer"},
1052
1051
  "foaf:knows" => {"@type" => "@id"},
@@ -1136,9 +1135,9 @@ describe JSON::LD::Context do
1136
1135
  describe "#compact_value" do
1137
1136
  let(:ctx) do
1138
1137
  c = context.parse({
1139
- "dc" => RDF::DC.to_uri.to_s,
1138
+ "dc" => RDF::Vocab::DC.to_uri.to_s,
1140
1139
  "ex" => "http://example.org/",
1141
- "foaf" => RDF::FOAF.to_uri.to_s,
1140
+ "foaf" => RDF::Vocab::FOAF.to_uri.to_s,
1142
1141
  "xsd" => RDF::XSD.to_s,
1143
1142
  "langmap" => {"@id" => "http://example.com/langmap", "@container" => "@language"},
1144
1143
  "list" => {"@id" => "http://example.org/list", "@container" => "@list"},
@@ -1158,7 +1157,7 @@ describe JSON::LD::Context do
1158
1157
  "integer" => ["foaf:age", "54", {"@value" => "54", "@type" => RDF::XSD.integer.to_s}],
1159
1158
  "date " => ["dc:created", "2011-12-27Z", {"@value" => "2011-12-27Z", "@type" => RDF::XSD.date.to_s}],
1160
1159
  "no IRI" => ["foo", {"@id" =>"http://example.com/"},{"@id" => "http://example.com/"}],
1161
- "no IRI (CURIE)" => ["foo", {"@id" => RDF::FOAF.Person.to_s}, {"@id" => RDF::FOAF.Person.to_s}],
1160
+ "no IRI (CURIE)" => ["foo", {"@id" => RDF::Vocab::FOAF.Person.to_s}, {"@id" => RDF::Vocab::FOAF.Person.to_s}],
1162
1161
  "no boolean" => ["foo", {"@value" => "true", "@type" => RDF::XSD.boolean.to_s},{"@value" => "true", "@type" => RDF::XSD.boolean.to_s}],
1163
1162
  "no integer" => ["foo", {"@value" => "54", "@type" => RDF::XSD.integer.to_s},{"@value" => "54", "@type" => RDF::XSD.integer.to_s}],
1164
1163
  "no date " => ["foo", {"@value" => "2011-12-27Z", "@type" => RDF::XSD.date.to_s}, {"@value" => "2011-12-27Z", "@type" => RDF::XSD.date.to_s}],
data/spec/flatten_spec.rb CHANGED
@@ -16,7 +16,7 @@ describe JSON::LD::API do
16
16
  "embedded object" => {
17
17
  input: {
18
18
  "@context" => {
19
- "foaf" => RDF::FOAF.to_s
19
+ "foaf" => RDF::Vocab::FOAF.to_s
20
20
  },
21
21
  "@id" => "http://greggkellogg.net/foaf",
22
22
  "@type" => ["foaf:PersonalProfileDocument"],
@@ -28,19 +28,19 @@ describe JSON::LD::API do
28
28
  output: [
29
29
  {
30
30
  "@id" => "http://greggkellogg.net/foaf",
31
- "@type" => [RDF::FOAF.PersonalProfileDocument.to_s],
32
- RDF::FOAF.primaryTopic.to_s => [{"@id" => "http://greggkellogg.net/foaf#me"}]
31
+ "@type" => [RDF::Vocab::FOAF.PersonalProfileDocument.to_s],
32
+ RDF::Vocab::FOAF.primaryTopic.to_s => [{"@id" => "http://greggkellogg.net/foaf#me"}]
33
33
  },
34
34
  {
35
35
  "@id" => "http://greggkellogg.net/foaf#me",
36
- "@type" => [RDF::FOAF.Person.to_s]
36
+ "@type" => [RDF::Vocab::FOAF.Person.to_s]
37
37
  }
38
38
  ]
39
39
  },
40
40
  "embedded anon" => {
41
41
  input: {
42
42
  "@context" => {
43
- "foaf" => RDF::FOAF.to_s
43
+ "foaf" => RDF::Vocab::FOAF.to_s
44
44
  },
45
45
  "@id" => "http://greggkellogg.net/foaf",
46
46
  "@type" => "foaf:PersonalProfileDocument",
@@ -51,12 +51,12 @@ describe JSON::LD::API do
51
51
  output: [
52
52
  {
53
53
  "@id" => "_:b0",
54
- "@type" => [RDF::FOAF.Person.to_s]
54
+ "@type" => [RDF::Vocab::FOAF.Person.to_s]
55
55
  },
56
56
  {
57
57
  "@id" => "http://greggkellogg.net/foaf",
58
- "@type" => [RDF::FOAF.PersonalProfileDocument.to_s],
59
- RDF::FOAF.primaryTopic.to_s => [{"@id" => "_:b0"}]
58
+ "@type" => [RDF::Vocab::FOAF.PersonalProfileDocument.to_s],
59
+ RDF::Vocab::FOAF.primaryTopic.to_s => [{"@id" => "_:b0"}]
60
60
  }
61
61
  ]
62
62
  },
data/spec/frame_spec.rb CHANGED
@@ -566,4 +566,24 @@ describe JSON::LD::API do
566
566
  end
567
567
  end
568
568
  end
569
+
570
+ context "problem cases" do
571
+ it "pr #20" do
572
+ expanded = [
573
+ {
574
+ "@id"=>"_:gregg",
575
+ "@type"=>"http://xmlns.com/foaf/0.1/Person",
576
+ "http://xmlns.com/foaf/0.1/name" => "Gregg Kellogg"
577
+ }, {
578
+ "@id"=>"http://manu.sporny.org/#me",
579
+ "@type"=> "http://xmlns.com/foaf/0.1/Person",
580
+ "http://xmlns.com/foaf/0.1/knows"=> {"@id"=>"_:gregg"},
581
+ "http://xmlns.com/foaf/0.1/name"=>"Manu Sporny"
582
+ }
583
+ ]
584
+ framed = JSON::LD::API.frame(expanded, {})
585
+ data = framed["@graph"].first
586
+ expect(data["mising_value"]).to be_nil
587
+ end
588
+ end
569
589
  end
data/spec/spec_helper.rb CHANGED
@@ -8,6 +8,7 @@ require 'rdf/isomorphic'
8
8
  require 'rdf/nquads'
9
9
  require 'rdf/turtle'
10
10
  require 'rdf/trig'
11
+ require 'rdf/vocab'
11
12
  require 'rdf/spec'
12
13
  require 'rdf/spec/matchers'
13
14
  require 'yaml'
data/spec/suite_helper.rb CHANGED
@@ -179,7 +179,7 @@ module Fixtures
179
179
  def to_quad(thing)
180
180
  case thing
181
181
  when RDF::URI
182
- thing.canonicalize.to_ntriples
182
+ thing.to_ntriples
183
183
  when RDF::Node
184
184
  escaped(thing)
185
185
  when RDF::Literal::Double
data/spec/writer_spec.rb CHANGED
@@ -71,7 +71,7 @@ describe JSON::LD::Writer do
71
71
  it "should use CURIEs with empty prefix" do
72
72
  input = %(<http://xmlns.com/foaf/0.1/b> <http://xmlns.com/foaf/0.1/c> <http://xmlns.com/foaf/0.1/d> .)
73
73
  begin
74
- expect(serialize(input, prefixes: { "" => RDF::FOAF})).
74
+ expect(serialize(input, prefixes: { "" => RDF::Vocab::FOAF})).
75
75
  to produce({
76
76
  "@context" => {
77
77
  "" => "http://xmlns.com/foaf/0.1/"
@@ -133,7 +133,7 @@ describe JSON::LD::Writer do
133
133
  to produce({
134
134
  '@context' => {
135
135
  "" => "http://www.w3.org/2006/03/test-description#",
136
- "dc" => RDF::DC.to_s
136
+ "dc" => RDF::Vocab::DC.to_s
137
137
  },
138
138
  '@graph' => [
139
139
  {'@id' => "http://example.com/test-cases/0001", '@type' => ":TestCase"},
metadata CHANGED
@@ -1,26 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-ld
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11.1
4
+ version: 1.99.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-09 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.1'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.1.17
23
- - - "<"
24
18
  - !ruby/object:Gem::Version
25
19
  version: '1.99'
26
20
  type: :runtime
@@ -28,12 +22,6 @@ dependencies:
28
22
  version_requirements: !ruby/object:Gem::Requirement
29
23
  requirements:
30
24
  - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '1.1'
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: 1.1.17
36
- - - "<"
37
25
  - !ruby/object:Gem::Version
38
26
  version: '1.99'
39
27
  - !ruby/object:Gem::Dependency
@@ -84,14 +72,14 @@ dependencies:
84
72
  requirements:
85
73
  - - "~>"
86
74
  - !ruby/object:Gem::Version
87
- version: 1.2.1
75
+ version: '1.2'
88
76
  type: :development
89
77
  prerelease: false
90
78
  version_requirements: !ruby/object:Gem::Requirement
91
79
  requirements:
92
80
  - - "~>"
93
81
  - !ruby/object:Gem::Version
94
- version: 1.2.1
82
+ version: '1.2'
95
83
  - !ruby/object:Gem::Dependency
96
84
  name: rack-cache
97
85
  requirement: !ruby/object:Gem::Requirement
@@ -153,9 +141,6 @@ dependencies:
153
141
  requirement: !ruby/object:Gem::Requirement
154
142
  requirements:
155
143
  - - "~>"
156
- - !ruby/object:Gem::Version
157
- version: '1.1'
158
- - - "<"
159
144
  - !ruby/object:Gem::Version
160
145
  version: '1.99'
161
146
  type: :development
@@ -163,9 +148,6 @@ dependencies:
163
148
  version_requirements: !ruby/object:Gem::Requirement
164
149
  requirements:
165
150
  - - "~>"
166
- - !ruby/object:Gem::Version
167
- version: '1.1'
168
- - - "<"
169
151
  - !ruby/object:Gem::Version
170
152
  version: '1.99'
171
153
  - !ruby/object:Gem::Dependency
@@ -173,9 +155,6 @@ dependencies:
173
155
  requirement: !ruby/object:Gem::Requirement
174
156
  requirements:
175
157
  - - "~>"
176
- - !ruby/object:Gem::Version
177
- version: '1.1'
178
- - - "<"
179
158
  - !ruby/object:Gem::Version
180
159
  version: '1.99'
181
160
  type: :development
@@ -183,9 +162,6 @@ dependencies:
183
162
  version_requirements: !ruby/object:Gem::Requirement
184
163
  requirements:
185
164
  - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '1.1'
188
- - - "<"
189
165
  - !ruby/object:Gem::Version
190
166
  version: '1.99'
191
167
  - !ruby/object:Gem::Dependency
@@ -193,9 +169,6 @@ dependencies:
193
169
  requirement: !ruby/object:Gem::Requirement
194
170
  requirements:
195
171
  - - "~>"
196
- - !ruby/object:Gem::Version
197
- version: '1.1'
198
- - - "<"
199
172
  - !ruby/object:Gem::Version
200
173
  version: '1.99'
201
174
  type: :development
@@ -203,11 +176,22 @@ dependencies:
203
176
  version_requirements: !ruby/object:Gem::Requirement
204
177
  requirements:
205
178
  - - "~>"
206
- - !ruby/object:Gem::Version
207
- version: '1.1'
208
- - - "<"
209
179
  - !ruby/object:Gem::Version
210
180
  version: '1.99'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rdf-vocab
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.8'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.8'
211
195
  - !ruby/object:Gem::Dependency
212
196
  name: rdf-xsd
213
197
  requirement: !ruby/object:Gem::Requirement
@@ -215,9 +199,6 @@ dependencies:
215
199
  - - "~>"
216
200
  - !ruby/object:Gem::Version
217
201
  version: '1.1'
218
- - - "<"
219
- - !ruby/object:Gem::Version
220
- version: '1.99'
221
202
  type: :development
222
203
  prerelease: false
223
204
  version_requirements: !ruby/object:Gem::Requirement
@@ -225,23 +206,20 @@ dependencies:
225
206
  - - "~>"
226
207
  - !ruby/object:Gem::Version
227
208
  version: '1.1'
228
- - - "<"
229
- - !ruby/object:Gem::Version
230
- version: '1.99'
231
209
  - !ruby/object:Gem::Dependency
232
210
  name: rspec
233
211
  requirement: !ruby/object:Gem::Requirement
234
212
  requirements:
235
213
  - - "~>"
236
214
  - !ruby/object:Gem::Version
237
- version: 3.2.0
215
+ version: '3.2'
238
216
  type: :development
239
217
  prerelease: false
240
218
  version_requirements: !ruby/object:Gem::Requirement
241
219
  requirements:
242
220
  - - "~>"
243
221
  - !ruby/object:Gem::Version
244
- version: 3.2.0
222
+ version: '3.2'
245
223
  - !ruby/object:Gem::Dependency
246
224
  name: rspec-its
247
225
  requirement: !ruby/object:Gem::Requirement