json-ld / yaml-ld

CG specification for YAML-LD and UCR
https://json-ld.github.io/yaml-ld/spec
Other
19 stars 8 forks source link

Test: `#cr-comments-1-positive` is probably not applicable #116

Closed anatoly-scherbakov closed 10 months ago

anatoly-scherbakov commented 10 months ago

Manifest:

    {
      "@id": "#cr-comments-1-positive",
      "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
      "name": "Various comment forms",
      "purpose": "Comments are white space.",
      "req": "must",
      "input": "basic/cr-comments-1-positive-in.yamlld",
      "expect": "basic/cr-comments-1-positive-out.yamlld"
    }

This test asks us to do an expansion for cr-comments-1-positive-in.yamlld and compare the result against cr-comments-1-positive-out.yamlld.

In the current state of the spec, we do not define an expand() operation that would be different from JSON-LD expansion, do we?

I am working on a YAML-LD plugin for https://github.com/rdflib/rdflib and there is no such operation there, there is only YAML-LD parsing into an RDF graph or export of a graph as YAML-LD.

Proposal. Use .nq output instead of .yamlld and compare triples resulting from parsing the file.

anatoly-scherbakov commented 10 months ago

Upd (after some thought)

I guess my statement above is incorrect; expand() is an operation specified by JSON-LD API, thus a conforming implementation must have that operation. I will have to write a separate library for this purpose, something like this:

import yaml_ld

yaml_ld.expand(…)
gkellogg commented 10 months ago

Right, that's why the test type includes jld:ExpandTest, which indicates the algorithm to use. Of course, comments will be removed in the change to the Internal Representation.