Facts and relations
What ARQL asks, the graph a drawing becomes, and the relations it holds.
ARQL asks a drawing which parts relate to which. You write a pattern, and ARQL returns the matching parts with the facts that justify each row. It only reads.
Run a query
agentcad search SHEET.dxf 'MATCH (b:bearing)-[:coaxial]-(s:shaft) RETURN b.id, s.id'Inside an execute program, call agentcad.relate(path).query("QUERY"), where path is a .dxf or a facts .json. Over Archee MCP, search takes the same query.
The graph
A sheet becomes a graph.
- A node is a part, a dimension or a view, named by an id such as
shaft.II,bearing.I.left,dim.fit.bearing.I.left.outerorview.front. On an upload nobody tagged, ids look likeblock.1A3F. - The kind of a node is the first id segment:
bearing,dim,block. - Node attributes are
id,kind,source,diameterandname. Adimnode also hasmeasured_valueandtext_value.
An edge is a relation. Every edge carries three attributes:
| Attribute | Meaning |
|---|---|
measured | A length, or null |
evidence | The text of the fact |
confidence | stated 1.0, measured 0.9 or inferred 0.6 |
Relations
| Relation | Reads as | Direction |
|---|---|---|
contains / inside | The holder contains the held part | Holder first |
touches | Outlines share a stretch; measured is the shared length | Symmetric |
gap | Faces side by side without touching; measured is the gap | Symmetric |
coaxial | On one axis | Symmetric |
parallel, perpendicular | Axes parallel or square | Symmetric |
spaced | Like parts in a row or ring; measured is the pitch or centre distance | Symmetric |
annotates / annotated_by | A note or balloon lands on the part | Note first |
dimensions / dimensioned_by | A dimension starts on the part; measured is its length | Dimension first |
pattern / in_pattern | A named pattern such as 4 x M8 on D110 and its member | Pattern first |
No edge means the relation was not read. It does not mean the relation is absent.
Confidence
Read confidence before you rely on a relation. stated comes from the drawing itself, such as a dimension or a note. measured comes from geometry. inferred comes from boxes and axes, so confirm it when it matters.