How blue-core-lod/bluecore_api works
Blue Core API manages BIBFRAME resources and related profiles, versions, and change feeds. A client sends requests through the FastAPI application; resource routes create, retrieve, update, search, and serialize records, while batch and export routes initiate workflow operations. Profile management and MARC conversion are distinct capabilities. PostgreSQL is the documented persistence layer, and Keycloak and Airflow are documented external dependencies. Edges reflect shown imports, route registration, and README statements; unsampled route internals are not inferred.
Main entry points: main.py FastAPI application · database.py Database sessions · instances.py Resource routes · profiles.py Profile routes
Components 29
API routes
- FastAPI application
src/bluecore_api/app/main.py - Resource routes
src/bluecore_api/app/routes/instances.py - Search routes
src/bluecore_api/app/routes/search.py - Profile routes
src/bluecore_api/app/routes/profiles.py - Version routes
src/bluecore_api/app/routes/versions.py - Batch and export
src/bluecore_api/app/routes/batches.py - MARC conversion
src/bluecore_api/app/routes/convert.py - Change feeds
src/bluecore_api/change_documents/routes.py - Change-feed schemas
src/bluecore_api/schemas/change_documents/schemas.py
Resource processing
- JSON-LD handling
src/bluecore_api/app/utils/jsonld.py - Graph expansion
src/bluecore_api/expansion.py - Response serialization
src/bluecore_api/app/utils/serialize/response_generator.py - Resource serialization
src/bluecore_api/app/utils/serializer.py - BIBFRAME models
src/bluecore_api/schemas/bibframe.py - API schemas
src/bluecore_api/schemas/schemas.py - View fields
src/bluecore_api/app/views/fields.py - View models
src/bluecore_api/app/views/model.py - View nodes
src/bluecore_api/app/views/nodes.py - View vocabulary
src/bluecore_api/app/views/vocabulary.py
Profiles and versions
- Profile usage analysis
src/bluecore_api/app/utils/profile_usage.py - Profile version logic
src/bluecore_api/app/utils/profile_versions.py - Template compatibility
src/bluecore_api/app/utils/template_compat.py
Identity and access
- Role authorization
src/bluecore_api/middleware/bluecore_check_permissions.py - Keycloak
Persistence and workflows
- Workflow client
src/bluecore_api/workflow.py - PostgreSQL
- Database sessions
src/bluecore_api/database.py - Airflow service
Other components
- API client
Connections 32
- API client → FastAPI application: sends requests
- FastAPI application → Resource routes: registers routes
src/bluecore_api/app/main.py - FastAPI application → Search routes: registers routes
src/bluecore_api/app/main.py - FastAPI application → Profile routes: registers routes
src/bluecore_api/app/main.py - FastAPI application → Version routes: registers routes
src/bluecore_api/app/main.py - FastAPI application → Batch and export: registers routes
src/bluecore_api/app/main.py - Resource routes → Database sessions: opens sessions
src/bluecore_api/app/routes/instances.py - Search routes → Database sessions: queries
src/bluecore_api/app/routes/search.py - Profile routes → Database sessions: queries
src/bluecore_api/app/routes/profiles.py - Version routes → Database sessions: queries
src/bluecore_api/app/routes/versions.py - Change feeds → Database sessions: opens sessions
src/bluecore_api/change_documents/routes.py - Database sessions → PostgreSQL: connects to
src/bluecore_api/database.py - Batch and export → Workflow client: starts workflows
src/bluecore_api/app/routes/batches.py - Workflow client → Airflow service: uses service
- Resource routes → JSON-LD handling: parses records
src/bluecore_api/app/routes/instances.py - Resource routes → Response serialization: builds responses
src/bluecore_api/app/routes/instances.py - Response serialization → Graph expansion: expands graphs
src/bluecore_api/app/utils/serialize/response_generator.py - Response serialization → JSON-LD handling: loads JSON-LD
src/bluecore_api/app/utils/serialize/response_generator.py - Response serialization → View fields: renders views
src/bluecore_api/app/utils/serialize/response_generator.py - Response serialization → API schemas: validates output
src/bluecore_api/app/utils/serialize/response_generator.py - Graph expansion → JSON-LD handling: loads graphs
src/bluecore_api/expansion.py - Graph expansion → View models: uses models
src/bluecore_api/expansion.py - View fields → View nodes: uses nodes
src/bluecore_api/app/views/fields.py - View fields → View vocabulary: uses vocabulary
src/bluecore_api/app/views/fields.py - View fields → BIBFRAME models: reads models
src/bluecore_api/app/views/fields.py - Profile routes → Profile usage analysis: checks usage
src/bluecore_api/app/routes/profiles.py - Profile routes → Profile version logic: checks versions
src/bluecore_api/app/routes/profiles.py - Profile routes → Template compatibility: checks compatibility
src/bluecore_api/app/routes/profiles.py - Version routes → Profile version logic: uses version logic
src/bluecore_api/app/routes/versions.py - FastAPI application → Keycloak: authenticates requests
- Resource routes → Role authorization: checks permissions
src/bluecore_api/app/routes/instances.py - Change feeds → Change-feed schemas: validates output
src/bluecore_api/change_documents/routes.py