Union (query directive)

From WandoraWiki
Revision as of 12:50, 20 August 2009 by Olli (Talk | contribs)

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

Description

Joins the results of inner directives by concatenating them. If the results from different directives have different roles, new columns will be added with null values to make roles of each row identical. Duplicate rows are not removed.

Constructor

Union(Directive d1,Directive d2,...)

Examples

Following example gets all instances and subclasses of the input topic and concatenates the results. The reason for Roles directive on line 5 is to remove the default column which will still be present from Players directive.

importPackage(org.wandora.query2);
importPackage(org.wandora.topicmap);
new Union(
  new Instances().as("#instance"),
  new Roles("#instance").from(
    new Players(
      XTMPSI.SUPERCLASS_SUBCLASS,
      XTMPSI.SUBCLASS).whereInputIs(XTMPSI.SUPERCLASS).as("#instance")
  )
)
Personal tools