backend: support external SPARQL and named-graph snapshots

This commit is contained in:
Oxy8
2026-04-06 13:36:08 -03:00
parent 696844f341
commit 44c1d3eaa6
25 changed files with 1695 additions and 243 deletions

View File

@@ -0,0 +1,23 @@
package main
import (
"strings"
"testing"
)
func TestRDFSLabelQueryUsesNamedGraphs(t *testing.T) {
query := rdfsLabelQuery([]string{
"http://example.com/A",
"http://example.com/B",
})
if !strings.Contains(query, "SELECT DISTINCT ?s ?label") {
t.Fatalf("label query should de-duplicate rows across named graphs:\n%s", query)
}
if !strings.Contains(query, "GRAPH ?g") {
t.Fatalf("label query should read from named graphs:\n%s", query)
}
if !strings.Contains(query, "<"+rdfsLabelIRI+">") {
t.Fatalf("label query should still fetch rdfs:label:\n%s", query)
}
}