Empty (query directive)
From WandoraWiki
(Difference between revisions)
(→Examples) |
|||
Line 15: | Line 15: | ||
importPackage(org.wandora.query2) | importPackage(org.wandora.query2) | ||
new If( | new If( | ||
− | + | new Instances(), | |
new Empty(), | new Empty(), | ||
new Literals("no instances") | new Literals("no instances") |
Latest revision as of 13:23, 25 August 2009
[edit] Description
Returns an empty result.
[edit] Constructor
Empty()
[edit] Examples
Empty directive doesn't have many practical uses. It can be combined for example with If directive to return an empty set in some cases. If directive does this internally if no else directive is provided. You can turn this other way round and only return something in the else part as follows.
importPackage(org.wandora.query2) new If( new Instances(), new Empty(), new Literals("no instances") )
Of course you could achieve same thing by using Not directive in the condition.