Skip to content

Commit 170c063

Browse files
committed
The source node from the schema graph.
1 parent 682ebf9 commit 170c063

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

internal/knowledge/graph_updater.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,8 @@ func NewGraphUpdater(graphDB GraphDB, schemaPersistor schema.Persistor) *GraphUp
2525
return &GraphUpdater{graphDB, schemaPersistor}
2626
}
2727

28-
// Augment the graph of the user with "observed" relation from the source to the each asset
29-
func (sl *GraphUpdater) appendObservedRelations(source string, updates *GraphUpdatesBulk) {
30-
assetsToAdd := []Asset{Asset{Type: "source", Key: source}}
31-
observedRelationsToRemove := []Relation{}
32-
observedRelationsToAdd := []Relation{}
33-
34-
for _, a := range updates.GetAssetUpserts() {
35-
observedRelationsToAdd = append(observedRelationsToAdd, Relation{
36-
Type: "observed",
37-
From: AssetKey(assetsToAdd[0]),
38-
To: AssetKey(a),
39-
})
40-
}
41-
42-
for _, a := range updates.GetAssetRemovals() {
43-
observedRelationsToRemove = append(observedRelationsToRemove, Relation{
44-
Type: "observed",
45-
From: AssetKey(assetsToAdd[0]),
46-
To: AssetKey(a),
47-
})
48-
}
49-
50-
updates.UpsertAssets(assetsToAdd...)
51-
updates.UpsertRelations(observedRelationsToAdd...)
52-
updates.RemoveRelations(observedRelationsToRemove...)
53-
}
54-
5528
// UpdateSchema update the schema for the source with the one provided in the request
5629
func (sl *GraphUpdater) UpdateSchema(source string, sg schema.SchemaGraph) error {
57-
for _, a := range sg.Assets() {
58-
sg.AddRelation(schema.AssetType("source"), "observed", a)
59-
}
60-
sg.AddAsset("source")
61-
6230
previousSchema, err := sl.schemaPersistor.LoadSchema(context.Background(), source)
6331
if err != nil {
6432
fmt.Printf("[ERROR] Unable to read schema from DB: %v.\n", err)

0 commit comments

Comments
 (0)