Document Relationships
You can use the relationships query target to query links in annotations and other document relationships.
Use the Retrieve Document Type Relationships API to get the relationships queryable fields and object relationships. This includes the source__vr and target__vr relationships, which you can use to filter the returned document relationships.
Relationship Query Examples
Section link for Relationship Query ExamplesThe following are examples of relationship queries.
Annotation Link Query
Section link for Annotation Link QueryThe following query retrieves relationship properties for link annotations:
SELECT source_doc_id__v, source_major_version__v, source_minor_version__v, relationship_type__v, target_doc_id__v, target_major_version__v, target_minor_version__v
FROM relationships
WHERE relationship_type__v = 'references__v'Related Document Metadata Query
Section link for Related Document Metadata QueryThe following query retrieves document metadata where the source document has a document type of Promotional Material:
SELECT source__vr.name__v, source__vr.document_number__v, relationship_type__v, target__vr.name__v, target__vr.document_number__v
FROM relationships
WHERE TONAME(source__vr.type__v) = 'promotional_material__c'