createStatement

Create a statement object with all required fields. Always computes Fide IDs from rawIdentifier + entityType + sourceType. Predicates must be canonical full URLs.

createStatement(input)

Parameters

inputStatementInput*
Statement input with subject, predicate, and object

Returns

Prop

Type

import { createStatement } from '@fide.work/fcp';

const result = await createStatement({ subject: { rawIdentifier: "https://x.com/alice", entityType: "Person", sourceType: "Product" }, predicate: { rawIdentifier: "https://schema.org/name", entityType: "CreativeWork", sourceType: "Product" }, object: { rawIdentifier: "Alice", entityType: "CreativeWork", sourceType: "CreativeWork" } });

Type Definitions

type StatementInput

Input for creating a statement. All triples require rawIdentifier + entityType + sourceType. The SDK always computes Fide IDs internally to avoid trust/validation issues with pre-calculated hashes.

StatementInput

Properties

Prop

Type

type Statement

Complete statement object with all required fields **Important**: Both Fide IDs and raw identifiers are required because: - Fide IDs are one-way hashes - cannot be reversed to get raw identifiers - Protocol specification requires both fields - Indexers need raw identifiers for lookup tables and human-readable display - Enables mapping back to human-readable identifiers for debugging and display

Statement

Properties

Prop

Type