Literals (query directive)

From WandoraWiki
Revision as of 13:23, 25 August 2009 by Olli (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Description

Returns the strings provided to constructor. The returned rows have one column with the default role.

Constructor

Literals(String s1,...)

Notes

The from method present in every directive can be given strings instead of directives. In this case a Literals directive is implicitly created from the strings. A.from("b","c","d") is same as A.from(new Literals("b","c","d")).

Examples

importPackage(org.wandora.query2);
new If(
  new Instances(),
  new Literals("has instances"),
  new Literals("no instances")
)

This returns one of two literals depending on whether the input has instances.

Example below gets instances from the schema type topic. Literals is used implicitly.

importPackage(org.wandora.query2);
new Instances().from("http://www.wandora.org/core/schema-type")
Personal tools