kapps_ogm.mapping.anonymous_model#

Pydantic base model for anonymous nodes behind COMPLEX properties.

The anonymous node carries its RDF address (a Skolem IRI) out of band in a PrivateAttr, so that the address is reachable by the serializer but invisible in every projection. See PRD requirement R4 and RDF 1.1 Concepts section 3.5.

Important: the private attribute is a mirror, not the source of truth. It does not survive a dump-then-revalidate round trip. Node.data is the authoritative carrier.

class kapps_ogm.mapping.anonymous_model.AnonymousNodeModel[source]#

Bases: BaseModel

Base model for anonymous nodes behind COMPLEX properties.

The RDF address (Skolem IRI) is stored out of band in _node_iri, ensuring it is absent from model_dump(), model_dump_json(), and model_json_schema(). This keeps the address invisible to northbound consumers while still allowing the OGM to track it for serialization purposes.

model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) → None#

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.