Loading color scheme

WHICH Select Statement

The which select statement allows you to query the database behind a model in natural language based syntax.

A typical which select statement looks like the below:

Structure of a Which Select Statement

A which select statement is preceded with the WHICH keyword, followed by a Model Element Name, followed by a set of Which Clauses.

The details are verbose, but the syntax is very easy if you just think your query in natural language. The sections in this documentation provide examples of the various Which Clauses that you can use.

Definition


WHICHSELECTSTMT -> KEYWDWHICH MODELELEMENT (WHICHCLAUSE)* EOF;

WHICHCLAUSE -> (KEYWDAND | KEYWDWHICH)? (WITHCLAUSE | WHICHTHATCLAUSE? (KEYWDWHICH | KEYWDTHAT | KEYWDAN | KEYWDA)? NODE MATHCLAUSE?)?;

WITHCLAUSE -> KEYWDWITH (KEYWDWHAT | KEYWDA)? (MODELELEMENT | NODEPROPERTYIDENTIFICATION);

WHICHTHATCLAUSE -> ((KEYWDIS PREDICATE | PREDICATECLAUSE) | KEYWDTHAT (PREDICATECLAUSE | MODELELEMENT ((KEYWDISNOT | KEYWDIS) | PREDICATECLAUSE)) | MODELELEMENT
PREDICATECLAUSE);

MODELELEMENT -> PREBOUNDREADINGTEXT? MODELELEMENTNAME POSTBOUNDREADINGTEXT? MODELELEMENTSUFFIX?;

NODEPROPERTYIDENTIFICATION -> BROPEN MODELELEMENTNAME MODELELEMENTSUFFIX? QUOTEDIDENTIFIERLIST* BRCLOSE;

AND Predicate WHICH

An example of this clause type is "AND holds WHICH Position" as in the which select statement below:

 

Example of Use