Re: Driving JSON-LD framing specs from SHACL model

Hi Thomas,

we had two breakout sessions, in September 2023 [1] (during TPAC) and in 
March 2024 [2] (during Breakout day) around this topic. You might find 
the minutes and slides presented there interesting. We might continue 
the discussion during the upcoming TPAC or further events (this is still 
in discussion).

More comments belo

[1] https://www.w3.org/events/meetings/b8617206-4c2b-4355-80da-fcf4eb628d1a/

[2] 
https://www.w3.org/2024/03/breakouts-day-2024/#b-fb7b6d9f-fc2f-456f-9fff-3a516f3ec7ab 



On 07/06/2024 12:31, Thomas Francart wrote:
> Hello SHACL & JSON-LD lovers
>
> I have SHACL specs. I also have APIs that return JSON-LD. The JSON-LD 
> is built from RDF using a manually maintained context + JSON-LD 
> framing specs.
>
> My question is how I could bridge my SHACL with my JSON-LD context + 
> framing, to have a completely model-driven architecture. In other 
> words can I generate the context + framing from the SHACL (probably 
> using some extra annotations).
>
> Generating a default context from the SHACL is relatively easy [1]. My 
> question is on the framing part, specifically on the hierarchical 
> structure of the JSON. How can I indicate in the SHACL model :
>
>  1. which shapes are the roots of the JSON-LD structure ?
>  2. which properties use embedding in the JSON-LD structure ?
>     ("@embed": "@always") and which should be simply references to URIs ?
>
Intuitively, I would use a similar approach to the one you used in your 
SHACL-to-context conversion: a dedicated predicate used to annotate the 
node shapes (for 1) and the property shapes (for 2).
> The ability to specify the (or a) hierarchical view of my graph 
> structure could be useful, even for an RDF/XML serialization, or an 
> HTML rendering of a dataset.
+1
>
> Any ideas or pointers on this ?
>
> Cheers
> Thomas
>
> [1] : https://shacl-play.sparna.fr/play/context#documentation - a 
> simplistic JSON-LD context derivation from a SHACL spec.
>
> -- 
> *
> *
> *Thomas Francart* -*SPARNA*
> Web de _données_ | Architecture de l'_information_ | Accès aux 
> _connaissances_
> blog : blog.sparna.fr <http://blog.sparna.fr>, site : sparna.fr 
> <http://sparna.fr>, linkedin : fr.linkedin.com/in/thomasfrancart 
> <https://fr.linkedin.com/in/thomasfrancart>
> tel :  +33 (0)6.71.11.25.97, skype : francartthomas

Received on Tuesday, 11 June 2024 15:52:42 UTC