elementUriToStatementUri
elementUriToStatementUri(
statementUri):StatementUri
Converts a given element URI to a statement URI.
Parameters
Section titled “Parameters”• statementUri: `stmt:cord:${string}`
The element URI to be converted. Expected format: ‘stmt:cord:
Returns
Section titled “Returns”StatementUri
A statement URI derived from the element URI, excluding the digest component.
Remarks
Section titled “Remarks”This function processes an element URI and reformats it to construct a corresponding statement URI. It expects the element URI to follow a specific format and extracts the relevant part to create the statement URI.
Example
Section titled “Example”const elementUri = 'stmt:cord:1234:abcd';const statementId = elementUriToStatementUri(elementUri);console.log('Statement URI:', statementId);Throws
Section titled “Throws”If the statementUri does not conform to the required format.
Description
Section titled “Description”The function splits the statementUri and validates its structure against the expected format. If valid, it
constructs a new statement URI using only the ‘stmt:cord: