**Source URL:** https://general.veevavault.dev/clinical/vql/query-targets/document-relationships.md

# 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](/vault-api/api-reference/26.1/documents/document-relationships/retrieve-document-type-relationships) 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 {#Relationship_Query_Examples}

The following are examples of relationship queries.

### Annotation Link Query {#Annotation_Link_Query}

The 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 {#Related_Document_Metadata_Query}

The 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'

```


---

**Previous:** [Document Events](/clinical/vql/query-targets/document-events)  
**Next:** [Document Roles](/clinical/vql/query-targets/document-roles)