Core API Documentation
The Core API is the central orchestration service in the OpenGIN platform, responsible for coordinating data operations across multiple databases and providing a unified interface for entity management.
Overview
The Core API serves as the business logic layer that:
- Receives protobuf messages from the Ingestion and Read APIs
- Orchestrates data operations across MongoDB, Neo4j, and PostgreSQL
- Implements type and storage inference algorithms
- Manages temporal data and relationships
- Returns processed data back to the API layer
Architecture
Service Components
Service Components
gRPC Service Methods
1. CreateEntity
Creates a new entity with metadata, attributes, and relationships.
Request Flow:
- Validate entity data and structure
- Process metadata → MongoDB
- Create entity node → Neo4j
- Process attributes → PostgreSQL (with type/storage inference)
- Create relationships → Neo4j
- Return created entity
Key Features:
- Automatic type inference for attributes
- Dynamic storage strategy determination
- Temporal relationship support
- Atomic operations across databases
2. ReadEntity
Retrieves entity data from multiple databases based on requested output parameters.
Request Flow:
- Always fetch core entity info from Neo4j
- Conditionally fetch metadata from MongoDB
- Conditionally fetch attributes from PostgreSQL
- Conditionally fetch relationships from Neo4j
- Assemble complete entity response
Output Parameters:
metadata- Include entity metadataattributes- Include entity attributesrelationships- Include entity relationshipsall- Include everything
3. UpdateEntity
Updates existing entity data while maintaining temporal consistency.
Request Flow:
- Validate entity exists
- Update metadata in MongoDB (if provided)
- Update entity properties in Neo4j (if provided)
- Update attributes in PostgreSQL (if provided)
- Update relationships in Neo4j (if provided)
- Return updated entity
4. DeleteEntity
Removes entity and all associated data from all databases.
Request Flow:
- Delete metadata from MongoDB
- Delete entity node and relationships from Neo4j
- Delete attributes from PostgreSQL
- Return deletion confirmation
5. QueryEntity
Performs complex queries across multiple databases.
Capabilities:
- Cross-database joins
- Temporal queries
- Relationship traversal
- Attribute filtering
- Metadata search
Engine Layer Components
AttributeProcessor
Purpose: Processes and validates entity attributes before storage.
Key Functions:
- Validates attribute data types
- Handles time-based attribute values
- Manages attribute schema evolution
- Coordinates with type and storage inference
Process Flow:
Input Attribute → Type Validation → Storage Determination → Database Storage
TypeInference
Purpose: Automatically determines data types for attribute values.
Supported Types:
int- Integer numbersfloat- Decimal numbersstring- Text databool- Boolean valuesdate- Date valuestime- Time valuesdatetime- Date and time values
Inference Rules:
- Integer Detection: Whole numbers without decimals
- Float Detection: Numbers with decimal points or scientific notation
- Boolean Detection:
true,false,1,0 - Date Detection: ISO date format patterns
- Time Detection: Time format patterns
- String Fallback: Any non-matching data
StorageInference
Purpose: Determines optimal storage strategy for attributes.
Storage Types:
SCALAR- Single values (numbers, strings, booleans)LIST- Arrays of valuesMAP- Key-value pairsTABULAR- Table-like data with rows and columnsGRAPH- Network data (not fully supported)
Inference Logic:
Data Structure Analysis → Storage Type Determination → Database Assignment
GraphMetadataManager
Purpose: Manages graph-specific metadata and relationships. Acts as a lookup graph for entity and its data.
Key Functions:
- Entity node creation and updates
- Relationship management
- Graph traversal optimization
- Temporal relationship handling
Related Documentation
- Architecture Overview - System architecture
- Service APIs - API documentation
- Database Schemas - Database structures
- How It Works - End-to-end data flow
- Storage Types - Storage inference details