Re: Supporting Arrays and Tensors

Olaf,

Hello. Thank you. I added a new example showcasing literals-based techniques to those approaches for representing n-ary propositional statements [1] and referenced the specification document you shared there.

One initial reaction is that it would be useful if some new technique, e.g., some kind of string-interpolation [4] or template-system technique, could be created for developers to be able to use shorthand notations for IRIs in those (e.g., triple-quoted or other form of) strings, """[...]"""^^cdt:List , as discussed between the second [2] and third [3] examples...


Best regards,
Adam

[1] https://github.com/AdamSobieski/Narratology/blob/main/Content/The%20Semantic%20Web%20and%20N-ary%20Expressions.md
[2] https://awslabs.github.io/SPARQL-CDTs/spec/latest.html#first-map-example
[3] https://awslabs.github.io/SPARQL-CDTs/spec/latest.html#second-map-example
[4] https://en.wikipedia.org/wiki/String_interpolation

________________________________
From: Olaf Hartig <olaf.hartig@liu.se>
Sent: Thursday, January 22, 2026 2:31 AM
To: adamsobieski@hotmail.com <adamsobieski@hotmail.com>; semantic-web@w3.org <semantic-web@w3.org>
Subject: Re: Supporting Arrays and Tensors

Hi Adam,

We have a formal specification [1] of lists (and also maps!) as
literals, including corresponding extensions to SPARQL. There are two
separate open source implementations [2] of our approach, and we have
also created a comprehensive test suite [3] for other implementers. As
a starting point, you may want to read the informal description of the
approach:

https://w3id.org/awslabs/neptune/SPARQL-CDTs/spec/latest.html#description

There also is some work that adapts our approach and extends it to
capture tensors [4].

Best,
Olaf

[1] https://w3id.org/awslabs/neptune/SPARQL-CDTs/latest.html
[2] https://github.com/awslabs/SPARQL-CDTs#implementations
[3] https://github.com/awslabs/SPARQL-CDTs/tree/main/tests
[4] https://github.com/RDF-tensor/jena-datatensor


On Thu, 2026-01-22 at 01:30 +0000, Adam Sobieski wrote:
> David Booth,
> All,
>
> Brainstorming, "()-collections" [2] could have their types specified
> using a syntax resembling that of RDF literals. As considered, for
> backwards compatibility, when a collection's type was omitted, it
> would be processed as it is today.
>
>
> :entity :foo (1 2 3 4 5) .
>
> :entity :foo (1 2 3 4 5)^^rdf:List .
>
> :entity :foo (1 2 3 4 5)^^rdf:Seq .
>
> :entity :foo (1 2 3 4 5)^^rdf:Array .
>
> :entity :foo (1 2 3 4 5)^^rdf:Vector .
>
>
> While this syntax idea might be a "syntactic sugar" for some
> collection types, it would open up possibilities for processing
> arrays and tensors, i.e., embedding vectors.
>
>
> Best regards,
> Adam Sobieski
>
> [2] https://www.w3.org/TR/rdf12-turtle/#collections
>
>
> From: Adam Sobieski <adamsobieski@hotmail.com>
> Sent: Wednesday, January 21, 2026 5:21 PM
> To: David Booth <david@dbooth.org>; semantic-web@w3.org
> <semantic-web@w3.org>
> Subject: Re: The Semantic Web and N-ary Expressions
>
> David Booth,
> All,
>
> Thank you. I added the 2006 W3C Working Group Note you indicated to a
> new See Also section on that page I shared.
>
>
> With respect to syntax possibilities for arrays and for the related
> matter of (data) tensors [1] in RDF languages, brainstorming:
>
> :entity :embedding "0.12 0.98 -0.45"^^ex:vector .
>
> :entity :embedding "(0.12 0.98 -0.45)"^^ex:vector .
>
> :entity :embedding "[0.12 0.98 -0.45]"^^ex:vector .
>
> :entity :embedding "<0.12 0.98 -0.45>"^^ex:vector .
>
> :entity :embedding "{0.12 0.98 -0.45}"^^ex:vector .
>
>
> If only one could omit the string-literal quotes and, instead, use
> something like {...}^^namespace:datatype for arrays and (data)
> tensors:
>
> :entity :embedding {0.12 0.98 -0.45}^^rdf:vector .
>
>
> What do you think? Do any other possibilities come to mind?
>
>
> Best regards,
> Adam Sobieski
>
> [1] Marciniak, Piotr, Piotr Sowiński, and Maria Ganzha. "Representing
> and querying data tensors in RDF and SPARQL." InEuropean Semantic Web
> Conference, pp. 62-66. Cham: Springer Nature Switzerland, 2025.
> (https://arxiv.org/abs/2504.19224)
>
> From: David Booth <david@dbooth.org>
> Sent: Monday, January 19, 2026 10:20 PM
> To: semantic-web@w3.org <semantic-web@w3.org>
> Subject: Re: The Semantic Web and N-ary Expressions
>
> On 1/19/26 18:42, Adam Sobieski wrote:
> > Hello. I am pleased to share some recent ideas about ways to
> > express
> > n-ary predicate-calculus expressions in knowledge graphs using
> > Turtle
> > and TriG.
> >
> > https://github.com/AdamSobieski/Narratology/blob/main/Content/The%20Semantic%20Web%20and%20N-ary%20Expressions.md
> >  <
> > https://github.com/AdamSobieski/Narratology/blob/main/Content/The%20Semantic%20Web%20and%20N-ary%20Expressions.md
> > >
>
> Interesting ideas!  Thanks for sharing them.  Plus I imagine you've
> seen
> the ways described in this 2006 W3C Working Group Note:
> https://www.w3.org/TR/swbp-n-aryRelations
>
> However, in my view the problem is not that we don't have enough ways
> to
> express n-ary predicates in RDF.  The problem is that we have too
> *many*
> ways to do it.  Or more specifically, we do not have a *standard*
> way,
> such that it can be supported by syntactic sugar and tools can
> recognize
> it.  Without standardization, we have chaos.
>
> This is one of the gaps that I hope will someday be addressed in a
> successor to RDF, along with taming blank nodes and proper support
> for
> arrays.
>
> Thanks,
> David Booth
>

Received on Friday, 23 January 2026 20:00:40 UTC