User Tools

Site Tools


tutorials:basic-to-advanced-xl-queries

This is an old revision of the document!


From simple to advanced XL queries

module A;
module B;
module C;
module D;
 
protected void init ()
[
	Axiom ==> A [A B [b1:B] c:C b2:B ] D C [B A A] B A,c />d:D,b1 /> b2, b2 /> d;
]

Path queries

0. Get all nodes

answer

answer

In a Context:

(*Node*)

In a Query:

Node ==>

1. Get all the A nodes

answer

answer

In a Context:

((*A*))

In a Query:

A ==>

2. Get all B's that are linked by a successor

answer

answer

In a Context:

((*Node > B*))

In a Query:

(*Node > *) B ==> ;

Selected Nodes:

Model.B[id=30]
Model.B[id=33]
Model.B[id=39]

3. Get all B's that are linked by a branch

answer

answer

In a Context:

((*Node +> B*))

In a Query:

(*Node +> *) B ==> ;

Selected Nodes:

Model.B[id=31]
Model.B[id=36]

4. Get all As followed directly by another A

answer

answer

In a Context:

((*A -->A*))

In a Query:

(*A --> *) A ==> ;

Selected Nodes:

Model.A[id=29]
Model.A[id=38]

5. Get As followed directly by another A, both are connected by a branch

answer

answer

In a Context:

((*A +>A*))

In a Query:

(*A +> *) A ==> ;

Selected Nodes:

Model.A[id=29]

6. Get all A's that are below a C

answer

answer

In a Context:

(*C (-->)* A*))

In a Query:

(*C (-->)* *) A ==> ;

Selected Nodes:

Model.A[id=37]
Model.A[id=38]
Model.A[id=40]

7. Get all B's that are below another B

answer

answer

In a Context:

(*B (-->)+ B*))

In a Query:

(*B (-->)+ *) B ==> ;

Selected Nodes:

Model.B[id=31]
Model.B[id=33]
Model.B[id=33]
Model.B[id=33]

8. Get all D which are below a C, where the C is below a B

answer

answer

In a Context:

(*B --> C --> D*))

In a Query:

(*B --> C -->*) D ==> ;

Selected Nodes:

Model.D[id=41]

9. Get All Nodes, which are connected upwards as following: Branch, Successor Branch

answer

answer

In a Context:

((*Node +> > +> Node*))

In a Query:

(*Node +> > +>*) D ==> ;

Selected Nodes:

Model.A[id=29]
Model.B[id=31]

10. Get The B that is a decomposition child of another B, the successor of an C and has a D as a decomposition child.

answer

answer

In a Context:

((*B /> b:B, C > b,D</b*))

In a Query:

(*B />*)b:B (*< C*),(*D </b*) ==>;

Selected Nodes:

Model.B[id=33]

11. Get all A's that have no Children

answer

answer

In a Context:

((*a:A,(empty((*a --> Node*)))*))

In a Query:

a:A,(empty((*a --> Node*))) ==>;

Selected Nodes:

Model.A[id=38]
Model.A[id=40]
tutorials/basic-to-advanced-xl-queries.1733336683.txt.gz · Last modified: 2024/12/04 19:24 by tim2