xl_programming_language:queries
This is an old revision of the document!
Table of Contents
Graph queries in XL
Description
Queries are used to query existing graphs for specific features. They are used to analyse the actual graph and search for a specific pattern.
XL syntax
Queries are enclosed in asterisked parenthesis: (* *)
The elements are given in their expected order. For example, (* Internode Internode Apex *)
searches for a subgraph which consists of a sequence of nodes of the types Internode Internode Apex
, connected by successor edges.
Examples
- Find all
Internode
nodes, and print them out:
println1)
- Find all newly created
Internode
nodes (with age 0):
(* i:Internode, (i[age] == 0) *)
- Search for all
Internode
nodes with diameter greater than 0.01:
(* i:Internode, (i[diameter] > 0.01) *)
- Find all pairs of segments
F
with distance smaller than 1:
(* f:F, g:F, 2) *)
- Find all
Internode
nodes, connected to aLeaf
node with a branching edge:
(* Internode +> Leaf *)
xl_programming_language/queries.1710151434.txt.gz · Last modified: 2024/03/11 11:03 by ksmolen