visoto

module
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0

README

Visoto

Visoto is a Go web application for browsing and visualizing RDF linked data resources via SPARQL endpoints. It renders resource pages using type-specific templates, supports full-text search, and exposes an MCP server for AI assistant integration.

You can find a demo at https://visoto.hutzli.org.

Visoto is still in development and not all features work properly.

Visoto home page showing the LINDAS data service browser

Features

  • RDF Resource browser — fetch any RDF resource by IRI; templates are resolved automatically from the resource's rdf:type
  • Full-text search — search across linked data resources with class and property filters
  • Faceted search — filter instance tables by property value, with enum, free-text and numeric-range facets resolved against the endpoint
  • Multi-endpoint support — switch between named SPARQL endpoints (e.g. LINDAS prod/int/test) via a sidebar menu
  • Graph Explorer — interactive RDF graph visualization powered by Graph Explorer (Ontodia fork)
  • Schema derivation — derive a SHACL-style schema from instance data and render it as a UML-like class diagram
  • Cube catalog — browse cube:Cube datasets, their dimensions and versions
  • Data upload & named graphs — load RDF from a file or URL into a named graph; list, export and delete graphs
  • AI chat — ask questions about linked data resources, powered by Google Gemini
  • Endpoint monitoring — track SPARQL endpoint availability and response times over time
  • MCP server — built-in Model Context Protocol server at /mcp for AI tool integration
  • Bookmarks — save resources to a sidebar list for quick return
  • Dark mode — toggle between light and dark themes
  • Responsive UI — built with Tabler (Bootstrap 5) and Tabulator for data tables

Prerequisites

  • Go 1.27+
  • A SPARQL endpoint (default: LINDAS)
  • Optional: Google Gemini API key (for the chat feature)

Setup

  1. Clone the repo and install dependencies:

    go mod download
    
  2. Create your config file:

    cp visoto.config.example visoto.config
    

    Edit visoto.config to set your SPARQL endpoint, port, and optional Gemini API key.

  3. Run the server:

    go run ./cmd/visoto/
    
  4. Open the app:

    • Web UI: http://localhost:8060
    • Health check: http://localhost:8060/ping
    • MCP server: http://localhost:8060/mcp

Alternative: run with Docker:

docker build -t visoto .
docker run -e GIN_MODE=release -p 8060:8060 \
  -v ./visoto.config:/app/visoto.config:ro \
  visoto

See docs/deployment.md for full production Docker + Caddy setup.

Optional: deploy with QLever private triplestore:

./deploy.sh <server> [user] --with-qlever

This starts QLever in an isolated Docker network reachable only by Visoto. See qlever/ and scripts/qlever-start-dev.sh for local dev setup and data loading instructions.

Configuration

Configuration is loaded from visoto.config (TOML format). See visoto.config.example for all options.

Key settings:

Setting Description Default
application.port HTTP port (code default is 8080; example config uses 8060 — set explicitly) 8080
application.sparqlEndpoint Default SPARQL endpoint URL —
application.sparqlEndpoints Named endpoints for the switcher menu. Each entry takes name, url, slug, tag, default, monitor, plus optional search_provider, export_provider and access_token / username / password for write operations —
application.timeout SPARQL query timeout (seconds) 30
application.gemini_api_key Google Gemini API key for chat —
application.allow_private_upload_urls Allow uploads to fetch from loopback/private hosts (test environments only) false
rdf.prefixes RDF prefix declarations (SPARQL or Turtle notation) —
rdf.type_priority Priority order for template resolution when a resource has multiple types —
rdf.magic_properties visoto:<key> tokens expanded to property paths in template queries —
ontologies Ontologies offered for import in the upload dialog (name, url, graph) —
logging.level Log level: DEBUG, INFO, WARN, ERROR INFO
mcp.port MCP port (unused when embedded in main server) 8070
PORT (env var) Overrides application.port — lets a second instance run without editing the config —
GIN_MODE (env var) Gin framework mode: debug, release, test debug

The slug is the only endpoint identifier that travels over the wire: it drives shareable ?endpoint=<slug> links and must be unique across all entries.

Testing

Run the unit tests:

go test ./...

CI (.github/workflows/ci.yml) runs on every push to main and on pull requests: a gofmt check, go vet, go build, go test, and finally a boot smoke test.

