buildStatementBatchWithRoot
Build a batch of statements and derive a deterministic batch root. Root derivation: - `statementFideIds` are lexicographically sorted - Sorted IDs are joined with `\\n` - SHA-256 is computed over that byte sequence - Result is returned as lowercase hex string
Parameters
Returns
Prop
Type
import { buildStatementBatchWithRoot } from '@fide.work/fcp';
const result = await buildStatementBatchWithRoot([{ 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" } }, { subject: { rawIdentifier: "https://x.com/bob", entityType: "Person", sourceType: "Product" }, predicate: { rawIdentifier: "https://schema.org/worksFor", entityType: "CreativeWork", sourceType: "Product" }, object: { rawIdentifier: "https://www.acme.com", entityType: "Organization", sourceType: "Product" } }]);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.
StatementInputProperties
Prop
Type
type StatementBatchWithRoot
Batch build result with deterministic content root.
StatementBatchWithRootProperties
Prop
Type
parseFideId
Parse a Fide ID into its constituent components. Decomposes a Fide ID into entity type, source type, and fingerprint, converting hex characters to their corresponding entity type names.
createStatement
Create a statement object with all required fields. Always computes Fide IDs from rawIdentifier + entityType + sourceType. Predicates must be canonical full URLs.