- From: Vladimir Alexiev <vladimir.alexiev@ontotext.com>
- Date: Sun, 29 Sep 2024 00:56:43 +0300
- To: Matteo Fortini <matteo.fortini@gmail.com>
- Cc: public-json-ld@w3.org
- Message-ID: <CAMv+wg5e=2BOB2OEN4z7AO_ZZHaci8owBwLCMDAyu3T6=0wg5A@mail.gmail.com>
Your objects should have type: nothing in your example says that Fred is a person. Then you can use a type-specific context to redefine type per class. Or maybe it's better to do it per property, since that person is probably referenced from somewhere, again using personID, right? On Fri, 27 Sept 2024, 16:37 Matteo Fortini, <matteo.fortini@gmail.com> wrote: > We want to generate a JSON-LD object from a JSON one by adding the > @context. > > The destination object is, for example > > [ > { > "CPV:name": [ > { > "@value": "Fred" > } > ], > "@id": "https://w3id.org/person/AA123456CC" > } > ] > > While the source object is > > { > > "name": "Fred", > "personID": "AA123456CC" > } > > We would like to have a @context that converts source to destination. > > A working example could be > > > { > "@context":{ > "@vocab":"CPV:", > "personID": "@id", > "@base":"https://w3id.org/person/" > }, > > "name": "Fred", > "personID": "AA123456CC" > } > > However, this seems an overload of the meaning of "@base", which > shouldn't be used just for one @id, but as the base URI of a number of > @id-s. > > Is there another more standard way? > > Thank you > > Here's the playground version: > > https://tinyurl.com/27rxs2yj > > > >
Received on Saturday, 28 September 2024 21:57:00 UTC