- From: Filip Kolarik <filip26@gmail.com>
- Date: Thu, 31 Oct 2024 11:19:03 +0100
- To: Thad Guidry <thadguidry@gmail.com>
- Cc: JSON for Linking Data Community Group <public-linked-json@w3.org>
- Message-ID: <CADRK2_Odc+1SOid4YwVW9NfDBo8ryszsFPUO2BpdoSBzP8A6gg@mail.gmail.com>
Hi Thad, the form could be seen as something like a type/class reflection API populated with values/objects. Here is a variation on the "Activity" example that I've picked instead because it does not use inline contexts. { "@context": "https://www.w3.org/ns/activitystreams", "@type": { "Created": { "@def": "https://www.w3.org/ns/activitystreams#Create", // a source of the definition, could be JSON pointer for inline context "@definedBy": "https://www.w3.org/ns/activitystreams" } }, "actor": { "@def": "https://www.w3.org/ns/activitystreams#actor", "@definedBy": "https://www.w3.org/ns/activitystreams", "@container": [ { "@type": { // there could be type property definition in case of non-generic prop name "Person": { "@def": "https://www.w3.org/ns/activitystreams#Person", "@definedBy": "https://www.w3.org/ns/activitystreams" } }, "@id": "acct:sally@example.org", "name": { "@def": "https://www.w3.org/ns/activitystreams#name", "@definedBy": "https://www.w3.org/ns/activitystreams", "@container": [ { "@value": "Sally" } ] } } ] }, "published": { "@def": "https://www.w3.org/ns/activitystreams#published", "@definedBy": "https://www.w3.org/ns/activitystreams", "@container": { "@def": "https://www.w3.org/ns/activitystreams#published", "@definedBy": "https://www.w3.org/ns/activitystreams", "@container": [ { "@value": "2015-01-25T12:34:56Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } ] } } } It's only an example of what it could be like when serialized to JSON, to demonstrate what is needed to get - you would be rather processing a programmatic structure using pointers/references to definitions, etc. than plain JSON serialization. The main difference is that now you can start processing an input JSON-LD using compacted form and still have a quite fine granular and complete picture of what you are dealing with. One could say: Why don't you just expand and then re-compact it to a form you want to work with? * the def mapping is still lost, it's only a programmers knowledge to what re-compact to what and what a context defines * it does not scale - see above * current JSON-LD expansion drops/or rejects to deal with/ undefined terms * it's overhead, you run two transformation instead of one I hope this helps, I don't have a complete solution, nor answers to all questions (@reverse, etc.), but a need to improve the processing performance with keeping full extensibility and adaptability. Best, Filip On Thu, Oct 31, 2024 at 4:49 AM Thad Guidry <thadguidry@gmail.com> wrote: > Hi Filip! > > Can you provide 1 simple example, in expanded form, contrasted with > compact form, and then explain your problem space with your use cases? > > Let's start with the the JSON-LD Playground's > <https://json-ld.org/playground/> "Place" example, which expanded form > looks like this: > > [ > { > "http://schema.org/description": [ > { > "@value": "The Empire State Building is a 102-story landmark in > New York City." > } > ], > "http://schema.org/geo": [ > { > "http://schema.org/latitude": [ > { > "@type": "http://www.w3.org/2001/XMLSchema#float", > "@value": "40.75" > } > ], > "http://schema.org/longitude": [ > { > "@type": "http://www.w3.org/2001/XMLSchema#float", > "@value": "73.98" > } > ] > } > ], > "http://schema.org/image": [ > { > "@id": " > http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg" > } > ], > "http://schema.org/name": [ > { > "@value": "The Empire State Building" > } > ] > } > ] > > > Thad > https://www.linkedin.com/in/thadguidry/ > https://calendly.com/thadguidry/ >
Received on Thursday, 31 October 2024 10:19:19 UTC