Defining your data source
A data source teaches Virgo how to read one external system. A connector is a
class decorated with @datasource, extending VirgoDataSource, that declares what
the source contributes to the graph: its entities,
the relations between them, and the
exposure policies that let other sources
link to it. Once defined, ingestion turns the
source into part of the graph.
What a connector declares
Private preview
The Python SDK is in private preview, so APIs may still change. Email sales@virgo.fyi for early access.
@datasource
class GithubDataSource(VirgoDataSource):
name = "github"
identifier = "github"
description = "GitHub datasource"
webhook = Webhook()
entities = [GitRepository(), PullRequest(), GitUser(), GitCommit()]
relations = [Author(), ReviewedBy(), HasCommit()]
exposure_policies = [ExposePullRequest(), ExposeGitCommit()]identifiernames the source across the graph.webhookkeeps the source current after the first backfill; sources without one are polled on a schedule.entitiesandrelationsare the node and edge types this source contributes. Define them in Data source entities and Entity relationships.exposure_policieslet other sources reference this one. See Cross-domain linking.
Customizing ingestion
A connector can override ingestion hooks to change how its content is chunked, extracted, and linked. The defaults apply when you do not.
Related
- Data source entities: model the nodes your source produces.
- Entity relationships: connect them.
- Pull on installation: the initial backfill.