Re: Expansion of nested "occurrences" in Turtle

On 28/02/2024 10:38, Olaf Hartig wrote:
> Hi,
> 
> The purpose of this email is to call out some observations about nested
> "occurrences".
> 
> I am assuming that the shorthand notation for "occurrences" in Turtle
> can also be used in a nested way. For instance, one may write:
> 
> << :n2 | <<:n1| :s :p :o>> :pp :oo >> :ppp :ooo .
> 
> At least, that's possible according to the grammar in Enrico's document
> about the semantics [1].
> 
> The question then is how exactly such an expression is expanded into a
> set of triples. The way I see it is that the expansion rule has to be
> applied recursively. For example, for the aforementioned snippet of
> Turtle, this would mean we end up with the following set of three
> triples (written in Turtle, using the <<( ... )>> notation for triple
> terms).
> 
> :n1  rdf:nameOf  <<( :s :p :o )>> .
> :n2  rdf:nameOf  <<( :n1 :pp :oo )>> .
> :n2  :ppp  :ooo .
> 
> Let me know everyone whether you have a different understanding of how
> the expansion should work for such nested "occurrences".

That's how I think it should be.

Allowing nested occurrences enables us to say that any triple can be 
used in an occurrence. Calling out rdf:nameOf as a special case (and the 
only special case) seems odd to me.

> As a side note, one might wonder whether the expansion could ever lead
> to nested triple terms in the resulting RDF triples. Yes, that may
> happen, but only in cases in which an "occurrence" written in the
> Turtle shorthand notation is about a triple that contains a triple
> term. As an example, consider the following snippet of Turtle.
> 
> << :x | :y rdf:nameOf <<(:s :p :o)>> >> :pp :oo .
> 
> This expands to the following (well-formed!) set of two triples in
> which the object of the first triple is a nested triple term.
> 
> :x  rdf:nameOf  <<(:y rdf:nameOf <<(:s :p :o)>> )>> .
> :x  :pp  :oo .

So I see this as an uncommon case that is a consequence. It is better to 
accept that, than to call out certain cases as "illegal". That often 
leads to other cases to rule whether legal or illegal.

     Andy

> 
> Best,
> Olaf
> 
> [1]
> https://github.com/w3c/rdf-star-wg/wiki/RDF%E2%80%90star-semantics:-option-3#best-practice-for-reification-property-graph-edges-n-ary-relations
> 

Received on Wednesday, 28 February 2024 16:08:07 UTC