Expansion of nested "occurrences" in Turtle

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".

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 .

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 10:38:13 UTC