- From: Dan Brickley <danbri@danbri.org>
- Date: Fri, 9 Feb 2024 18:42:33 +0000
- To: Danny Ayers <danny.ayers@gmail.com>
- Cc: Semantic Web <semantic-web@w3.org>, public-json-ld-wg@w3.org
- Message-ID: <CAFfrAFoMpK70qJ4Od2h9Gq6Uv8YKAfwe_mc5RhGZuuPVU_ixZg@mail.gmail.com>
You can do quite a lot of mapping vanilla json into json-ld using json-ld contexts. Unlike xml there are only so many ways to say stuff and the content tends towards being objects and properties anyhow. If you’re going to have a turing complete mapping framework you probably should just use JS. Cheers Dan On Fri, 9 Feb 2024 at 17:58, Danny Ayers <danny.ayers@gmail.com> wrote: > I'm rather out of the loop, so apologies if something like this has > already been discussed, implemented even. But I feel obliged to flag an > issue, offer a potential solution (which might already exist). > > # Use case : > For the past few days I've been working on a bit of code where a > processing pipeline will be set up declaratively. I'm still on baby steps, > but it's a place where RDF should be ideal. A little graph defines the > nodes & arcs of the processing system. > > To get the code started, I only need a trivial model to work from. A > simple list, (input reader)->(process)-> (output writer). > So at this stage, it seemed reasonable just to use a minimal JSON list. > Generalise to RDF later. > There's a sequence of nodes, each with an instance ID and a type for the > nature of the thing. > A very simple JSON structure covers it. > > # Issue : > But looking ahead, I wondered how to migrate from the arbitrary JSON to an > RDF model. Obviously, JSON-LD. > In my head I saw a namespace declaration, the rest just lifted & placed > there from the keys in the JSON mappings. But in practice, it's not quite > like that, it gets ugly fast. > I guess it's basically a syntax issue. > What you see in the (arbitrary) JSON expression is visually/intuitively > understandable. Ditto in Turtle. But in JSON-LD, any kind, the immediacy of > interpretation by a human (this one at least) is lost. > > # Proposed Solution : > I don't know if anyone remembers GRDDL [1]. An elegant approach for > bridging between anyXML and RDF. One added attribute in the doc, to say it > has an RDF representation and here's how to get it. It's an easy inclusion > in namespaced XML, we* went for XSLT transformers, a very immediate > approach. Imagine an org with loads of XML documents of the same shape. A > transformation has to be written once, that pointer inserted in all these > docs, very low-effort mapping to the RDF world. > As far as I'm aware, to date, absolutely no-one has ever used this. > > *But* the idea is great. Forget XML, let's do JSON. > Add one (presumably top-level) name value pair in a JSON doc: > > { "http://www.w3.org/2003/g/data-view#", "http://example.org/this-to-that" > ... > } > > At http://example.org/this-to-that you have the definition of how to take > this arbitrary JSON and make it a citizen of the Web. > > I'll say again, you might well just want to bin this if such things have > been dealt with already. > But it did strike me that in practice, I was facing horrible stuff to look > at. Please remember RDF/XML's role in adoption. > > Cheers, > Danny. > > [1] https://www.w3.org/TR/grddl/ > > * yeah, I was on the GRDDL Working Group. Memory totally gone over my > contributions, but in these things I generally only offer /wrong/ arguments > (realise years later), which post-factum I convince myself are useful to > get the people with their heads screwed on to look at things more closely. > I'm still a little irritated I didn't get a credit in the doc, I poked Dan > Connolly and he said he's sort it, Didn't. It did mean something to me, one > of the very few things I've been involved with which had a very pleasing > end product (even if absolutely no-one uses it). > > I should also confess I was mouthy in the JSON-LD group at the start, but > quietly shuffled away when I realised the other folks had magnitudes better > grasp. > > -- > ---- > > https://hyperdata.it <http://hyperdata.it/danja> > >
Received on Friday, 9 February 2024 18:42:52 UTC