@@ -65,7 +65,7 @@ def containers
6565 end
6666
6767 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 )
6969 end
7070
7171 it "parses a referenced context at a relative URI" do
@@ -262,7 +262,7 @@ def containers
262262 "@type as object" => { "foo" => { "@type" => { } } } ,
263263 "@type as array" => { "foo" => { "@type" => [ ] } } ,
264264 "@type as @list" => { "foo" => { "@type" => "@list" } } ,
265- "@type as @list " => { "foo" => { "@type" => "@set" } } ,
265+ "@type as @set " => { "foo" => { "@type" => "@set" } } ,
266266 "@container as object" => { "foo" => { "@container" => { } } } ,
267267 "@container as array" => { "foo" => { "@container" => [ ] } } ,
268268 "@container as string" => { "foo" => { "@container" => "true" } } ,
@@ -364,130 +364,130 @@ def containers
364364 it "@type with dependent prefixes in a single context" do
365365 expect ( subject . parse ( {
366366 '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' }
368368 } ) .
369369 send ( :clear_provided_context ) .
370370 serialize ) . to produce ( {
371371 "@context" => {
372372 "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" }
374374 }
375375 } , @debug )
376376 end
377377
378378 it "@list with @id definition in a single context" do
379379 expect ( subject . parse ( {
380- 'knows' => { '@id' => RDF ::FOAF . knows . to_s , '@container' => '@list' }
380+ 'knows' => { '@id' => RDF ::Vocab :: FOAF . knows . to_s , '@container' => '@list' }
381381 } ) .
382382 send ( :clear_provided_context ) .
383383 serialize ) . to produce ( {
384384 "@context" => {
385- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@list" }
385+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@list" }
386386 }
387387 } , @debug )
388388 end
389389
390390 it "@set with @id definition in a single context" do
391391 expect ( subject . parse ( {
392- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@set" }
392+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@set" }
393393 } ) .
394394 send ( :clear_provided_context ) .
395395 serialize ) . to produce ( {
396396 "@context" => {
397- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@set" }
397+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@set" }
398398 }
399399 } , @debug )
400400 end
401401
402402 it "@language with @id definition in a single context" do
403403 expect ( subject . parse ( {
404- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => "en" }
404+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => "en" }
405405 } ) .
406406 send ( :clear_provided_context ) .
407407 serialize ) . to produce ( {
408408 "@context" => {
409- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => "en" }
409+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => "en" }
410410 }
411411 } , @debug )
412412 end
413413
414414 it "@language with @id definition in a single context and equivalent default" do
415415 expect ( subject . parse ( {
416416 "@language" => 'en' ,
417- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => 'en' }
417+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => 'en' }
418418 } ) .
419419 send ( :clear_provided_context ) .
420420 serialize ) . to produce ( {
421421 "@context" => {
422422 "@language" => 'en' ,
423- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => 'en' }
423+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => 'en' }
424424 }
425425 } , @debug )
426426 end
427427
428428 it "@language with @id definition in a single context and different default" do
429429 expect ( subject . parse ( {
430430 "@language" => 'en' ,
431- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => "de" }
431+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => "de" }
432432 } ) .
433433 send ( :clear_provided_context ) .
434434 serialize ) . to produce ( {
435435 "@context" => {
436436 "@language" => 'en' ,
437- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => "de" }
437+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => "de" }
438438 }
439439 } , @debug )
440440 end
441441
442442 it "null @language with @id definition in a single context and default" do
443443 expect ( subject . parse ( {
444444 "@language" => 'en' ,
445- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => nil }
445+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => nil }
446446 } ) .
447447 send ( :clear_provided_context ) .
448448 serialize ) . to produce ( {
449449 "@context" => {
450450 "@language" => 'en' ,
451- "name" => { "@id" => RDF ::FOAF . name . to_s , "@language" => nil }
451+ "name" => { "@id" => RDF ::Vocab :: FOAF . name . to_s , "@language" => nil }
452452 }
453453 } , @debug )
454454 end
455455
456456 it "prefix with @type and @list" do
457457 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" }
459459 } ) .
460460 send ( :clear_provided_context ) .
461461 serialize ) . to produce ( {
462462 "@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" }
464464 }
465465 } , @debug )
466466 end
467467
468468 it "prefix with @type and @set" do
469469 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" }
471471 } ) .
472472 send ( :clear_provided_context ) .
473473 serialize ) . to produce ( {
474474 "@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" }
476476 }
477477 } , @debug )
478478 end
479479
480480 it "CURIE with @type" do
481481 expect ( subject . parse ( {
482- "foaf" => RDF ::FOAF . to_uri . to_s ,
482+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
483483 "foaf:knows" => {
484484 "@container" => "@list"
485485 }
486486 } ) .
487487 send ( :clear_provided_context ) .
488488 serialize ) . to produce ( {
489489 "@context" => {
490- "foaf" => RDF ::FOAF . to_uri . to_s ,
490+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
491491 "foaf:knows" => {
492492 "@container" => "@list"
493493 }
@@ -498,20 +498,20 @@ def containers
498498 it "does not use aliased @id in key position" do
499499 expect ( subject . parse ( {
500500 "id" => "@id" ,
501- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@list" }
501+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@list" }
502502 } ) .
503503 send ( :clear_provided_context ) .
504504 serialize ) . to produce ( {
505505 "@context" => {
506506 "id" => "@id" ,
507- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@list" }
507+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@list" }
508508 }
509509 } , @debug )
510510 end
511511
512512 it "does not use aliased @id in value position" do
513513 expect ( subject . parse ( {
514- "foaf" => RDF ::FOAF . to_uri . to_s ,
514+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
515515 "id" => "@id" ,
516516 "foaf:homepage" => {
517517 "@type" => "@id"
@@ -520,7 +520,7 @@ def containers
520520 send ( :clear_provided_context ) .
521521 serialize ) . to produce ( {
522522 "@context" => {
523- "foaf" => RDF ::FOAF . to_uri . to_s ,
523+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
524524 "id" => "@id" ,
525525 "foaf:homepage" => {
526526 "@type" => "@id"
@@ -531,14 +531,14 @@ def containers
531531
532532 it "does not use aliased @type" do
533533 expect ( subject . parse ( {
534- "foaf" => RDF ::FOAF . to_uri . to_s ,
534+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
535535 "type" => "@type" ,
536536 "foaf:homepage" => { "@type" => "@id" }
537537 } ) .
538538 send ( :clear_provided_context ) .
539539 serialize ) . to produce ( {
540540 "@context" => {
541- "foaf" => RDF ::FOAF . to_uri . to_s ,
541+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
542542 "type" => "@type" ,
543543 "foaf:homepage" => { "@type" => "@id" }
544544 }
@@ -548,13 +548,13 @@ def containers
548548 it "does not use aliased @container" do
549549 expect ( subject . parse ( {
550550 "container" => "@container" ,
551- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@list" }
551+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@list" }
552552 } ) .
553553 send ( :clear_provided_context ) .
554554 serialize ) . to produce ( {
555555 "@context" => {
556556 "container" => "@container" ,
557- "knows" => { "@id" => RDF ::FOAF . knows . to_s , "@container" => "@list" }
557+ "knows" => { "@id" => RDF ::Vocab :: FOAF . knows . to_s , "@container" => "@list" }
558558 }
559559 } , @debug )
560560 end
@@ -881,7 +881,6 @@ def containers
881881 "unmapped" => [ "foo" , "foo" ] ,
882882 "bnode" => [ "_:a" , RDF ::Node ( "a" ) ] ,
883883 "relative" => [ "foo/bar" , "http://base/foo/bar" ] ,
884- "odd CURIE" => [ "exp:s" , "http://example.org/perts" ] ,
885884 "odd CURIE" => [ "ex:perts" , "http://example.org/perts" ]
886885 } . each do |title , ( result , input ) |
887886 it title do
@@ -1044,9 +1043,9 @@ def containers
10441043 describe "#expand_value" do
10451044 subject {
10461045 ctx = context . parse ( {
1047- "dc" => RDF ::DC . to_uri . to_s ,
1046+ "dc" => RDF ::Vocab :: DC . to_uri . to_s ,
10481047 "ex" => "http://example.org/" ,
1049- "foaf" => RDF ::FOAF . to_uri . to_s ,
1048+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
10501049 "xsd" => "http://www.w3.org/2001/XMLSchema#" ,
10511050 "foaf:age" => { "@type" => "xsd:integer" } ,
10521051 "foaf:knows" => { "@type" => "@id" } ,
@@ -1136,9 +1135,9 @@ def containers
11361135 describe "#compact_value" do
11371136 let ( :ctx ) do
11381137 c = context . parse ( {
1139- "dc" => RDF ::DC . to_uri . to_s ,
1138+ "dc" => RDF ::Vocab :: DC . to_uri . to_s ,
11401139 "ex" => "http://example.org/" ,
1141- "foaf" => RDF ::FOAF . to_uri . to_s ,
1140+ "foaf" => RDF ::Vocab :: FOAF . to_uri . to_s ,
11421141 "xsd" => RDF ::XSD . to_s ,
11431142 "langmap" => { "@id" => "http://example.com/langmap" , "@container" => "@language" } ,
11441143 "list" => { "@id" => "http://example.org/list" , "@container" => "@list" } ,
@@ -1158,7 +1157,7 @@ def containers
11581157 "integer" => [ "foaf:age" , "54" , { "@value" => "54" , "@type" => RDF ::XSD . integer . to_s } ] ,
11591158 "date " => [ "dc:created" , "2011-12-27Z" , { "@value" => "2011-12-27Z" , "@type" => RDF ::XSD . date . to_s } ] ,
11601159 "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 } ] ,
11621161 "no boolean" => [ "foo" , { "@value" => "true" , "@type" => RDF ::XSD . boolean . to_s } , { "@value" => "true" , "@type" => RDF ::XSD . boolean . to_s } ] ,
11631162 "no integer" => [ "foo" , { "@value" => "54" , "@type" => RDF ::XSD . integer . to_s } , { "@value" => "54" , "@type" => RDF ::XSD . integer . to_s } ] ,
11641163 "no date " => [ "foo" , { "@value" => "2011-12-27Z" , "@type" => RDF ::XSD . date . to_s } , { "@value" => "2011-12-27Z" , "@type" => RDF ::XSD . date . to_s } ] ,
0 commit comments