W3C home > Mailing lists > Public > public-linked-json@w3.org > January 2012

JSON-LD Test suite updated

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Thu, 5 Jan 2012 16:21:18 -0500
To: "public-linked-json@w3.org JSON" <public-linked-json@w3.org>
Message-ID: <D24ECC1F-926D-493B-AEBB-2256AAA6EBDB@greggkellogg.net>
I updated the test suite mechanics and added the compaction, expansion, framing and normalization tests from the jsonld.js project. The suite does not run itself yet, but the format is fairly straight forward:

In http://json-ld.org/test-suite/manifest.jsonld is the driving manifest, which loads manifests in the tests/ sub-directory for each category. These manifests have a list of the tests with their necessary inputs and outputs.

I run these tests through my Ruby runner, and I've attached the output I get at this point.

I made a couple of changes to the jsonld.js version of the tests: the manifests are now all JSON-LD documents, based on the test-description vocabulary used with RDFa. Context documents for compaction tests are now full JSON-LD documents, not just the content of the @context. The Node.js running used in jsonld.js should work with some minor updates.

The documentation page [1] could use some improvement, and could list the content of the manifests, if not be turned into a complete test runner.

Gregg

[1] http://json-ld.org/test-suite/

Test output for Ruby JSON-LD:

[json-ld] rspec spec/suite_spec.rb --format documentation
No examples matched {:focus=>true}. Running all.
Run filtered excluding {:ruby=>#<Proc:./spec/spec_helper.rb:34>}

JSON::LD
  test suite
    JSON-LD Test Suite
      compact
        compact-0001-in.jsonld: add context
        compact-0002-in.jsonld: reduced context
        compact-0003-in.jsonld: coerced ex:contains
        compact-0004-in.jsonld: with coerce
        compact-0005-in.jsonld: with date coerce
        compact-0006-in.jsonld: native types
        compact-0007-in.jsonld: native types with coerce
        compact-0008-in.jsonld: literal with language
        compact-0009-in.jsonld: disjoint graph as array (FAILED - 1)
        compact-0010-in.jsonld: alias keywords (FAILED - 2)
      expand
        expand-0001-in.jsonld: id
        expand-0002-in.jsonld: complex
        expand-0003-in.jsonld: coerced ex:contains
        expand-0004-in.jsonld: remove type-coercion context
        expand-0005-in.jsonld: native types (FAILED - 3)
        expand-0006-in.jsonld: native expanded type
        expand-0007-in.jsonld: literal with language
        expand-0008-in.jsonld: alias keywords
        expand-0009-in.jsonld: terms
      frame
        frame-0001-in.jsonld: simple (PENDING: Framing)
        frame-0002-in.jsonld: reframe w/extra CURIE value (PENDING: Framing)
        frame-0003-in.jsonld: reframe (null) (PENDING: Framing)
        frame-0004-in.jsonld: reframe (type) (PENDING: Framing)
        frame-0005-in.jsonld: reframe (explicit) (PENDING: Framing)
        frame-0006-in.jsonld: reframe (non-explicit) (PENDING: Framing)
        frame-0007-in.jsonld: input has multiple types (PENDING: Framing)
        frame-0008-in.jsonld: array framing cases (PENDING: Framing)
        frame-0009-in.jsonld: default value (PENDING: Framing)
        frame-0010-in.jsonld: property CURIE conflict (PENDING: Framing)
        frame-0011-in.jsonld: @embed (PENDING: Framing)
        frame-0012-in.jsonld: Array frame (PENDING: Framing)
        frame-0013-in.jsonld: Replace existing embed (PENDING: Framing)
        frame-0014-in.jsonld: Replace existing embed on 2nd pass (PENDING: Framing)
        frame-0015-in.jsonld: Replace deeply-nested embed (PENDING: Framing)
      normalize
        normalize-0001-in.jsonld: simple id (PENDING: Normalization)
        normalize-0002-in.jsonld: duplicate property iri values (PENDING: Normalization)
        normalize-0003-in.jsonld: bnode (PENDING: Normalization)
        normalize-0004-in.jsonld: bnode plus embed w/subject (PENDING: Normalization)
        normalize-0005-in.jsonld: bnode embed (PENDING: Normalization)
        normalize-0006-in.jsonld: multiple rdf types (PENDING: Normalization)
        normalize-0007-in.jsonld: coerce CURIE value (PENDING: Normalization)
        normalize-0008-in.jsonld: single subject complex (PENDING: Normalization)
        normalize-0009-in.jsonld: multiple subjects - complex (PENDING: Normalization)
        normalize-0010-in.jsonld: type (PENDING: Normalization)
        normalize-0011-in.jsonld: type-coerced type (PENDING: Normalization)
        normalize-0012-in.jsonld: type-coerced type, double reference (PENDING: Normalization)
        normalize-0013-in.jsonld: type-coerced type, cycle (PENDING: Normalization)
        normalize-0014-in.jsonld: check types (PENDING: Normalization)
        normalize-0015-in.jsonld: top level context (PENDING: Normalization)
        normalize-0016-in.jsonld: blank node - dual link - embed (PENDING: Normalization)
        normalize-0017-in.jsonld: blank node - dual link - non-embed (PENDING: Normalization)
        normalize-0018-in.jsonld: blank node - self link (PENDING: Normalization)
        normalize-0019-in.jsonld: blank node - disjoint self links (PENDING: Normalization)
        normalize-0020-in.jsonld: blank node - diamond (PENDING: Normalization)
        normalize-0021-in.jsonld: blank node - circle of 2 (PENDING: Normalization)
        normalize-0022-in.jsonld: blank node - double circle of 2 (PENDING: Normalization)
        normalize-0023-in.jsonld: blank node - circle of 3 (PENDING: Normalization)
        normalize-0024-in.jsonld: blank node - double circle of 3 (1-2-3) (PENDING: Normalization)
        normalize-0025-in.jsonld: blank node - double circle of 3 (1-3-2) (PENDING: Normalization)
        normalize-0026-in.jsonld: blank node - double circle of 3 (2-1-3) (PENDING: Normalization)
        normalize-0027-in.jsonld: blank node - double circle of 3 (2-3-1) (PENDING: Normalization)
        normalize-0028-in.jsonld: blank node - double circle of 3 (3-2-1) (PENDING: Normalization)
        normalize-0029-in.jsonld: blank node - double circle of 3 (3-1-2) (PENDING: Normalization)
        normalize-0030-in.jsonld: blank node - point at circle of 3 (PENDING: Normalization)
        normalize-0031-in.jsonld: bnode (1) (PENDING: Normalization)
        normalize-0032-in.jsonld: bnode (2) (PENDING: Normalization)
        normalize-0033-in.jsonld: disjoint identical subgraphs (1) (PENDING: Normalization)
        normalize-0034-in.jsonld: disjoint identical subgraphs (2) (PENDING: Normalization)
        normalize-0035-in.jsonld: reordered w/strings (1) (PENDING: Normalization)
        normalize-0036-in.jsonld: reordered w/strings (2) (PENDING: Normalization)
        normalize-0037-in.jsonld: reordered w/strings (3) (PENDING: Normalization)
        normalize-0038-in.jsonld: reordered 4 bnodes, reordered 2 properties (1) (PENDING: Normalization)
        normalize-0039-in.jsonld: reordered 4 bnodes, reordered 2 properties (2) (PENDING: Normalization)
        normalize-0040-in.jsonld: reordered 6 bnodes (1) (PENDING: Normalization)
        normalize-0041-in.jsonld: reordered 6 bnodes (2) (PENDING: Normalization)
        normalize-0042-in.jsonld: reordered 6 bnodes (3) (PENDING: Normalization)
        normalize-0043-in.jsonld: literal with language (PENDING: Normalization)
        normalize-0044-in.jsonld: evil (1) (PENDING: Normalization)
        normalize-0045-in.jsonld: evil (2) (PENDING: Normalization)
        normalize-0046-in.jsonld: evil (3) (PENDING: Normalization)
        normalize-0047-in.jsonld: deep diff (1) (PENDING: Normalization)
        normalize-0048-in.jsonld: deep diff (2) (PENDING: Normalization)
        normalize-0049-in.jsonld: remove null (PENDING: Normalization)
        normalize-0050-in.jsonld: nulls (PENDING: Normalization)
        normalize-0051-in.jsonld: merging subjects (PENDING: Normalization)
        normalize-0052-in.jsonld: alias keywords (PENDING: Normalization)
      rdf
        rdf-0001.jsonld: Plain literal with URIs
        rdf-0002.jsonld: Plain literal with CURIE from default context
        rdf-0003.jsonld: Default subject is BNode
        rdf-0004.jsonld: Literal with language tag
        rdf-0005.jsonld: Extended character set literal
        rdf-0006.jsonld: Typed literal
        rdf-0007.jsonld: Tests 'a' generates rdf:type and object is implicit IRI
        rdf-0008.jsonld: Test prefix defined in @context
        rdf-0009.jsonld: Test using default prefix
        rdf-0010.jsonld: Test object processing defines object
        rdf-0011.jsonld: Test object processing defines object with implicit BNode
        rdf-0012.jsonld: Multiple Objects for a Single Property
        rdf-0013.jsonld: Creation of an empty list
        rdf-0014.jsonld: Creation of a list with single element
        rdf-0015.jsonld: Creation of a list with multiple elements
        rdf-0016.jsonld: Empty IRI expands to resource location
        rdf-0017.jsonld: Relative IRI expands relative resource location
        rdf-0018.jsonld: Frag ID expands relative resource location
        rdf-0019.jsonld: Test type coercion to anyURI
        rdf-0020.jsonld: Test type coercion to typed literal
        rdf-0021.jsonld: Test coercion of decimal value to double
        rdf-0022.jsonld: Test coercion of double value
        rdf-0023.jsonld: Test coercion of integer value
        rdf-0024.jsonld: Test coercion of boolean value
        rdf-0025.jsonld: Test list coercion with single element
        rdf-0026.jsonld: Test creation of multiple types

Pending:
  JSON::LD test suite JSON-LD Test Suite frame frame-0001-in.jsonld: simple
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0002-in.jsonld: reframe w/extra CURIE value
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0003-in.jsonld: reframe (null)
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0004-in.jsonld: reframe (type)
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0005-in.jsonld: reframe (explicit)
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0006-in.jsonld: reframe (non-explicit)
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0007-in.jsonld: input has multiple types
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0008-in.jsonld: array framing cases
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0009-in.jsonld: default value
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0010-in.jsonld: property CURIE conflict
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0011-in.jsonld: @embed
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0012-in.jsonld: Array frame
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0013-in.jsonld: Replace existing embed
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0014-in.jsonld: Replace existing embed on 2nd pass
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite frame frame-0015-in.jsonld: Replace deeply-nested embed
    # Framing
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0001-in.jsonld: simple id
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0002-in.jsonld: duplicate property iri values
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0003-in.jsonld: bnode
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0004-in.jsonld: bnode plus embed w/subject
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0005-in.jsonld: bnode embed
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0006-in.jsonld: multiple rdf types
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0007-in.jsonld: coerce CURIE value
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0008-in.jsonld: single subject complex
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0009-in.jsonld: multiple subjects - complex
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0010-in.jsonld: type
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0011-in.jsonld: type-coerced type
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0012-in.jsonld: type-coerced type, double reference
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0013-in.jsonld: type-coerced type, cycle
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0014-in.jsonld: check types
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0015-in.jsonld: top level context
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0016-in.jsonld: blank node - dual link - embed
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0017-in.jsonld: blank node - dual link - non-embed
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0018-in.jsonld: blank node - self link
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0019-in.jsonld: blank node - disjoint self links
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0020-in.jsonld: blank node - diamond
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0021-in.jsonld: blank node - circle of 2
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0022-in.jsonld: blank node - double circle of 2
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0023-in.jsonld: blank node - circle of 3
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0024-in.jsonld: blank node - double circle of 3 (1-2-3)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0025-in.jsonld: blank node - double circle of 3 (1-3-2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0026-in.jsonld: blank node - double circle of 3 (2-1-3)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0027-in.jsonld: blank node - double circle of 3 (2-3-1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0028-in.jsonld: blank node - double circle of 3 (3-2-1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0029-in.jsonld: blank node - double circle of 3 (3-1-2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0030-in.jsonld: blank node - point at circle of 3
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0031-in.jsonld: bnode (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0032-in.jsonld: bnode (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0033-in.jsonld: disjoint identical subgraphs (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0034-in.jsonld: disjoint identical subgraphs (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0035-in.jsonld: reordered w/strings (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0036-in.jsonld: reordered w/strings (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0037-in.jsonld: reordered w/strings (3)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0038-in.jsonld: reordered 4 bnodes, reordered 2 properties (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0039-in.jsonld: reordered 4 bnodes, reordered 2 properties (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0040-in.jsonld: reordered 6 bnodes (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0041-in.jsonld: reordered 6 bnodes (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0042-in.jsonld: reordered 6 bnodes (3)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0043-in.jsonld: literal with language
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0044-in.jsonld: evil (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0045-in.jsonld: evil (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0046-in.jsonld: evil (3)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0047-in.jsonld: deep diff (1)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0048-in.jsonld: deep diff (2)
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0049-in.jsonld: remove null
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0050-in.jsonld: nulls
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0051-in.jsonld: merging subjects
    # Normalization
    # ./spec/suite_spec.rb:14
  JSON::LD test suite JSON-LD Test Suite normalize normalize-0052-in.jsonld: alias keywords
    # Normalization
    # ./spec/suite_spec.rb:14

Failures:

  1) JSON::LD test suite JSON-LD Test Suite compact compact-0009-in.jsonld: disjoint graph as array
     Failure/Error: result = JSON::LD::API.compact(t.input, t.context,
     TypeError:
       can't convert Array into Hash
     # ./lib/json/ld/api.rb:155:in `merge'
     # ./lib/json/ld/api.rb:155:in `block in compact'
     # ./lib/json/ld/api.rb:31:in `initialize'
     # ./lib/json/ld/api.rb:148:in `new'
     # ./lib/json/ld/api.rb:148:in `compact'
     # ./spec/suite_spec.rb:18:in `block (8 levels) in <top (required)>'

  2) JSON::LD test suite JSON-LD Test Suite compact compact-0010-in.jsonld: alias keywords
     Failure/Error: JSON.parse(result).should produce(expected, t.debug)
       Expected: {
         "@context": {
           "http://example.org/test#property2": {
             "@type": "uri"
           },
           "http://example.org/test#property3": {
             "@type": "uri"
           },
           "uri": "@id"
         },
         "http://example.org/test#property1": {
           "http://example.org/test#property4": "foo",
           "uri": "http://example.org/test#example2"
         },
         "http://example.org/test#property2": "http://example.org/test#example3",
         "http://example.org/test#property3": "http://example.org/test#example4",
         "uri": "http://example.org/test#example1"
       }
       Actual  : {
         "@context": {
           "http://example.org/test#property1": {
             "@type": "uri"
           },
           "http://example.org/test#property2": {
             "@type": "uri"
           },
           "http://example.org/test#property3": {
             "@type": "uri"
           },
           "uri": "@id"
         },
         "@id": "http://example.org/test#example1",
         "http://example.org/test#property1": {
           "@id": "http://example.org/test#example2",
           "http://example.org/test#property4": "foo"
         },
         "http://example.org/test#property2": "http://example.org/test#example3",
         "http://example.org/test#property3": "http://example.org/test#example4"
       }
       Processing results:
       init: iri_to_term: {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd"}
       expand: input: Hash, predicate: nil, context: [EvaluationContext, mappings[0]={}, coercions[0]={}, lists[0]={}]
       expand: @id: "http://example.org/test#example1"
       expand_iri: prefix: "http", suffix: "//example.org/test#example1"
       expand:  => #<RDF::URI:0x8159960c(http://example.org/test#example1)>
       expand: http://example.org/test#property1: {"@id"=>"http://example.org/test#example2", "http://example.org/test#property4"=>"foo"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property1"
         expand: input: Hash, predicate: #<RDF::URI:0x81594044(http://example.org/test#property1)>, context: [EvaluationContext, mappings[0]={}, coercions[0]={}, lists[0]={}]
         expand: @id: "http://example.org/test#example2"
       expand_iri: prefix: "http", suffix: "//example.org/test#example2"
         expand:  => #<RDF::URI:0x8159339c(http://example.org/test#example2)>
         expand: http://example.org/test#property4: "foo"
       expand_iri: prefix: "http", suffix: "//example.org/test#property4"
           expand_value: predicate: http://example.org/test#property4, value: "foo", coerce: nil
           => "foo"
         expand:  => "foo"
       expand:  => {"@id"=>#<RDF::URI:0x8159339c(http://example.org/test#example2)>, "http://example.org/test#property4"=>"foo"}
       expand: http://example.org/test#property2: {"@id"=>"http://example.org/test#example3"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property2"
         expand: input: Hash, predicate: #<RDF::URI:0x81591a10(http://example.org/test#property2)>, context: [EvaluationContext, mappings[0]={}, coercions[0]={}, lists[0]={}]
         expand: @id: "http://example.org/test#example3"
       expand_iri: prefix: "http", suffix: "//example.org/test#example3"
         expand:  => #<RDF::URI:0x81590da4(http://example.org/test#example3)>
       expand:  => {"@id"=>#<RDF::URI:0x81590da4(http://example.org/test#example3)>}
       expand: http://example.org/test#property3: {"@id"=>"http://example.org/test#example4"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property3"
         expand: input: Hash, predicate: #<RDF::URI:0x8157bf80(http://example.org/test#property3)>, context: [EvaluationContext, mappings[0]={}, coercions[0]={}, lists[0]={}]
         expand: @id: "http://example.org/test#example4"
       expand_iri: prefix: "http", suffix: "//example.org/test#example4"
         expand:  => #<RDF::URI:0x81578484(http://example.org/test#example4)>
       expand:  => {"@id"=>#<RDF::URI:0x81578484(http://example.org/test#example4)>}
       init: iri_to_term: {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd"}
       parse: io: #<File:0x00000102b35080>
       parse: => provided_context: {"http://example.org/test#property1"=>{"@type"=>"uri"}, "http://example.org/test#property2"=>{"@type"=>"uri"}, "http://example.org/test#property3"=>{"@type"=>"uri"}, "uri"=>"@id"}
       parse: Hash[http://example.org/test#property1] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property1"
       parse: Hash[http://example.org/test#property2] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property2"
       parse: Hash[http://example.org/test#property3] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property3"
       parse: Hash[uri] = "@id"
       expand_iri: prefix: "@id", suffix: nil
       map "uri" to @id
       parse: Hash[http://example.org/test#property1] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property1"
       parse: Hash[http://example.org/test#property2] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property2"
       parse: Hash[http://example.org/test#property3] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property3"
       parse: Hash[uri] = "@id"
       expand_iri: prefix: "@id", suffix: nil
       parse: coercion/list: Hash[http://example.org/test#property1] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property1"
       expand_iri: prefix: "uri", suffix: nil
       parse: coerce "http://example.org/test#property1" to #<RDF::URI:0x81571c88(@id)>
       coerce "http://example.org/test#property1" to @id
       parse: coercion/list: Hash[http://example.org/test#property2] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property2"
       expand_iri: prefix: "uri", suffix: nil
       parse: coerce "http://example.org/test#property2" to #<RDF::URI:0x81555268(@id)>
       coerce "http://example.org/test#property2" to @id
       parse: coercion/list: Hash[http://example.org/test#property3] = {"@type"=>"uri"}
       expand_iri: prefix: "http", suffix: "//example.org/test#property3"
       expand_iri: prefix: "uri", suffix: nil
       parse: coerce "http://example.org/test#property3" to #<RDF::URI:0x81554070(@id)>
       coerce "http://example.org/test#property3" to @id
       parse: coercion/list: Hash[uri] = "@id"
       expand_iri: prefix: "uri", suffix: nil
       compact: input: Hash, predicate: nil
       compact: @id: #<RDF::URI:0x8159960c(http://example.org/test#example1)>
         compact_iri({:position=>:subject, :depth=>nil}, #<RDF::URI:0x8159960c(http://example.org/test#example1)>)
         get_curie(#<RDF::URI:0x8159960c(http://example.org/test#example1)>)
         no mapping found for http://example.org/test#example1 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
         => "http://example.org/test#example1"
       compact:  => "http://example.org/test#example1"
       compact: http://example.org/test#property1: {"@id"=>#<RDF::URI:0x8159339c(http://example.org/test#example2)>, "http://example.org/test#property4"=>"foo"}
         compact_iri({:position=>:predicate, :depth=>nil}, "http://example.org/test#property1")
         get_curie("http://example.org/test#property1")
         no mapping found for http://example.org/test#property1 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
         => "http://example.org/test#property1"
       compact:  => compacted key: "http://example.org/test#property1"
       compact: object
         compact: input: Hash, predicate: #<RDF::URI:0x8153d410(http://example.org/test#property1)>
         compact: @id: #<RDF::URI:0x8159339c(http://example.org/test#example2)>
           compact_iri({:position=>:subject, :depth=>1}, #<RDF::URI:0x8159339c(http://example.org/test#example2)>)
           get_curie(#<RDF::URI:0x8159339c(http://example.org/test#example2)>)
           no mapping found for http://example.org/test#example2 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
           => "http://example.org/test#example2"
         compact:  => "http://example.org/test#example2"
         compact: http://example.org/test#property4: "foo"
           compact_iri({:position=>:predicate, :depth=>1}, "http://example.org/test#property4")
           get_curie("http://example.org/test#property4")
           no mapping found for http://example.org/test#property4 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
           => "http://example.org/test#property4"
         compact:  => compacted key: "http://example.org/test#property4"
         compact: value
         compact:  => compacted value: "foo"
       compact:  => compacted value: {"@id"=>"http://example.org/test#example2", "http://example.org/test#property4"=>"foo"}
       compact: http://example.org/test#property2: {"@id"=>#<RDF::URI:0x81590da4(http://example.org/test#example3)>}
         compact_iri({:position=>:predicate, :depth=>0}, "http://example.org/test#property2")
         get_curie("http://example.org/test#property2")
         no mapping found for http://example.org/test#property2 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
         => "http://example.org/test#property2"
       compact:  => compacted key: "http://example.org/test#property2"
       compact: keys: ["@id"]
         compact_value: predicate: #<RDF::URI:0x815264f4(http://example.org/test#property2)>, value: {"@id"=>#<RDF::URI:0x81590da4(http://example.org/test#example3)>}, coerce: #<RDF::URI:0x81555268(@id)>
          (@id & coerce)
           compact_iri({:position=>:object}, #<RDF::URI:0x81590da4(http://example.org/test#example3)>)
           get_curie(#<RDF::URI:0x81590da4(http://example.org/test#example3)>)
           no mapping found for http://example.org/test#example3 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
           => "http://example.org/test#example3"
         => "http://example.org/test#example3"
       compact:  => compacted value: "http://example.org/test#example3"
       compact: http://example.org/test#property3: {"@id"=>#<RDF::URI:0x81578484(http://example.org/test#example4)>}
         compact_iri({:position=>:predicate, :depth=>0}, "http://example.org/test#property3")
         get_curie("http://example.org/test#property3")
         no mapping found for http://example.org/test#property3 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
         => "http://example.org/test#property3"
       compact:  => compacted key: "http://example.org/test#property3"
       compact: keys: ["@id"]
         compact_value: predicate: #<RDF::URI:0x81524690(http://example.org/test#property3)>, value: {"@id"=>#<RDF::URI:0x81578484(http://example.org/test#example4)>}, coerce: #<RDF::URI:0x81554070(@id)>
          (@id & coerce)
           compact_iri({:position=>:object}, #<RDF::URI:0x81578484(http://example.org/test#example4)>)
           get_curie(#<RDF::URI:0x81578484(http://example.org/test#example4)>)
           no mapping found for http://example.org/test#example4 in {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd", "@id"=>"uri"}
           => "http://example.org/test#example4"
         => "http://example.org/test#example4"
       compact:  => compacted value: "http://example.org/test#example4"
         serlialize: reuse context: {"http://example.org/test#property1"=>{"@type"=>"uri"}, "http://example.org/test#property2"=>{"@type"=>"uri"}, "http://example.org/test#property3"=>{"@type"=>"uri"}, "uri"=>"@id"}
     # ./spec/suite_spec.rb:22:in `block (8 levels) in <top (required)>'

  3) JSON::LD test suite JSON-LD Test Suite expand expand-0005-in.jsonld: native types
     Failure/Error: JSON.parse(result).should produce(expected, t.debug)
       Expected: {
         "@id": "http://example.org/test",
         "http://example.org/vocab#bool": {
           "@literal": "true",
           "@type": "http://www.w3.org/2001/XMLSchema#boolean"
         },
         "http://example.org/vocab#double": {
           "@literal": "1.230000e+00",
           "@type": "http://www.w3.org/2001/XMLSchema#double"
         },
         "http://example.org/vocab#double-zero": {
           "@literal": "0.000000e+00",
           "@type": "http://www.w3.org/2001/XMLSchema#double"
         },
         "http://example.org/vocab#int": {
           "@literal": "123",
           "@type": "http://www.w3.org/2001/XMLSchema#integer"
         }
       }
       Actual  : {
         "@id": "http://example.org/test",
         "http://example.org/vocab#bool": {
           "@literal": "true",
           "@type": "http://www.w3.org/2001/XMLSchema#boolean"
         },
         "http://example.org/vocab#double": {
           "@literal": "1.23",
           "@type": "http://www.w3.org/2001/XMLSchema#double"
         },
         "http://example.org/vocab#double-zero": {
           "@literal": "0",
           "@type": "http://www.w3.org/2001/XMLSchema#integer"
         },
         "http://example.org/vocab#int": {
           "@literal": "123",
           "@type": "http://www.w3.org/2001/XMLSchema#integer"
         }
       }
       Processing results:
       init: iri_to_term: {"http://www.w3.org/1999/02/22-rdf-syntax-ns#"=>"rdf", "http://www.w3.org/2001/XMLSchema#"=>"xsd"}
       expand: input: Hash, predicate: nil, context: [EvaluationContext, mappings[0]={}, coercions[0]={}, lists[0]={}]
       parse: => provided_context: {"d"=>"http://purl.org/dc/elements/1.1/", "e"=>"http://example.org/vocab#", "e:double-zero"=>{"@type"=>"xsd:double"}, "f"=>"http://xmlns.com/foaf/0.1/", "xsd"=>"http://www.w3.org/2001/XMLSchema#"}
       parse: Hash[d] = "http://purl.org/dc/elements/1.1/"
       expand_iri: prefix: "http", suffix: "//purl.org/dc/elements/1.1/"
       map "d" to http://purl.org/dc/elements/1.1/
       parse: Hash[e] = "http://example.org/vocab#"
       expand_iri: prefix: "http", suffix: "//example.org/vocab#"
       map "e" to http://example.org/vocab#
       parse: Hash[e:double-zero] = {"@type"=>"xsd:double"}
       expand_iri: prefix: "e", suffix: "double-zero"
       parse: Hash[f] = "http://xmlns.com/foaf/0.1/"
       expand_iri: prefix: "http", suffix: "//xmlns.com/foaf/0.1/"
       map "f" to http://xmlns.com/foaf/0.1/
       parse: Hash[xsd] = "http://www.w3.org/2001/XMLSchema#"
       expand_iri: prefix: "http", suffix: "//www.w3.org/2001/XMLSchema#"
       map "xsd" to http://www.w3.org/2001/XMLSchema#
       parse: Hash[d] = "http://purl.org/dc/elements/1.1/"
       expand_iri: prefix: "http", suffix: "//purl.org/dc/elements/1.1/"
       parse: Hash[e] = "http://example.org/vocab#"
       expand_iri: prefix: "http", suffix: "//example.org/vocab#"
       parse: Hash[e:double-zero] = {"@type"=>"xsd:double"}
       expand_iri: prefix: "e", suffix: "double-zero"
       parse: Hash[f] = "http://xmlns.com/foaf/0.1/"
       expand_iri: prefix: "http", suffix: "//xmlns.com/foaf/0.1/"
       parse: Hash[xsd] = "http://www.w3.org/2001/XMLSchema#"
       expand_iri: prefix: "http", suffix: "//www.w3.org/2001/XMLSchema#"
       parse: coercion/list: Hash[d] = "http://purl.org/dc/elements/1.1/"
       expand_iri: prefix: "d", suffix: nil
       parse: coercion/list: Hash[e] = "http://example.org/vocab#"
       expand_iri: prefix: "e", suffix: nil
       parse: coercion/list: Hash[e:double-zero] = {"@type"=>"xsd:double"}
       expand_iri: prefix: "e", suffix: "double-zero"
       expand_iri: prefix: "xsd", suffix: "double"
       parse: coerce "http://example.org/vocab#double-zero" to #<RDF::URI:0x8147d0fc(http://www.w3.org/2001/XMLSchema#double)>
       coerce "http://example.org/vocab#double-zero" to http://www.w3.org/2001/XMLSchema#double
       parse: coercion/list: Hash[f] = "http://xmlns.com/foaf/0.1/"
       expand_iri: prefix: "f", suffix: nil
       parse: coercion/list: Hash[xsd] = "http://www.w3.org/2001/XMLSchema#"
       expand_iri: prefix: "xsd", suffix: nil
       expand: @context: {"d"=>"http://purl.org/dc/elements/1.1/", "e"=>"http://example.org/vocab#", "e:double-zero"=>{"@type"=>"xsd:double"}, "f"=>"http://xmlns.com/foaf/0.1/", "xsd"=>"http://www.w3.org/2001/XMLSchema#"}
       expand: @id: "http://example.org/test"
       expand_iri: prefix: "http", suffix: "//example.org/test"
       expand:  => #<RDF::URI:0x8147a208(http://example.org/test)>
       expand: e:bool: true
       expand_iri: prefix: "e", suffix: "bool"
         expand_value: predicate: http://example.org/vocab#bool, value: true, coerce: nil
         => {"@literal"=>"true", "@type"=>"http://www.w3.org/2001/XMLSchema#boolean"}
       expand:  => {"@literal"=>"true", "@type"=>"http://www.w3.org/2001/XMLSchema#boolean"}
       expand: e:double: 1.23
       expand_iri: prefix: "e", suffix: "double"
         expand_value: predicate: http://example.org/vocab#double, value: 1.23, coerce: nil
         => {"@literal"=>"1.23", "@type"=>"http://www.w3.org/2001/XMLSchema#double"}
       expand:  => {"@literal"=>"1.23", "@type"=>"http://www.w3.org/2001/XMLSchema#double"}
       expand: e:double-zero: 0
       expand_iri: prefix: "e", suffix: "double-zero"
         expand_value: predicate: http://example.org/vocab#double-zero, value: 0, coerce: #<RDF::URI:0x8147d0fc(http://www.w3.org/2001/XMLSchema#double)>
         => {"@literal"=>"0", "@type"=>"http://www.w3.org/2001/XMLSchema#integer"}
       expand:  => {"@literal"=>"0", "@type"=>"http://www.w3.org/2001/XMLSchema#integer"}
       expand: e:int: 123
       expand_iri: prefix: "e", suffix: "int"
         expand_value: predicate: http://example.org/vocab#int, value: 123, coerce: nil
         => {"@literal"=>"123", "@type"=>"http://www.w3.org/2001/XMLSchema#integer"}
       expand:  => {"@literal"=>"123", "@type"=>"http://www.w3.org/2001/XMLSchema#integer"}
     # ./spec/suite_spec.rb:28:in `block (8 levels) in <top (required)>'

Finished in 2.21 seconds
112 examples, 3 failures, 67 pending

Failed examples:

rspec ./spec/suite_spec.rb:14 # JSON::LD test suite JSON-LD Test Suite compact compact-0009-in.jsonld: disjoint graph as array
rspec ./spec/suite_spec.rb:14 # JSON::LD test suite JSON-LD Test Suite compact compact-0010-in.jsonld: alias keywords
rspec ./spec/suite_spec.rb:14 # JSON::LD test suite JSON-LD Test Suite expand expand-0005-in.jsonld: native types
[json-ld]
Received on Thursday, 5 January 2012 21:22:32 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:36 GMT