Quick Start
This chapter demonstrates how to load and query the Mona Lisa knowledge graph using Tentris. Tentris can be used via a statically pre-built binary, a docker image or Python.
License
To use Tentris, a license needs to be requested via https://tentris.io.
Binary
The Tentris binary is the recommended method for deployments, as it provides more features than both the docker image and the Python bindings.
-
Place the license at
~/.config/tentris-license.toml
.
If the license is placed inDownloads
, it can be moved to the correct location using the following command.mv ~/Downloads/tentris-license.toml ~/.config/tentris-license.toml
-
Download and install Tentris.
curl --proto https --tlsv1.2 -sSf https://raw.githubusercontent.com/tentris/tentris/refs/heads/main/install.sh | sh
Manual Installation
The files for manually installing Tentris can be found here.
Note: See the chapter Uninstalling Tentris on how to uninstall Tentris.
-
Load the Mona Lisa knowledge graph using the offline loader.
curl -sSf "https://files.tentris.io/mona-lisa.ttl" | tentris load
-
Start the server.
tentris serve
-
Visit the Web UI (http://0.0.0.0:9080/ui) to query the knowledge graph.
For more details about the binary, please refer to the chapter Binary.
Docker Image
The docker image is recommended for trying out Tentris.
-
Start the server.
docker run -it \ -v ./tentris-license.toml:/config/tentris-license.toml:ro \ -v ./data:/data \ -p 9080:9080 \ ghcr.io/tentris/tentris:latest
-
Load the Mona Lisa knowledge graph using SPARQL Update.
curl -H "Content-Type: application/sparql-update" \ --data "LOAD <https://files.tentris.io/mona-lisa.ttl>" "http://localhost:9080/update"
-
Visit the Web UI (http://0.0.0.0:9080/ui) to query the knowledge graph.
For more details about the docker image, please refer to the chapter Docker.
⚠️ Warning: if you are using colima on macOS to run docker containers, make sure that
mountType
is set tovirtiofs
andvmType
is set tovz
. This can be changed withcolima start --edit
. In our testing other options prevented docker from mounting the license properly.
Python
The Python bindings are recommended if you want to use Tentris in your Python scripts.
- Install the Python bindings of Tentris.
curl --proto https --tlsv1.2 -sSf https://raw.githubusercontent.com/tentris/tentris/refs/heads/main/install-python.sh | sh
- Run the following script.
import tentris import rdflib # Create an RDFLib graph using Tentris as its backend g = rdflib.Graph(store="TentrisStore") # Load the graph using the SPARQL Update operation `LOAD` # https://www.w3.org/TR/2013/REC-sparql11-update-20130321/#load g.update("LOAD <https://files.tentris.io/mona-lisa.ttl>") # Query the Mona Lisa knowledge graph query_str = """ PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX dbo: <http://dbpedia.org/ontology/> SELECT ?name WHERE { dbr:Mona_Lisa dbo:author ?person . ?person foaf:name ?name . } """ for binding in graph.query(query_str): print(f"{binding.name.n3()}")
⚠️ Warning: In the case of the Python bindings,
TentrisStore
is an in-memory store and knowledge graphs are not persisted.
For more details about the Python bindings (e.g., persistence), please refer to the chapter Python.