Query Concepts
Before writing specific queries, it’s important to understand the conceptual model for navigating AP 210 data.
The Entity Graph
An AP 210 dataset is a directed graph of entity instances:
Each entity instance has a unique numeric ID (e.g.,
#100)Entities reference other entities via attribute values
Following these references traces paths through the graph
Queries follow these paths to find specific data
Navigation Patterns
Query Building Blocks
A typical query consists of:
Filter - Select entities matching criteria (type, attribute value)
Navigate - Follow references to related entities
Collect - Gather the desired attribute values
Transform - Convert to the desired output format
Common Starting Points
Most AP 210 queries start from one of these entities:
APPLICATION_CONTEXT - The root context
PRODUCT - A specific product
PRODUCT_DEFINITION - A specific view of a product
SHAPE_DEFINITION_REPRESENTATION - Shape data
PHYSICAL_CONNECTIVITY_DEFINITION - A net
Algorithm Notation
In subsequent lessons, we use a pseudo-code notation:
FOR EACH entity OF type IN dataset WHERE entity.attribute = value FOLLOW entity.reference -> target COLLECT target.desired_attribute END
This notation can be translated to EXPRESS queries, SQL, or Java code (covered in Module 5).