ReviewsEntityLink reviews.entity-link@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
reviews
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/reviews/entity-link.v1.json

reviews.entity-link@1: one typed link on OpenVibe.Reviews (the review_entity_links row): between two entities (related, edition_of, successor_of, part_of; a merge is a merged_into link and a split ends it) or to another service's entity (external_ref, with ref holding the EntityRef as JSON text). Ending a link keeps it with who, when and why. Timestamps are epoch milliseconds.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^lnk_[0-9A-HJKMNP-TV-Z]{26}$
from_entitystringyes
  • pattern ^ent_[0-9A-HJKMNP-TV-Z]{26}$
to_entitystring | nullyes
typeenumyes
  • one of "merged_into", "related", "edition_of", "successor_of", "part_of", "external_ref"
refstring | nullyesexternal_ref links: the common.entity-ref@1 as JSON text.
notestring | nullyes
created_bystringyes
created_atintegeryesEpoch milliseconds.
ended_atinteger | nullyesEpoch milliseconds, or null.
ended_bystring | nullyes
end_notestring | nullyes

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: external
{
  "id": "lnk_01JAC5M7N7P8Q9R0S1T2V3W4X5",
  "from_entity": "ent_01JAC1E2N3T4V5W6X7Y8Z9A0B1",
  "to_entity": null,
  "type": "external_ref",
  "ref": "{\"service\":\"wiki\",\"type\":\"page\",\"id\":\"pg_01JAC9P0Q1R2S3T4V5W6X7Y8Z9\"}",
  "note": null,
  "created_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "created_at": 1790241000000,
  "ended_at": null,
  "ended_by": null,
  "end_note": null
}
Valid: merge
{
  "id": "lnk_01JAC5M6N7P8Q9R0S1T2V3W4X5",
  "from_entity": "ent_01JAC1E3N3T4V5W6X7Y8Z9A0B1",
  "to_entity": "ent_01JAC1E2N3T4V5W6X7Y8Z9A0B1",
  "type": "merged_into",
  "ref": null,
  "note": "Same headphones, regional name",
  "created_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "created_at": 1790241000000,
  "ended_at": null,
  "ended_by": null,
  "end_note": null
}
Rejected: bad-type
{
  "id": "lnk_01JAC5M6N7P8Q9R0S1T2V3W4X5",
  "from_entity": "ent_01JAC1E3N3T4V5W6X7Y8Z9A0B1",
  "to_entity": "ent_01JAC1E2N3T4V5W6X7Y8Z9A0B1",
  "type": "sibling_of",
  "ref": null,
  "note": "Same headphones, regional name",
  "created_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "created_at": 1790241000000,
  "ended_at": null,
  "ended_by": null,
  "end_note": null
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('reviews.entity-link@1', value);   // { valid, errors: [{ path, message }] }