buildStatement
Build a statement object with all required fields. Always computes Fide IDs from referenceIdentifier + entityType + referenceType. Properties must be canonical full URLs.
Policies Enforced
- Statement Input PolicyValidates the subject, property, and object input shape before any Fide IDs are calculated.
- Statement Property PolicyValidates property-specific input rules before any Fide IDs are calculated.
- Statement Fide IDs PolicyValidates the calculated subject, property, and object Fide IDs before building the final statement.
- Nested Fide ID PoliciesCalls calculateFideId for each statement part, so reference type and reference identifier policies are also enforced.
Node Runtime Required
Parameters
Returns
Prop
Type
import { buildStatement } from '@fide-work/context-protocol';
const result = await buildStatement(
{"subject":{"referenceIdentifier":"https://x.com/alice","entityType":"Person","referenceType":"NetworkResource"},"property":{"referenceIdentifier":"https://schema.org/knows","entityType":"DirectionalProperty","referenceType":"NetworkResource"},"object":{"referenceIdentifier":"https://x.com/bob","entityType":"Person","referenceType":"NetworkResource"}},
{"normalizeReferenceIdentifier":true}
);Related Constants
Statement
Complete statement object with all required fields **Important**: Both Fide IDs and reference identifiers are required because: - Fide IDs are one-way hashes - cannot be reversed to get reference identifiers - Protocol specification requires both fields - Indexers need reference identifiers for lookup tables and human-readable display - Enables mapping back to human-readable identifiers for debugging and display
export const Statement: anyType Definitions
type StatementInput
Input for creating a statement. All triples require referenceIdentifier + entityType + referenceType. The SDK always computes Fide IDs internally to avoid trust/validation issues with pre-calculated hashes.
StatementInputProperties
Prop
Type
type StatementBuildOptions
Statement build options.
StatementBuildOptionsProperties
Prop
Type
type Statement7 properties
Complete statement object with all required fields **Important**: Both Fide IDs and reference identifiers are required because: - Fide IDs are one-way hashes - cannot be reversed to get reference identifiers - Protocol specification requires both fields - Indexers need reference identifiers for lookup tables and human-readable display - Enables mapping back to human-readable identifiers for debugging and display
StatementProperties
Prop
Type
Valid Fide entity type names derived from `FIDE_ENTITY_TYPE_MAP`.
"Statement" | "DirectionalProperty" | "SymmetricProperty" | "Person" | "Organization" | "SoftwareAgent" | "NetworkResource" | "PlatformAccount" | "CryptographicAccount" | "CreativeWork" | "Concept" | "Place" | "Event" | "Action" | "PhysicalObject" | "TextLiteral" | "IntegerLiteral" | "DecimalLiteral" | "BoolLiteral" | "DateLiteral" | "YearMonthLiteral" | "YearLiteral" | "TimeLiteral" | "DateTimeLiteral" | "DurationLiteral" | "URILiteral" | "JSONLiteral"type FideStatementPropertyEntityTypeRelated docs
Allowed entity types for statement properties. - `DirectionalProperty`: ordinary directed relationships - `SymmetricProperty`: relationships that canonicalize subject/object order
FideStatementPropertyEntityTypetype FideStatementPropertyReferenceType
Allowed reference types for statement properties. - `NetworkResource`: property IRIs are treated as network-resource-sourced vocabulary terms
"NetworkResource"type FideId
Full Fide ID format (with did:fide:0x prefix). Length: 11 ("did:fide:0x") + 40 hex = 51 chars.
`did:fide:0x${string}`expandPropertyReferenceIdentifier
Expand a prefixed property token (e.g. `schema:name`) to a full IRI. If `referenceIdentifier` is already an absolute URL, it is returned unchanged. If `referenceIdentifier` contains a prefix not found in the configured map, throws.
calculateCanonicalStatementSetRoot
Protocol-level deterministic root for a canonical statement set.