backend: support external SPARQL and named-graph snapshots
This commit is contained in:
23
backend_go/graph_snapshot_named_graph_test.go
Normal file
23
backend_go/graph_snapshot_named_graph_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user