Update playground for YAML-LD
gkellogg opened this issue · 2 comments
gkellogg commented
Two things for this:
- jsonld.js should either be updated or have a shim for handling
application/ld+yamlmedia type and transforming JSON to/from YAML. - the playground should allow options to specify input and/or output encodings for YAML-LD, also for Context and Frame.
- as a bonus, allow Turtle/TriG input/output for appropriate algorithms using rdfjs.
gkellogg commented
Thoughts on this:
- The "JSON-LD Input" tab might be a drop-down to select alternative formats. (Might suggest similar formats for the Context, Frame, and Output areas.
- Note that processing could always be YAML, which handles JSON input as well.
- The same mechanism could be used for selecting other RDF inputs, or RDF outputs in the N-Quads tab case.
- Codemirror and linting additions for YAML might be a lot of work
- Selecting input format might also select different example inputs
- Alternatively, could be auto-generated from JSON using YAML library.
westurner commented
[Codemirror + YAML-LD]
- https://codemirror.net/5/mode/yaml/
- codemirror/dev#306
"@id": "<uri>"works fine
- https://github.com/codemirror/codemirror5/blob/master/mode/yaml/yaml.js
- https://github.com/codemirror/codemirror5/blob/master/addon/lint/yaml-lint.js
- https://github.com/json-ld/json-ld.org/blob/main/playground/index.html
- https://github.com/json-ld/json-ld.org/blob/main/playground/playground.js
- https://github.com/json-ld/json-ld.org/blob/main/playground/jsonld-turtle.js#L112
-
jsonld.turtle -
jsonld.yamlld
-
- https://github.com/json-ld/json-ld.org/blob/main/playground/playground.js#L486
mode: 'yaml' // codemirror mode mode: 'yamlld' // someday codemirror mode if necessary for $context and $id like in the YAML-LD UCR doc?