The smoke test exists because templates are parsed at runtime, not compile time — a malformed template panics during startup and go build cannot catch it. CI therefore starts the compiled binary and polls /ping; a pong proves every layout, partial, page, class and instance template parsed successfully.

Documentation

Document Audience
Getting Started Run locally for the first time
Architecture Overview Understand how the system fits together
Configuration Reference All visoto.config fields explained
Template Authoring Guide Create custom templates for your RDF types
Deployment Guide Docker + Caddy production setup

Project Structure

cmd/visoto/        — main entry point (calls app.Main)
app/               — the server: config loading, router, HTTP handlers
internal/
  cache/           — in-process query/label caching
  chat/            — Gemini AI chat handler
  column/          — <sparql-column> declarations and column building
  config/          — TOML config loading
  export/          — named-graph export (Turtle, N-Quads, TriG, RDF/XML, JSON-LD)
  facet/           — faceted-search filter construction
  i18n/            — UI message catalogs (go-i18n)
  icon/            — resource icon resolution
  lang/            — language negotiation and the configured language set
  logger/          — structured slog logger
  mcp/             — MCP server (AI tool integration)
  monitor/         — simple SPARQL endpoint health monitoring
  parser/          — SPARQL preprocessor (template → query → result)
  resource/        — RDF resource resolution and template matching
  search/          — full-text search over SPARQL endpoints
  sparql/          — SPARQL query execution
  templates/       — Go template loader
  tree/            — hierarchy tree queries and validation
  upload/          — RDF upload and named-graph management
locales/           — UI translations (de, en, fr, it, rm)
templates/
  layout/          — shared layout templates (base, sidebar, header, footer)
  pages/           — static page templates (home, search, monitoring, …)
  classes/         — class-level RDF templates
  instances/       — instance-level RDF templates
  partials/        — reusable SPARQL components (table, graph, grid, tree, metric, flow)
  components/      — smaller shared fragments (literals, relationships, page header)
static/            — CSS, JS, images

Routes

