Is there a way to return a “default” if a requested predicate does not exist? For example, if my query is:
{
ret(func:uid(0x11d794)) {
uid
name
hasPoint@filter(allofterms(tags,“air fan supply sensor”) ){
point_name: name
}
}
Is there a way to get a “default” value for point_name in the event that no hasPoint matching my criteria is found?
Is it possible for you to assign default values for hasPoint predicate while uploading the data? I can’t think of any easy way to override node’s attributes during a query. Let me search some more in the meanwhile.
Something along those lines. We could construct the query differently, if necessary, but that is essentially the kind of result we’d want. And since we can’t predict which point(s) will match the terms, we can’t solve the problem by creating a node with name: DefaultName in advance.