获取样本数据
使用 has函数获取一些样本节点。
{result(func: has(director.film), first: 10) {uidexpand(_all_)}}
统计连接节点数
使用expand(_all_) 展开节点的边,然后将展开的uid分配给变量。现在可以使用该变量迭代唯一的相邻节点。然后使用count(uid)来计算变量块中的节点数。
{uids(func: has(director.film), first: 1) {uidexpand(_all_) { u as uid }}result(func: uid(u)) {count(uid)}}
搜索无索引谓词
在值变量中使用has函数搜索无索引的谓词。
{var(func: has(festival.date_founded)) {p as festival.date_founded}query(func: eq(val(p), "1961-01-01T00:00:00Z")) {uidname@enname@runame@plfestival.date_foundedfestival.focus { name@en }festival.individual_festivals { total : count(uid) }}}