Method Path Description
GET / Home page
GET /search Full-text search
GET /resource?iri=<IRI>&endpoint=<slug> Resource page
GET /resource/*path Legacy path form — 301 redirect to /resource?iri=
GET /:page Static pages by name (about.html, classes.html, …)
GET /monitoring Endpoint monitoring dashboard
GET /api/monitoring/status Monitoring status (JSON)
POST /api/monitoring/toggle Enable/disable monitoring
GET /api/monitoring/data Historical monitoring data (JSON)
GET /api/metric/:id Lazy-load metric counts (HTMX)
GET /api/async-table/:id Lazy-loaded table fragment (HTMX)
GET /api/async-table-data/:id Working-set table rows (JSON)
GET /api/faceted-table/:id Faceted table — fragment or JSON, content-negotiated
GET /api/facet-values/:id/:var Distinct values and counts for one facet (JSON)
GET /api/cube-table/:id Cube observation table; query built from the cube's SHACL constraint
GET /api/lazy-tree/:id/:role One level of a lazily expanded tree
GET /api/bnode-tree?iri=<IRI> Outgoing blank nodes as a tree (HTMX fragment), or &format=ttl|nt|jsonld as a download
POST /api/upload Upload RDF from a file or URL into a named graph
GET /api/named-graphs List named graphs (JSON)
DELETE /api/named-graphs Delete a named graph
GET /api/export-graphs Export named graphs (Turtle, N-Quads, … or zip)
GET /api/ontologies Ontologies available for import (JSON)
POST /api/cache/purge Flush the Caddy/Souin response cache
POST /api/chat Gemini AI chat
ANY /mcp MCP server endpoint
GET /health MCP health check
GET /ping Health check

The metric, async-table, async-table-data, faceted-table, facet-values and lazy-tree routes require ?src=<template set> (e.g. src=pages/plazi.html): :id names a declaration in the markup (<sparql-async>, or <sparql-tree-query> for lazy-tree), and those are scoped to the template set that declares them, not global. The frontend attaches it automatically — see Async query scope. /api/cube-table/:id is the exception: its query is generated from the cube's own SHACL constraint, so ?iri= alone determines the response, and so does /api/bnode-tree, which builds its query from ?iri= (plus the optional ?property= / ?via=).

Screenshots

Catalog class page in dark mode

License

Visoto is licensed under the Apache License 2.0.

Third-party components — the browser libraries loaded from a CDN and the Go modules pinned in go.sum — remain under their own licenses, attributed in NOTICE.

Contributions are welcome. By submitting a pull request you agree that your contribution is licensed under the same terms, per section 5 of the license.

Directories

Path Synopsis
Package app is the Visoto server: it loads the configuration, the SPARQL preprocessor and the templates, registers every route and runs the HTTP server.
Package app is the Visoto server: it loads the configuration, the SPARQL preprocessor and the templates, registers every route and runs the HTTP server.
cmd
caddylang command
Command caddylang writes the Caddyfile language maps from visoto.config.
Command caddylang writes the Caddyfile language maps from visoto.config.
visoto command
Command visoto runs the open-source Visoto server.
Command visoto runs the open-source Visoto server.
internal
access
Package access defines what a request does with a store — the unit an Authorizer decides on — and the open default under which everything is allowed.
Package access defines what a request does with a store — the unit an Authorizer decides on — and the open default under which everything is allowed.
bnodetree
Package bnodetree turns the outgoing blank nodes of a resource into a tree for display: nested key/value blocks, RDF lists, enumerations and shared nodes.
Package bnodetree turns the outgoing blank nodes of a resource into a tree for display: nested key/value blocks, RDF lists, enumerations and shared nodes.
cache
Package cache holds the small expiring cache used wherever the app asks an endpoint one batched question and wants to remember the answer for a while: label resolution and rdf:type lookup after a query returns (internal/sparql), and full-text connector discovery before one is built (internal/search).
Package cache holds the small expiring cache used wherever the app asks an endpoint one batched question and wants to remember the answer for a while: label resolution and rdf:type lookup after a query returns (internal/sparql), and full-text connector discovery before one is built (internal/search).
classstats
Package classstats counts the instances of every used class, once a day, on the endpoints that opt in (class_stats = true), and keeps the history in SQLite (./data/classstats.db).
Package classstats counts the instances of every used class, once a day, on the endpoints that opt in (class_stats = true), and keeps the history in SQLite (./data/classstats.db).
column
Package column models a <sparql-column> declaration: the template vocabulary describing ONE column of a SPARQL result table — what it is called, what it explains, how it is rendered, and whether it can be filtered.
Package column models a <sparql-column> declaration: the template vocabulary describing ONE column of a SPARQL result table — what it is called, what it explains, how it is rendered, and whether it can be filtered.
facet
Package facet implements backend faceted search over a declared class-instance SPARQL query.
Package facet implements backend faceted search over a declared class-instance SPARQL query.
graphlayout
Package graphlayout stores Graph Explorer layouts shared between users: the canvases graph-kit.js snapshots (static/js/graph-store.js, format "visoto-graph" v1), kept server-side so a page shows the same arrangement on every machine.
Package graphlayout stores Graph Explorer layouts shared between users: the canvases graph-kit.js snapshots (static/js/graph-store.js, format "visoto-graph" v1), kept server-side so a page shows the same arrangement on every machine.
i18n
Package i18n holds the UI string catalogs and the per-language template functions that read them.
Package i18n holds the UI string catalogs and the per-language template functions that read them.
icon
Package icon resolves an RDF resource to one of the SVG icons shipped in static/img/resource/.
Package icon resolves an RDF resource to one of the SVG icons shipped in static/img/resource/.
lang
Package lang resolves the site UI language for a request.
Package lang resolves the site UI language for a request.
mcp
monitor
Package monitor provides periodic SPARQL endpoint health monitoring.
Package monitor provides periodic SPARQL endpoint health monitoring.
shapeprose
Package shapeprose explains a SHACL shape in plain language: one short line per property, built from fixed phrases so it translates safely.
Package shapeprose explains a SHACL shape in plain language: one short line per property, built from fixed phrases so it translates safely.
sparqlproxy
Package sparqlproxy forwards raw SPARQL read queries from the browser to a configured endpoint, same-origin.
Package sparqlproxy forwards raw SPARQL read queries from the browser to a configured endpoint, same-origin.
tree
Package tree builds and validates the queries behind the lazy tree partial.
Package tree builds and validates the queries behind the lazy tree partial.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL