Skip to content

Application entrypoint

app.main

FastAPI application entrypoint.

lifespan(app) async

Load and validate the ontology before serving the first request.

Parameters:

Name Type Description Default
app FastAPI

FastAPI application (unused; required by the lifespan protocol).

required

Yields:

Type Description
AsyncIterator[None]

Control to the running server until shutdown.

Raises:

Type Description
ReloadError

When the configured ontology cannot drive the API.

Source code in src/backend/app/main.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[None]:
    """Load and validate the ontology before serving the first request.

    Args:
        app: FastAPI application (unused; required by the lifespan protocol).

    Yields:
        Control to the running server until shutdown.

    Raises:
        ReloadError: When the configured ontology cannot drive the API.
    """
    RDFStore.instance().validate()
    yield