Subqueries

Subqueries must be well-formed queries in their own right. They must have one or more edges that connect the subquery to a vertex or vertices in the main query. Subqueries can be nested. (Nested subqueries are allowed by QGraph and the DTD, but are prohibited by the current Proximity implementation.)

Subqueries are always annotated, as shown in the example below. The boundary edge of a subquery must be annotated. The boundary vertex of a subquery cannot be annotated.

<subquery>

Attributes  None.

Children 

vertex one or more A vertex within the subquery
edge one or more An edge within the subquery
subquery zero or more A nested subquery
constraint zero or one Specifies a constraint between query elements
numeric-annotation exactly one Cardinality requirements for the subquery

Content Model 

(vertex, (edge | vertex)*, subquery*, numeric-annotation)

Example 

<vertex name="B">
</vertex>
<subquery>
  <vertex name="C">
  </edge<
  <edge name="Z">
    <vertex1>B</vertex1>
    <vertex2>C</vertex2>
    <directed>true</directed>
    <numeric-annotation>
      <min>1</min>
    </numeric-annotation>
  </edge>
  <numeric-annotation>
    <min>1</min>
  </numeric-annotation>
</subquery>