Statements
These functions are for advanced use only. Prefer the higher-level SDK features such as assets, @compute, contexts, services, and signer workflows when those cover your use case. Reach for the low-level statement APIs when you need to construct or attach statements manually.
Functions
add_data_statement
staticmethod
add_data_statement(
data: List[_CID],
*,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
add_association_statement
staticmethod
add_association_statement(
subject: str,
association: List[str],
association_type: _PyAssociationType,
*,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
Association Types
ASSOCIATION_TYPES.CERTIFIES
ASSOCIATION_TYPES.INCLUDES
ASSOCIATION_TYPES.IS_INSTANCE_OF
Association
A builder for constructing and finalizing association statements.
Association
A builder for constructing and finalizing association statements.
An association links a subject (a CID, DID, or UUID) to one or more
predicates via an ASSOCIATION_TYPES relationship. Use Association.new()
or Association.with_context() to create an instance, attach predicates
with add_predicate(), and call finalize() to write the association
statement.
new
classmethod
new(
subject: CID | DID | UUID,
association_type: PyAssociationType,
**kwargs
) -> Association
with_context
staticmethod
with_context(ctx: Context)
Return a factory whose new() builds Association instances bound to ctx.
add_predicate
add_predicate(
predicate: CID
| List[CID]
| DID
| List[DID]
| UUID
| List[UUID],
) -> Association
Add one or more predicates (CID, DID, or UUID) to the association.
finalize
finalize() -> Association
Write the association statement and return self.
add_computation_statement
staticmethod
add_computation_statement(
inputs: List[_CID],
outputs: List[_CID],
computation: Optional[_CID] = None,
*,
operated_by: Optional[str] = None,
executed_on: Optional[str] = None,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
add_did_statement
staticmethod
add_did_statement(
did: str,
*,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
add_entity_statement
staticmethod
add_entity_statement(
entity: str,
*,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
add_metadata_statement
staticmethod
add_metadata_statement(
subject: str,
metadata: str,
*,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
add_storage_statement
staticmethod
add_storage_statement(
data: str,
stored_on: str,
*,
operated_by: Optional[str] = None,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
Adds a storage statement linking data to a storage location.
add_governance_statement
staticmethod
add_governance_statement(
subject: str,
document: str,
*,
_skip_proof: Optional[bool] = None,
context: Optional[_Context] = None
) -> List[_CID]
add_vc_statement
staticmethod
add_vc_statement(
subject: str,
*,
timestamp: Optional[str] = None,
context: Optional[_Context] = None
) -> _CID
add_model_signing_statement
staticmethod
add_model_signing_statement(
collection_cid: str,
model_signing_name: str,
*,
context: Optional[_Context] = None
) -> _CID