RE: Intent to close ISSUE-221

On Monday, March 11, 2013 10:32 PM, Andy Seaborne wrote:

> What's the coverage of the toRdf/fromRdf tests?
> 
> (comment triggered by the fact I don't see a change to reflect @reverse
> yet - the input files for all toRdf and fromRdf appear to be 11 months
> old)

I think the coverage of RDF conversion is quite good (based on my code
coverage) but Gregg and Dave Longley will know more as they have written
most tests.

RDF conversion is trivial as it is based on flattened JSON-LD. So e.g.,
@reverse doesn't have any effect on because it doesn't appear in flattened
JSON-LD.

For example:

{
  "@context": {
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "defines": { "@reverse": "rdfs:definedBy" },
    "label": "rdfs:label"
  },
  "@id": "http://example.com/vocab",
  "label": "My vocabulary",
  "defines": [
    {
      "@id": "http://example.com/vocab#property",
      "label": "A property"
    }
  ]
}

Is expanded & flattened to

[
  {
    "@id": "http://example.com/vocab",
    "http://www.w3.org/2000/01/rdf-schema#label": [
      { "@value": "My vocabulary" }
    ]
  },
  {
    "@id": "http://example.com/vocab#property",
    "http://www.w3.org/2000/01/rdf-schema#definedBy": [
      { "@id": "http://example.com/vocab" }
    ],
    "http://www.w3.org/2000/01/rdf-schema#label": [
      { "@value": "A property" }
    ]
  }
]

Which results in the following triples:

<http://example.com/vocab>
  <http://www.w3.org/2000/01/rdf-schema#label> "My vocabulary" .
<http://example.com/vocab#property>
  <http://www.w3.org/2000/01/rdf-schema#definedBy>
    <http://example.com/vocab> .
<http://example.com/vocab#property>
  <http://www.w3.org/2000/01/rdf-schema#label> "A property" .


I've just added this test to the test suite [1].


Cheers,
Markus


[1]
https://github.com/json-ld/json-ld.org/commit/22531ccea3aa8adc36162c4721cf57
906a7f82c2



--
Markus Lanthaler
@markuslanthaler

Received on Monday, 11 March 2013 23:35:11 UTC