Add filter, add READMES
This commit is contained in:
24
backend_go/graph_queries/hierarchy.go
Normal file
24
backend_go/graph_queries/hierarchy.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package graph_queries
|
||||
|
||||
import "fmt"
|
||||
|
||||
func hierarchyEdgeQuery(edgeLimit int, includeBNodes bool) string {
|
||||
bnodeFilter := ""
|
||||
if !includeBNodes {
|
||||
bnodeFilter = "FILTER(!isBlank(?s) && !isBlank(?o))"
|
||||
}
|
||||
|
||||
return fmt.Sprintf(`
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
SELECT ?s ?p ?o
|
||||
WHERE {
|
||||
VALUES ?p { rdfs:subClassOf }
|
||||
?s ?p ?o .
|
||||
FILTER(!isLiteral(?o))
|
||||
%s
|
||||
}
|
||||
LIMIT %d
|
||||
`, bnodeFilter, edgeLimit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user