MCPcopy
hub / github.com/dgraph-io/dgraph / validateSubGraphForRDF

Function validateSubGraphForRDF

query/outputrdf.go:214–235  ·  view source on GitHub ↗
(sg *SubGraph)

Source from the content-addressed store, hash-verified

212}
213
214func validateSubGraphForRDF(sg *SubGraph) error {
215 if sg.IsGroupBy() {
216 return errors.New("groupby is not supported in rdf output format")
217 }
218 uidCount := sg.Attr == "uid" && sg.Params.DoCount && sg.IsInternal()
219 if uidCount {
220 return errors.New("uid count is not supported in the rdf output format")
221 }
222 if sg.Params.Normalize {
223 return errors.New("normalize directive is not supported in the rdf output format")
224 }
225 if sg.Params.IgnoreReflex {
226 return errors.New("ignorereflex directive is not supported in the rdf output format")
227 }
228 if sg.SrcFunc != nil && sg.SrcFunc.Name == "checkpwd" {
229 return errors.New("chkpwd function is not supported in the rdf output format")
230 }
231 if sg.Params.Facet != nil && !sg.Params.ExpandAll {
232 return errors.New("facets are not supported in the rdf output format")
233 }
234 return nil
235}
236
237func quotedNumber(val []byte) []byte {
238 const overhead = 2 // opening and closing quotes

Callers 2

ToRDFFunction · 0.85
castToRDFMethod · 0.85

Calls 2

IsGroupByMethod · 0.80
IsInternalMethod · 0.80

Tested by

no test coverage detected