Re: How do you document your JSON-LD context files ?

Le mar. 12 mars 2024 à 17:11, Roberto Polli <robipolli@gmail.com> a écrit :

> Hi Thomas,
>
> replies inline.
>
> On Tue, 12 Mar 2024 at 11:54, Thomas Francart <thomas.francart@sparna.fr>
> wrote:
> > How do people here document their JSON-LD context file ?
>
> I serialize JSON-LD files in YAML and use # comments ;)
> They are lost when converting in JSON.
>
> > JSON prohibits the use of comments.
> > JSON-LD prohibits the use of unknown keys in the context.
> >
> > I frequently need to :
> >   - group context declarations in sections (like in
> https://www.w3.org/TR/annotation-vocab/#json-ld-context), and document
> these sections
> >   - document specific mappings, e.g. add a comment to explain why this
> mapping uses @container and what are the consequences:
> >
> >     "identifiedBy" : {
> >       "@id" : "bf:identifiedBy",
> >       "@type" : "@id",
> >       "@container": "@id"
> >     },
> >
>
> Maybe another solution could be to import skos/dct and add
> a "dct:description": "Write here your comment"
> though this might alter the actual context.
>

Thanks.
My point is that this is not possible. You can try it in the JSON-LD
Playground, you will get an error:

```
{
  "@context": {
    "@import": "http://schema.org",
    "skos" : "http://www.w3.org/2004/02/skos/core#",
    "schema" : "http://schema.org/",
    "workFeatured_in" : {
      "skos:note" : "Please note this is an inverse key for the
schema:workFeatured property",
      "@reverse" : "schema:workFeatured",
      "@type" : "@id"
    }
  },
  "@id" : "http://exemple.com/someCreativeWork",
  "@type" : "CreativeWork",
  "workFeatured_in" : {
    "@id" : "http://exemple.com/someEvent",
    "@type" : "Event"
  }
}
```

Basically, the social aspect of exchanging and documenting context is
simply not addressed, and this is frustrating. JSON-LD contexts are not
only for machines. Sometimes technical people look at them to use and
understand them, we need to carry some documentation information for this.
How can this be addressed ?

Thomas


>
> Peace,
> R.
>


-- 

*Thomas Francart* -* SPARNA*
Web de *données* | Architecture de l'*information* | Accès aux
*connaissances*
blog : blog.sparna.fr, site : sparna.fr, linkedin :
fr.linkedin.com/in/thomasfrancart
tel :  +33 (0)6.71.11.25.97, skype : francartthomas

Received on Thursday, 14 March 2024 11:06:15 UTC