Data Relationships
Understanding the relationships between different API entities is crucial for effective integration with the G17Eco platform. This page outlines the hierarchical structure and connections between various data types.
Entity Relationship Overview
Core Entities
Initiatives
Initiatives form the foundation of the organizational structure in G17Eco. They represent companies, subsidiaries, or organizational units that track sustainability metrics.
Relationships:
- Can have parent-child relationships with other initiatives via
parentId - Contains multiple surveys/reports
- Forms a hierarchical tree structure
See Initiative API for the complete TypeScript interface.
Surveys (Reports)
Surveys, also known as Reports, are periodic data collection instruments that capture sustainability metrics for a specific time period.
Report Coverage Period:
The effectiveDate represents the end date of the reporting period. The coverage range is determined by:
| Period | EffectiveDate | Coverage |
|---|---|---|
| yearly | 2025-12-31 | Jan 1 - Dec 31, 2025 |
| quarterly | 2025-03-31 | Jan 1 - Mar 31, 2025 (Q1) |
| quarterly | 2025-06-30 | Apr 1 - Jun 30, 2025 (Q2) |
| quarterly | 2025-09-30 | Jul 1 - Sep 30, 2025 (Q3) |
| quarterly | 2025-12-31 | Oct 1 - Dec 31, 2025 (Q4) |
| monthly | 2025-01-31 | Jan 1 - Jan 31, 2025 |
| monthly | 2025-02-28 | Feb 1 - Feb 28, 2025 |
Relationships:
- Belongs to exactly one initiative via
initiativeId - Contains multiple Universal Tracker Values (UTRVs)
lastUpdatedis aggregated from contained UTRV changes
See Survey API for the complete TypeScript interface.
Universal Tracker Values (UTRVs)
UTRVs are the actual data points that store sustainability metrics. They represent specific measurements like emissions, energy consumption, or social metrics.
Key Data Storage:
- Simple values: Stored in
valuefield for numeric/percentage data - Complex values: Stored in
valueDatafielddata: Text, arrays, or selectionstable: 2D arrays for matrix data (e.g., emissions by scope)notApplicableType: 'na' or 'nr' flags
Relationships:
- Belongs to a survey (inherits period, effectiveDate, evidence/verification requirements)
- References a Universal Tracker for metadata and validation rules
- May reference value lists for controlled vocabularies
See UTRV API for the complete TypeScript interface.
Universal Trackers
Universal Trackers define the metadata and schema for UTRVs. They act as templates that specify what type of data should be collected.
Relationships:
- One-to-many with UTRVs
- Defines validation rules, units, and data types
- May reference value lists for dropdown options
Value Lists
Value Lists provide controlled vocabularies for dropdown and select fields in the system.
Relationships:
- Referenced by UTRVs that use controlled vocabularies
- Can be shared across multiple UTRVs
- Fetched via
/value-list/lookupendpoint
Data Flow Patterns
Hierarchical Data Retrieval
1. Fetch Initiative Tree
└── Get all child initiatives
└── For each initiative, get surveys
└── For each survey, get UTRVs
└── For each UTRV, get Universal Tracker metadataChange-Based Synchronization
1. Query surveys with changedSince parameter
2. System aggregates max(lastUpdated) from UTRVs
3. Returns only surveys with changes after specified date
4. Fetch detailed data for changed surveys onlyComplex Data Structures
Table Data in UTRVs
UTRVs can store complex matrix data using the table structure:
{
"valueData": {
"table": [
[
{ "code": "scope1", "value": 1250.5, "unit": "tCO2e", "numberScale": "single" },
{ "code": "scope2", "value": 850.3, "unit": "tCO2e", "numberScale": "single" }
],
[
{ "code": "scope3_upstream", "value": 5.2, "unit": "tCO2e", "numberScale": "thousands" },
{ "code": "scope3_downstream", "value": 3.8, "unit": "tCO2e", "numberScale": "thousands" }
]
]
}
}This structure allows for:
- Multi-dimensional data representation
- Different units and scales per cell
- Complex emissions breakdowns
- Category-based reporting
Best Practices for Data Relationships
Efficient Data Fetching
When building your integration, fetch data in the following order:
- Initiative structure (rarely changes)
- Changed surveys (use
changedSince) - Survey details with embedded UTRVs
- Value lists (cache these as they rarely change)
API Endpoints by Relationship
| Relationship | Endpoint | Purpose |
|---|---|---|
| Initiative → Surveys | GET /initiatives/:id/surveys | Get all surveys for an initiative |
| Survey → UTRVs | GET /surveys/:id | Get survey with embedded UTRVs |
| UTRV → Universal Tracker | Embedded in survey response | Metadata included with UTRV |
| UTRV → Value List | POST /value-list/lookup | Bulk fetch value lists |
| Initiative Hierarchy | GET /initiatives/tree | Get full organizational tree |