Specification for tensor literals in RDF & SPARQL
See the website for more information.
This is an extension to RDF and SPARQL that introduces 2 new datatypes, dozens of SPARQL functions, and new aggregates to allow for processing of data tensors within RDF graphs. A data tensor is a multi-dimensional array of values, which can be numeric or boolean, commonly used for example in machine learning embeddings.
- New datatypes:
tensor:DataTensor– represents tensors containing numeric or boolean valuestensor:Range– represents the range of numbers, either concrete (e.g., 0 to 1) or fully open (e.g., all numbers)
- New SPARQL functions:
- Tensor manipulations (addition, multiplication, reshaping, etc.)
- Algebraic computations
- New aggregates:
- Generalized aggregation functions for numerical tensors
- Sum, average, variance, and standard deviation computations
See the website for more details.
- Clone the repository:
git clone git@github.com:NeverBlink-OSS/rdf-tensor.git - Create a new Python virtual environment using your favorite tool (e.g.,
venv). - Install the dependencies:
pip install -r requirements.txt - Compile the docs and host them locally for testing:
mkdocs serve - Whenever you make changes to the documentation pages (they reside in the
docsdirectory), the docs will be automatically recompiled.
The original SPARQL extension and implementation for Jena were done by Piotr Marciniak – see the original repository.
The work is continued in this repository under the stewardship of NeverBlink. The current maintainers are Piotr Sowiński (Ostrzyciel) and Nik Kozlov.
This repository is licensed under Apache License 2.0.
If you use this work in an academic context, please cite it as follows:
Marciniak, P., Sowiński, P., & Ganzha, M. (2025). Representing and Querying Data Tensors in RDF and SPARQL [Conference paper]. Curry, E., et al. The Semantic Web: ESWC 2025 Satellite Events. ESWC 2025. Lecture Notes in Computer Science, 15832. https://doi.org/10.1007/978-3-031-99554-5_12
@inproceedings{rdftensor_2025,
author = {Marciniak, Piotr and Sowiński, Piotr and Ganzha, Maria},
booktitle = {Curry, E., et al. The Semantic Web: ESWC 2025 Satellite Events. ESWC 2025. Lecture Notes in Computer Science},
publisher = {Springer, Cham},
title = {{Representing and Querying Data Tensors in RDF and SPARQL}},
url = {https://doi.org/10.1007/978-3-031-99554-5_12},
year = {2025}
}