package graph_queries import "fmt" func defaultEdgeQuery(limit int, offset int, includeBNodes bool) string { bnodeFilter := "" if !includeBNodes { bnodeFilter = "FILTER(!isBlank(?s) && !isBlank(?o))" } return fmt.Sprintf(` PREFIX rdf: PREFIX rdfs: PREFIX owl: SELECT ?s ?p ?o WHERE { { VALUES ?p { rdf:type } ?s ?p ?o . ?o rdf:type owl:Class . } UNION { VALUES ?p { rdfs:subClassOf } ?s ?p ?o . } FILTER(!isLiteral(?o)) %s } ORDER BY ?s ?p ?o LIMIT %d OFFSET %d `, bnodeFilter, limit, offset) } func defaultPredicateQuery(includeBNodes bool) string { bnodeFilter := "" if !includeBNodes { bnodeFilter = "FILTER(!isBlank(?s) && !isBlank(?o))" } return fmt.Sprintf(` PREFIX rdf: PREFIX rdfs: PREFIX owl: SELECT DISTINCT ?p WHERE { { VALUES ?p { rdf:type } ?s ?p ?o . ?o rdf:type owl:Class . } UNION { VALUES ?p { rdfs:subClassOf } ?s ?p ?o . } FILTER(!isLiteral(?o)) %s } ORDER BY ?p `, bnodeFilter) }