W3C home > Mailing lists > Public > semantic-web@w3.org > December 2022

Re: FW: convert rdf or owl into yaml

From: Pierre-Antoine Champin <pierre-antoine@w3.org>
Date: Fri, 9 Dec 2022 18:13:06 +0100
Message-ID: <b71abc15-01c8-dc5a-f999-590fba760403@w3.org>
To: Chris Mungall <cjmungall@lbl.gov>
Cc: "Cox, Simon (L&W, Clayton)" <Simon.Cox@csiro.au>, "semantic-web@w3.org" <semantic-web@w3.org>
On 09/12/2022 17:01, Chris Mungall wrote:

> Perhaps another way of phrasing this: YAML is a superset of JSON, 
> allowing for among other things anchors and references 
> <https://blog.daemonl.com/2016/02/yaml.html>. Independent of RDF, this 
> can be useful for representing non-tree like structures directly 
> (including cyclic graphs).
> Given anchors and references are outside of JSON syntax, thus outside 
> of JSON-LD syntax, is this a practical limitation? From one 
> perspective, no, URIs do the same job as anchors and references *at 
> the RDF graph level*. But it may still be convenient to have a direct 
> mapping from a proposed YAML-LD to RDF that maps anchors and 
> references directly.
Ok, that makes a lot of sense. Thanks for the clarification.
> I believe the YAML-LD group looked at this and the consensus was it 
> was more practical to look at the JSON-expressible subset of YAML, 
> i.e. treat YAML-LD as syntactic sugar.

more precisely, the group has decided to consider two different 
application profiles [1]

* the JSON profile does indeed restrict YAML to its JSON-compatible subset

* the Extended profile takes advantage of some YAML-specific features. 
In particular, it states :

 > YAML-LD docucments MAY use alias nodes, as long as dereferencing 
these aliases does not result in a loop.

So acyclyc graphs can be "natively" represented in YAML-LD. Cyclic 
graphs will still need some indirection through @id.

Maybe we could relax this constraint, if we find a criterion that is 
clear enough and practical to implement. Intuitively: whenever you 
traverse an alias to a node that you have already visited, then
- if this node has an "@id" key, replace this alias with { "@id": "the 
id of the target" }
- otherwise, raise an error


[1] https://json-ld.github.io/yaml-ld/spec/#profiles

> On Fri, Dec 9, 2022 at 4:29 AM Pierre-Antoine Champin 
> <pierre-antoine@w3.org> wrote:
>     Hi Simon,
>     On 30/11/2022 01:33, Cox, Simon (L&W, Clayton) wrote:
>>     Does tying YAML-LD to the JSON-LD model mean that it inherits
>>     limitations from JSON concerning the scope of the graph
>>     structures that can be represented?
>     what limitation are you referring to?
>     Any RDF graph (or dataset, for that matter), can be representedin
>     JSON-LD -- and YAML-LD.
>     Some RDF graphs/datasets may not have a very idiomatic
>     representation, but they *can* be represented.
>>     Is this more limited than RDF?
>     So... no.
>>     Is there a more general ‘YAML-RDF’, of which YAML-LD is a profile?
>     No, nor is there, IMO, a need for it.
>       pa
>>     *From:*Gregg Kellogg <gregg@greggkellogg.com>
>>     *Sent:* Wednesday, 30 November, 2022 02:46
>>     *To:* Miel Vander Sande <miel.vandersande@meemoo.be>
>>     *Cc:* Joy lix <joylix4112@outlook.com>; public-rdf-dev@w3.org;
>>     www-rdf-interest@w3.org
>>     *Subject:* Re: convert rdf or owl into yaml
>>     The draft YAML-LD spec can be found here:
>>     https://json-ld.github.io/yaml-ld/spec/

>>     There are outstanding items, but the CG has reached a pretty
>>     stable place with this.
>>     It’s intended to closely align with JSON-LD, so the same
>>     algorithms are available, and you can mix and match JSON and YAML
>>     formats.
>>     So far, I think mine is the only implementation
>>     https://github.com/ruby-rdf/yaml-ld.

>>     Gregg Kellogg
>>     Sent from my iPad
>>         On Nov 29, 2022, at 2:20 AM, Miel Vander Sande
>>         <miel.vandersande@meemoo.be> wrote:
>>         Hi Joy Lix,
>>         There's something brewing in the JSON-LD group:
>>         https://github.com/json-ld/json-ld.org/issues?q=label%3Ayaml-ld+

>>         Best,
>>         Miel
>>         Op di 29 nov. 2022 om 05:29 schreef Joy lix
>>         <joylix4112@outlook.com>:
>>             Folks, Are  there any tools or methods to convert rdf
>>             into yaml format files?
Received on Friday, 9 December 2022 17:13:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 9 December 2022 17:13:11 UTC