Predicate-Object Aggregations
Use the denormalized predicate_objects table for efficient collection queries.
Query Structureβ
query GetPredicateObjects($predicateId: String!, $limit: Int!) {
predicate_objects(
where: { predicate_id: { _eq: $predicateId } }
order_by: { triple_count: desc }
limit: $limit
) {
predicate_id
object_id
triple_count
total_market_cap
total_position_count
object {
term_id
label
image
}
}
}
Best Practicesβ
- Use for collection aggregations instead of manual counting
- More efficient than aggregating raw triples
- Pre-computed metrics updated automatically
- Order by triple_count for popular collections